Reducing Image Count


Reducing Image Count

In this section, I get to the point: how to reduce the number of images that you manage, and how the registry fits into that process. To reduce image count, you have to make sure that Windows can start on each hardware configuration because Windows must start before Mini-Setup Wizard can. Without additional effort on your part, this isn't always possible. Windows only knows about the devices installed on the sample computer, and if the target computer has different boot hardware (mass-storage controllers and system devices), it won't start.

The secret is to tell Windows about the other boot hardware that you expect it to encounter when you deploy the operating system. I'll show you the hard way first, which is to manually customize the Sysprep.inf file's [SysprepMassStorage] section, and then I'll show you the easy way, which is to allow Sysprep to build this section for you automatically. The manual method is what you used for Windows 2000, and you must use it with Windows if the operating system doesn't include native support for all the boot hardware in your organization. In either case, customizing [SysprepMassStorage] allows for the following combinations:

  • IDE to IDE.

    The sample computer uses a different IDE controller than the target computers.

  • IDE to SCSI.

    The sample computer uses an IDE controller, and the target computers use SCSI controllers.

  • SCSI to SCSI.

    The sample computer uses a different SCSI controller than the target computers.

  • SCSI to IDE.

    The sample computer uses a SCSI controller, and the target computers use IDE controllers.

NOTE
When deploying disk images to computers that use SCSI controllers, the target computers' hard disks must support the extended INT13 BIOS functions. They must be able to start using a Boot.ini file that uses the multi() syntax in lieu of the scsi() or signature() syntax. To ensure the use of the multi() syntax, add AddBiosToBoot to your answer file.

Filling SysprepMassStorage Manually

To fill the [SysprepMassStorage] section, you need to dig up the Plug and Play ID for each boot device on the target computers. There are a few ways to get this ID. One is to look for it in the INF files that come with Windows. Search %SystemRoot%\Inf for the name of the device, look in the INF file that you find, and record the device's ID as well as the name of the INF file in which you found it. For example, if I'm deploying a disk image to computers that have the Intel 82801BA Bus Master IDE Controller, I'd look in Mshdc.inf to get its Plug and Play ID, which is PCI\VEN_8086&DEV_244A. All your hits will be in Machine.inf, Scsi.inf, Pnpscsi.inf, and Mshdc.inf.

After you've identified boot devices, add them to your Sysprep.inf file in the [SysprepMassStorage] section. The following code shows the format. PNPID is the device's Plug and Play ID, and INF is the path and file name of the INF file that contains the Plug and Play ID of the device.

[SysprepMassStorage]  PNPID = INF

Here's an excerpt from a Sysprep.inf file that I used recently:

[SysprepMassStorage]  Primary_IDE_Channel=%SYSTEMROOT%\Inf\Mshdc.inf  Secondary_IDE_Channel=%SYSTEMROOT%\Inf\Mshdc.inf  PCI\VEN_8086&DEV_1222=%SYSTEMROOT%\Inf\Mshdc.inf  PCI\VEN_8086&DEV_1230=%SYSTEMROOT%\Inf\Mshdc.inf  PCI\VEN_8086&DEV_7010=%SYSTEMROOT%\Inf\Mshdc.inf  PCI\VEN_8086&DEV_7111=%SYSTEMROOT%\Inf\Mshdc.inf  PCI\VEN_8086&DEV_2411=%SYSTEMROOT%\Inf\Mshdc.inf  PCI\VEN_8086&DEV_2421=%SYSTEMROOT%\Inf\Mshdc.inf  PCI\VEN_8086&DEV_2441=%SYSTEMROOT%\Inf\Mshdc.inf  PCI\VEN_8086&DEV_244A=%SYSTEMROOT%\Inf\Mshdc.inf

If Windows doesn't provide native support for a boot device, you use a different format. First copy the device driver's files to a folder on the disk image. The easiest way is to add them to the Windows distribution folder $OEM$\$$\Drivers so that the setup program automatically copies them to %SystemRoot%\Drivers on the sample computer. Then add lines to the [SysprepMassStorage] section that look like the following line of code. PNPID is the Plug and Play ID of the device. INF is the path and file name of the INF file that contains the Plug and Play ID, such as %SystemRoot%\ Drivers\Filename.inf. DIR is the name of the directory on the floppy disk that contains the device driver. DESC is a description of the disk as specified in the Txtsetup.oem file, and TAG is the disk tag as specified in the Txtsetup.oem file. The last three items are optional.

PNPID = INF[, DIR[, DESC[, TAG]]]

Filling SysprepMassStorage Automatically

New for Windows is the ability to automatically build the Sysprep.inf file's [SysprepMassStorage] section. By adding the lines that you see in the following code to your Sysprep.inf file, Sysprep extracts all the Plug and Play IDs from Machine.inf, Scsi.inf, Pnpscsi.inf, and Mshdc.inf and adds the appropriate entries. Make sure that you leave the [SysprepMassStorage] section empty, and double-check your spelling of BuildMassStorageSection. (I've spent hours troubleshooting a file in which I misspelled the name of this setting.)

[Sysprep]      BuildMassStorageSection=Yes    [SysprepMassStorage]

NOTE
When you build the [SysprepMassStorage] section automatically, Sysprep takes much longer to run. Rather than shutting down the computer after a few seconds, which is Sysprep's typical behavior, Sysprep grinds away for about 15 minutes while it builds this section. Be patient as long as you see hard disk activity and a spinning hourglass. Reducing image count is worth the wait.

Cleaning Up After Sysprep

You're not finished yet. Sysprep adds the devices in the [SysprepMassStorage] section to the Windows critical device's database. This database is in the registry at HKLM\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase. Each subkey corresponds to a device you added to [SysprepMassStorage] and contains a link to the actual device driver in the registry. Windows tries to start each device in the database every time it boots. The problem is that this increases boot time significantly–something you don't want to inflict on users.

Don't I always have a solution? On each target computer, run sysprep.exe –clean –quiet. This command disables all the devices that Windows didn't find when it started. The next time the operating system starts, it doesn't try to start device drivers for those devices that it didn't find. The trick is when to run this command. You don't do it when you build the image. Instead, you run the command during Mini-Setup Wizard. Add the command to the Cmdlines.txt file that you create in %SystemDrive%\ Sysprep\i386\$OEM$. The file looks like the following code. Make sure that InstallFilesPath points to the folder containing the $OEM$ folder, which is usually %SystemDrive%\Sysprep\i386, and that you set OemPreinstall=Yes.

[Commands]  "%SYSTEMDRIVE%\Sysprep\Sysprep.exe -clean –quiet"



Microsoft Windows Registry Guide
Microsoft Windows Registry Guide, Second Edition
ISBN: 0735622183
EAN: 2147483647
Year: 2003
Pages: 186

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net