Injecting Mass Storage Drivers into a Windows XP image using MDT 2010/2012

This article talks about how to inject mass storage drivers into a Windows XP image using MDT 2010/2012

Whenever you need update a XP image with the newer version of SATA drivers it’s mandatory that we capture the image first. In Windows 7 we need not capture the image. Instead we can just add them to the Out of box drivers. When using XP, you can use Out of box drivers to update other drivers like display, audio etc but not mass storage drivers.

There are few other ways of injecting SATA drivers to an already created image to avoid capturing the image again, but this article talks only about the sysprep method.

The standard method to inject SATA drivers in Windows XP is by adding the driver information to sysprep.inf. The image is then captured with the mass storage drivers using the driver information in sysprep.inf which is then deployed on to the target machines.

Let’s get started.

Create deployment share

Create a Deployment share with “Standard Client Task Sequence” with capture option. Import the XP image. If you are using a custom image instead of XP Vanilla source, then make sure you provide the path of the Sysprep files when importing the OS by selecting “Copy Windows XP or Windows Server 2003 Sysprep files from the specified path”

Disable “Add mass storage drivers to sysprep.inf for XP and 2003″ from the task sequence. In MDT 2012 you will find this task in two places. Disable both.

Download Drivers

I will be using the latest version of Intel SATA drivers and the same should be applicable for other versions as well.

Download the latest SATA drivers (10.8.0.1003) from Intel web site. (iata_enu_10.8.0.1003.exe)

http://downloadcenter.intel.com/confirm.aspx?httpDown=http://downloadmirror.intel.com/20624/eng/iata_enu_10.8.0.1003.exe&lang=eng&Dwnldid=20624&ProductID=2101&ProductFamily=Chipsets&ProductLine=Chipset+Software&ProductProduct=Intel%c2%ae+Rapid+Storage+Technology

Now we need to extract the required driver files from the setup file downloaded. This can be achieved by using a command line switch (iata_enu_10.8.0.1003.exe –a) or by executing the setup file. When the setup file is executed (iata_enu_10.8.0.1003.exe) a directory called IIF2 folder gets created under C:\Windows\Temp. Extracting drivers from other versions SATA setup files might slightly differ. The driver files are located at C:\Windows\Temp\IIF2\Drivers\x32. Below are the files what we would need

  1. iaAHCI.cat
  2. iaAHCI.inf
  3. iaStor.cat
  4. iaStor.inf
  5. iaStor.sys
  6. TXTSETUP.OEM (This file might not be there in all the driver setup files and is optional)

These drviers need to be a copied to a location in the deployment share so that during deployment, these files will be copied to the destination machines. These drivers are then picked up by sysprep and injected into the OS which can later be captured.

The drivers need to be copied to a folder called $OEM$ under the deployment share.
MDT 2010/2012 looks in the following locations within the deployment share, in the order specified, to find an $OEM$ folder:

  1. Control\BuildID (where BuildID is the name or ID of the task sequence that MDT 2010 is installing). Create $OEM$ folders in this location to create a custom folder for each build.
  2. Operating Systems\Name (where Name is the name of the operating system MDT 2010 is installing). Create $OEM$ folders in this location to create a custom folder for each operating system.
  3. Platform (where Platform is either x86 or x64). Create $OEM$ folders in this location to create a custom folder for each platform.
  4. $OEM$, which is at the root of the deployment share and is the default $OEM$ folder if a folder is not found in the previous locations.

The $OEM$ folder can contain some folders with special names to organize files. The following list describes each folder that you can create within an $OEM$ folder:

  1. $$ – During deployment, Windows Setup copies the contents of this folder to %SystemRoot% on each destination computer. It replicates all the folders, subfolders, and files that this folder contains in the %SystemRoot% folder of each destination computer. For example, Windows Setup to copy a file to %SystemRoot%\System32 on each destination computer, put the file in $OEM$\$$\System32.
  2. $1 – During deployment, Windows Setup copies the contents of this folder to %SystemDrive% on each destination computer. It replicates all the folders, subfolders, and files that this folder contains in the %SystemDrive% folder on each destination computer. This is typically drive C on most computers.
  3. Drive – Drive is a drive letter (C, D, E, and so on). Windows Setup copies the contents of this folder to the root of the corresponding drive on each destination computer. It replicates all the folders, subfolders, and files that this folder contains in the corresponding drive during the setup process. For example, Windows Setup copies any files put in $OEM$\D to the root of drive D on each destination computer. Microsoft recommends that these folders not be used. The folders rely on a very specific disk configuration on the destination computer. Use $1 to represent %SystemDrive%, instead. In most installations, $OEM$\$1 and $OEM$\C write to the same location: the root of drive C.
  4. TEXTMODE – For Windows XP and Windows Server 2003, this folder contains hardware-specific files that Windows Setup and text-mode setup install on the destination computer during the text-mode phase of the installation process. These files may include OEM HALs, mass-storage device drivers, and the Txtsetup.oem file. The Txtsetup.oem file describes how to load and install these files. List these files in the [OemBootFiles] section of the answer file.

The above information is taken from: http://www.myitforum.com/absolutenm/templates/Articles.aspx?articleid=20632&zoneid=89

We will be using the DeploymentShare\Control\BuildID\$OEM$ folder to place the SATA drivers in our case.

Copy the extracted drivers to DeploymentShare\Control\BuildID\$OEM$\$1\SATA – This means that SATA folder (and sub folders) will be copied to %SystemDrive% i.e C:\SATA
You can have multiple folders under $1(or any of the above mentioned folders) as you wish to categorize and sort the drivers .
Eg: $OEM$\$1\Drivers\SATA1, $OEM$\$$\Mass_Storage etc. We will be using only $OEM$\$1 in our case.

If you have multiple versions of SATA drivers and other mass storage drivers you can create separate folders for each version and place them under $1 or $$ folders and update the sysprep.inf accordingly.

Add driver information to sysprep.inf

Once you have drivers in place, you need to gather the PNP IDs of these drivers and include them in sysprep.ini. You will find the PNP IDs in iaAHCI.inf and iaStor.inf. If you have different set of mass storage drivers other than Intel SATA then the PNP IDs would be in .inf files.

Eg: If you open iaAHCI.inf file you will find something like below
PCI\VEN_8086&DEV_27C1&CC_0106.DeviceDesc = “Intel(R) ICH7R/DH SATA AHCI Controller”
PCI\VEN_8086&DEV_27C5&CC_0106.DeviceDesc = “Intel(R) ICH7M/MDH SATA AHCI Controller”

The PNP IDs in the above example are
PCI\VEN_8086&DEV_27C1&CC_0106 and PCI\VEN_8086&DEV_27C5&CC_0106 which need to be included in sysprep.inf
You can include the PNP IDs in sysprep.inf as
PCI\VEN_8086&DEV_27C1&CC_0106=%SystemDrive%\SATA\iaAHCI.inf
PCI\VEN_8086&DEV_27C5&CC_0106==%SystemDrive%\SATA\iaAHCI.inf(You can even hardcode the driver letter Eg: C:\SATA\iaAHCI.inf)

%SystemDrive%\SATA\iaAHCI.inf is the path of the .inf file on the destination machine which has the the specified PNP ID. Since we have the drivers under $OEM$\$1\SATA in the deployment share, these drivers would be copied to %SystemDrive%\SATA which is C:\SATA in our case. Since we gathered these PNP IDs from iaAHCI.inf we will add that file to the path. If you PNP ID is in let’s say abcd.inf then you would specifiy the path of that abcd.inf

Similarly, add all the PNP IDs and the INF path information in the sysprep.inf. This sysprep.inf can be opened from the DeploymentShare\Control\BuildID \syspre.inf or by going to the Task sequence properties -> OS info tab -> Edit Sysprep.inf

Also, comment out BuidMassStorageSection = Yes in sysprep.inf by adding semi-colon to the beginning of the statement (;)

Sysprep.inf should contain something like below
[Sysprep]
;BuildMassStorageSection = Yes

[SysprepMassStorage]

PCI\VEN_8086&DEV_27C1&CC_0106=C:\SATA\iaAHCI.inf
PCI\VEN_8086&DEV_27C5&CC_0106=C:\SATA\iaAHCI.inf
PCI\VEN_8086&DEV_2922&CC_0106=C:\SATA\iaAHCI.inf
PCI\VEN_8086&DEV_2929&CC_0106=C:\SATA\iaAHCI.inf
PCI\VEN_8086&DEV_3A02&CC_0106=C:\SATA\iaAHCI.inf
PCI\VEN_8086&DEV_3A22&CC_0106=C:\SATA\iaAHCI.inf
PCI\VEN_8086&DEV_3B29&CC_0106=C:\SATA\iaAHCI.inf
PCI\VEN_8086&DEV_3B2F&CC_0106=C:\SATA\iaAHCI.inf
PCI\VEN_8086&DEV_3B22&CC_0106=C:\SATA\iaAHCI.inf
PCI\VEN_8086&DEV_1C02&CC_0106=C:\SATA\iaAHCI.inf
PCI\VEN_8086&DEV_1C03&CC_0106=C:\SATA\iaAHCI.inf
PCI\VEN_8086&DEV_27C3&CC_0104=C:\SATA\iaStor.inf
PCI\VEN_8086&DEV_27C6&CC_0104=C:\SATA\iaStor.inf
PCI\VEN_8086&DEV_2822&CC_0104=C:\SATA\iaStor.inf
PCI\VEN_8086&DEV_282A&CC_0104=C:\SATA\iaStor.inf

Now all these drivers would be injected into the Windows XP image when Sysprep is run. After this, it will be captured to another image.

This image is the final image which can be imported in another deployment share for deploying on user machines (destination machines).

Aligning Disk using MDT 2012

I discovered a new variable in MDT 2012(beta 2) called OSDDiskAlign.
This can be used to align the disks, useful when deploying Windows XP on Advanced Format (AF) Drives. You can use it in CustomSettings.ini
Eg: OSDDiskAlign = 1024

Converting a multi-partition Windows XP Ghost image to WIM images and deploying using MDT

One my colleagues asked me if we could convert a Ghost image to a WIM image which can be deployed using MDT. So I did a bit of research and was able to achieve it.

Some back ground about the Ghost image I used:
Our Ghost XP image has 3 partitions with C:, D: and E:. We allocate the below sizes for these partitions when using Ghost to deploy the image.
C: drive – 50% (OS), D: drive – 40% (DATA) and E: drive 10% (MISC)
C: drive has the Operating System, D: drive has user profiles and other data, E: drive has miscellaneous data.

Below is how I converted these to WIM images and later deployed using MDT.

I am using MDT 2012 beta 2 and this method should ideally work with MDT 2010 though I have never tried.

We would be using two deployment shares. The first deployment share (XP_Ghost) is used to capture the XP partitions to WIM files. The second deployment share (XP_Deploy) is where you import the captured WIM files which are then deployed on target machines.

Here we go…

Creation and configuration of the first Deployment Share – XP_Ghost

Create Deployment share (XP_Ghost)

  1. Provide the Deployment share path
    clip_image002
  2. Specify the share name to be used
    clip_image004
  3. Provide the description
    clip_image006
  4. Select the below and click Next
    clip_image008
  5. Click Next
    clip_image010

Import Operating System (Windows XP OEM source)

  1. Select “Full set of source files” and click Next
    clip_image012
  2. Provide the path of XP OEM source files
    clip_image014
  3. Accept the defaults and click Next
    clip_image016
  4. Click Next
    clip_image018
  5. Click Finish
    clip_image020

Create Task Sequence (XP_Ghost_TS)

  1. Provide the below info and click Next
    clip_image022
  2. Select “Sysprep and Capture” and click Next
    clip_image024
  3. Select the below and click Next
    clip_image026
  4. Select the below and click Next
    clip_image028
  5. Provide below info and click Next
    clip_image030
  6. Provide Administrator password and click Next
    clip_image032
  7. Click Next
    clip_image034
  8. Click Finish
    clip_image036
  9. The task sequence XP_Ghost can capture only C: drive hence we need to modify the task sequence to capture D and E drives. Add the below command line after “Create WIM” task in the task sequence.
    clip_image038
  10. Add “Run Command Line” to the task sequence to capture D: with the following command line
    "%DeployRoot%\Tools\X86\imagex" /capture D: "%ComputerBackupLocation%\XP_D_Drive.wim" "D Drive"
  11. Add “Run Command Line” to the task sequence to capture E: with the following command line
    "%DeployRoot%\Tools\X86\imagex" /capture E: "%ComputerBackupLocation%\XP_E_Drive.wim" "E Drive"

    The command line is to capture the D/E drives and place it under DeploymentShare\Captures folder by default. This location can be changed during the initial Task sequence wizard on the reference machine which is stored in “ComputerBackupLocation” variable.

Out of box drivers

Import the required WinPE drivers in the XP_Ghost deployment share for the reference machine to connect to the MDT/WDS server

Reference machine

Once the Deployment Share is created and configured do the below

  1. Deploy Windows XP ghost image on the reference machine using GhostCast server or using Ghost bootable CD/DVD/USB.
  2. Login to XP on the reference machine.
  3. Connect to the XP_Ghost$ share located on the MDT server and run Scripts\litetouch.vbs (Make sure that the required network card drivers are installed on the reference machine to connect to the Deployment Share)
  4. Select XP_Ghost_TS task sequence
    clip_image040
  5. Provide the below info. File name is : XP_C_Drive.Wim
    clip_image042
  6. Click Finish
    clip_image044

Now sysprep will be executed and the machine is rebooted. After reboot the reference machine will boot using WinPE and C,D and E drives are captured to WIM files. These files are placed under DeploymentShare\Captures folder on the MDT server

These WIM files can now be deployed on Target machines. Below is how you can do it.

Creation and configuration of the second Deployment Share – XP_Deploy

Create Deployment Share(XP_Deploy)

  1. Provide the Deployment Share path
    clip_image046
  2. Specify the share name to be used
    clip_image048
  3. Provide the description
    clip_image050
  4. Click Next
    clip_image052
  5. Click Next
    clip_image054
  6. Click Finish
    clip_image056


Import Operating System

Now we need to import the WIM files which were created previously. Though we can import all the WIM files (C,D & E), only the WIM file with the operating system will be visible under Operating Systems node in MDT. WIM files without an operating system (D and E drives) can be deployed by copying the WIM files to a location in the deployment share and by adding command line tasks to the task sequence which applies these images on the target machines.

  1. Select “Custom image file”
    clip_image058
  2. Provide the path XP_C_Drive (Only this file has the operating system)
    clip_image060
  3. Accept the defaults and click Next
    clip_image062
  4. Click Next
    clip_image064
  5. Click Next
    clip_image066
  6. Click Finish
    clip_image068

Create Task Sequence (XP_Deploy_TS)

  1. Provide the below info and click Next
    clip_image070
  2. Select “Standard Client Task Sequence” and click Next
    clip_image072
  3. Select the available Operating System and click Next
    clip_image074
  4. Select “Do not specify a product key at this time” and click Next
    clip_image076
  5. Provide the below info and click Next
    clip_image078
  6. Specify the Administrator password and click Next
    clip_image080
  7. Click Next
    clip_image082
  8. Click Finish
    clip_image084
  9. Create XP_D_Drive and XP_E_Drive under DeploymentShare\Operating Systems and copy the WIM files to the folders
  10. Edit “Format and Partition Disk” of XP_Deploy_TS with the information as in the screenshots. Make sure the variable names for the partitions are CDrive,DDrive and EDrive. These variables are used later in the task sequence.
    clip_image086
    clip_image088
    clip_image090
    clip_image092
  11. Add the below command line after “Install Operating System” task in the task sequence.
    clip_image094
    1. Add “Run Command Line” to the task sequence to capture D: with the following command line
      "%DeployRoot%\Tools\X86\imagex" /apply "%DeployRoot%\Operating Systems\XP_D_Drive\XP_D_Drive.wim" 1 %DDrive%
    2. Add “Run Command Line” to the task sequence to capture E: with the following command line
      "%DeployRoot%\Tools\X86\imagex" /apply "%DeployRoot%\Operating Systems\XP_E_Drive\XP_E_Drive.wim" 1 %EDrive%

      These commands apply the WIM files to partitions created in the previous steps.

Out of box drivers

Import the required WinPE and XP drivers in the XP_Deploy_TS deployment share for the target machines

Now you should be able to deploy the Windows XP with 3 partitions which were converted from a Ghost image.

Secret command promt to fix EXE file assocation

There will be times when you lose the EXE file association.  That means that you cannot import a .reg to get the association back since it uses Registry which is an exe file. You cannot try VB or Batch script since all these methods use an application to run and that application itself is an exe.

Below steps show how to open a command prompt even when the EXE file association is lost.

  1. Open Windows Task Manager by pressing CTRL+ALT+ESC
  2. Click File Menu
  3. Keep the CTRL button pressed and click on “New Task (Run…)” which will open a command prompt

Once command prompt is opened you can import a reg file by using “REG /import” command
The .reg file is available here: http://www.dougknox.com/xp/file_assoc.htm

Install Windows 7 using USB

Go to command prompt and run the following commands:

DISKPART
LIST DISK
SELECT DISK 1
(The disk no. may vary)
CLEAN
CREATE PARTITION PRIMARY
SELECT PARTITION 1
ACTIVE
FORMAT QUICK FS=NTFS
ASSIGN
EXIT

Now you need to copy all the windows 7 source files to the USB either using command or gui.
You should now be able to install Windows 7 by booting with the USB.