Vernalex.com
 
 M  E  N  U
 - Guides
 - Links
 - Tools
 - Themes
 




 
 

SysPrep Guide: Mass Storage Devices - [5/8] +

A mass storage device is any peripheral, like the name suggests, that stores a massive amount of data. The mass storage device itself is a hard-drive, but it could also be a device that controls something like a flash drive. However, what this refers to in SysPrep is really the mass storage controller device. Most people call these controller cards, but Microsoft uses the more proper and more generic term of mass storage device because it's not necessarily just a hard-drive.

When SysPrep is first executed it will load the drivers for all mass storage devices that you specify in the [SysprepMassStorage] section of the sysprep.inf answer file into the Windows boot loader. In some situations this isn't necessary, but if you're applying Windows installations across different chipsets then this will most likely be required. This is done so that when Windows is replicated onto a different computer with a different mass storage device that it can access the data on the extended portions of the data drive so that Windows can boot. The most common mistake is to not include a mass storage section and while the image will work on the original image computer it will reboot or blue screen with error 7b when the image is applied to a different computer.

If you are going to load mass storage drivers then you will need to add the [SysprepMassStorage] section. If you want Windows to load all mass storage drivers native to Windows then you will need to add the item BuildMassStorageSection=yes under the [SysPrep] section.

Sample SysPrep.inf set to enumerate generic Windows mass storage devices [example]

[Sysprep]
BuildMassStorageSection=yes

[SysprepMassStorage]

When you run SysPrep it would generate all the default mass storage drivers and add them to the [SysprepMassStorage] section and then it would add all of those drivers into the Windows' boot loader. You could also use the command-line switch of -bmsd on sysprep.exe and it will generate this section without the need for the BuildMassStorageSection value. The use of this switch is more desirable because you only need to run it once, whereas the item/value will generate the entries every time you run SysPrep. This is best explained through a video so see the video portion of this guide to see what I mean.

Sample SysPrep.inf with generic drivers (middle has been clipped) [example]

[SysprepMassStorage]
*pnp0a00=c:\windows\inf\machine.inf
*pnp0a01=c:\windows\inf\machine.inf
*pnp0a04=c:\windows\inf\machine.inf
*pnp0a03=c:\windows\inf\machine.inf
pci\cc_0604=c:\windows\inf\machine.inf

...

pcmcia\sony-memorystick(_64m)-8c2c=c:\windows\inf\mshdc.inf
pci\ven_1055&dev_9130=c:\windows\inf\mshdc.inf
pcmcia\micron-mtcf____-392d=c:\windows\inf\mshdc.inf
pci\ven_1179&dev_0105=c:\windows\inf\mshdc.inf

You can also load 3rd party mass storage drivers if using anything later than the Windows 2000 SysPrep Update 1.1 version. You would need to download those drivers and place them in a drivers folder. Then in the [SysPrepMassStorage] section you would need to specify the plug and play (PnP) path ID of the controller and the path to the driver. You will typically want to first generate the list as shown above and then merge them with a list like the one below.

Sample SysPrep.inf of custom mass storage section [example]

[SysprepMassStorage]
PCI\VEN_9005&DEV_00C0=C:\Drivers\Mass\Adaptec_Ultra160\ADPU160M.INF
PCI\VEN_9005&DEV_0080=C:\Drivers\Mass\Adaptec_Ultra160\ADPU160M.INF
PCI\VEN_9005&DEV_008F=C:\Drivers\Mass\Adaptec_Ultra160\ADPU160M.INF
PCI\VEN_9005&DEV_00CF=C:Drivers\Mass\Adaptec_Ultra160\ADPU160M.INF
PCI\VEN_104B&DEV_1040=C:\Drivers\Mass\VMWare\vmscsi.inf

At first glance those entries that I have added above are extremely cryptic. But, they follow a pattern that you should be able to see if you look closely and that is PCI\VEN_###&DEV_#### = PATH_TO_DRIVER. The first part before the equals sign is simply the plug and play (PNP) ID path to the device. The #### are simply 4-digit hexadecimal numbers, and there is one for both the VEN (vendor) and the DEV (device). So, every PNP device is simply referred to as a combination of vendor IDs and device IDs. The first part specified as PCI simply means the device is found on the PCI bus, but this could in theory be other things such as the PCMCIA bus.

After you have downloaded the mass storage device drivers that you will need you will need to figure out the PNP IDs so that you can add them to the list, like I did above. These will usually be found in the .INF file for the driver, but sometimes the drivers come with a TXTSETUP.OEM file that you can use to more easily extract them from. It should be noted that most mass storage device drivers have support for multiple devices and usually you will just add them all, but make sure you don't add duplicates to the list.

Once you have determined the PNP IDs then you just need to put the mass storage device drivers in a driver location. I recommend that you use C:\drivers\mass and then create a subfolder for each mass storage device driver family as I did in the sample, but you could also use c:\sysprep\mass or something similar. I personally place them in my normal driver directory so that in the future, much after applying the image to a computer, that if I add a controller card that I had drivers for that it will automatically detect and use those drivers without me having to download them again. Then in the INF you simply have to set the PNP ID equal to the path to the INF as I did in the sample.

Realistically you will most likely want to generate the generic Windows mass storage device drivers and then you will want to add your own to the list. This will provide your image with the most flexibility.

Sample SysPrep.inf merger of generic and custom [example]

[SysprepMassStorage]
*pnp0a00=c:\windows\inf\machine.inf
*pnp0a01=c:\windows\inf\machine.inf
*pnp0a04=c:\windows\inf\machine.inf
*pnp0a03=c:\windows\inf\machine.inf
pci\cc_0604=c:\windows\inf\machine.inf

...

pcmcia\sony-memorystick(_64m)-8c2c=c:\windows\inf\mshdc.inf
pci\ven_1055&dev_9130=c:\windows\inf\mshdc.inf
pcmcia\micron-mtcf____-392d=c:\windows\inf\mshdc.inf
pci\ven_1179&dev_0105=c:\windows\inf\mshdc.inf
PCI\VEN_9005&DEV_00C0=C:\Drivers\Mass\Adaptec_Ultra160\ADPU160M.INF
PCI\VEN_9005&DEV_0080=C:\Drivers\Mass\Adaptec_Ultra160\ADPU160M.INF
PCI\VEN_9005&DEV_008F=C:\Drivers\Mass\Adaptec_Ultra160\ADPU160M.INF
PCI\VEN_9005&DEV_00CF=C:Drivers\Mass\Adaptec_Ultra160\ADPU160M.INF
PCI\VEN_104B&DEV_1040=C:\Drivers\Mass\VMWare\vmscsi.inf

It should be noted that if you enter an invalid path to the driver then when you run SysPrep you will receive an error that states "unable to update the registry" and then SysPrep will quit. At this point you should verify your mass storage device driver list as one of the paths is incorrect.

If this section has confused you further then watch the video portion of this guide and you can see how I create the generic mass storage section and how I add custom items to the list.