Category Archives: Imaging

How to add SATA drivers offline to a WIM image of Windows XP

I have been using ImageX to create WIM images of Windows XP for some time now. After imaging a Toshiba A9 laptop with an image created on a Toshiba A8, Windows XP failed to boot, displaying instead the dreaded Stop Error 0x0000007B INACCESSIBLE_BOOT_DEVICE. To quote the Microsoft knowledge base article: “This error may occur if the registry entries and the drivers for the mass storage controller hardware in the backup computer are not installed in Windows XP.” In other words, Windows doesn’t have the SATA drivers needed to communicate with the hard disk. The next step is usually to:

  1. Download the necessary drivers
  2. Copy the drivers to a floppy disk
  3. Run a repair install of XP
  4. Press F6 when prompted during Setup to install the drivers
  5. Run Sysprep
  6. Recapture an image that will now have the necessary drivers installed

This time however, I decided to take advantage of ImageX’s ability to easily mount a WIM image for offline editing. So here is what I did (be aware that this is a hack, it worked for me but there’s no guarantee that it’ll work for you):

  1. Downloaded and extracted the needed SATA drivers from the Toshiba website. The archive contains 6 files: iaahci.cat, iaahci.inf, iastor.cat, iastor.inf, iaStor.sys, and TXTSETUP.OEM.
  2. Mounted the WIM image of Windows XP to an empty folder (C:\Mount) using the command:
    imagex /mountrw C:\PathToYourWIMImage\WindowsXP.wim 1 C:\Mount
  3. Followed the instructions on this thread to copy the driver files where they belong:
    • Copied the .inf files (iaahci.inf and iastor.inf) to C:\Mount\Windows\inf
    • Copied the .sys file (iaStor.sys) to C:\Mount\Windows\system32\drivers
    • Copied all remaining files (iaahci.cat, iastor.cat, iaStor.sys, and TXTSETUP.OEM) to C:\Mount\Windows\system32

    • Loaded the HKEY_LOCAL_MACHINE\SYSTEM hive of the mounted image in the registry:
      • Opened the Registry Editor (type regedit at the command prompt)
      • Selected the HKEY_LOCAL_MACHINE hive
      • Clicked on File>Load Hive and selected C:\Mount\Windows\system32\config\system
      • Named the loaded hive Temp (it can be named anything you want)
    • In Notepad, created a .reg file (SATA_Keys.reg for example) to import the appropriate settings into the mounted hive (click on the picture to download SATA_Keys.doc that you’ll have to rename SATA_Keys.reg):
    Registry File

    How do you come up with this file? Well again, this thread helped a lot, as did that one.  Basically you have to open the .inf files (iaahci.inf and iastor.inf) and locate:

    • the ClassGUID entry in the [version] section.
    • the PCI\VEN entries in the [ControlFlags] section
    • the AddService value in the [iaStor_Inst.Services] section in this case.

    If you look back at the .reg file, you’ll notice that the first 6 keys, derived from iaahci.inf, all have the same ClassGUID, only the PCI\VEN values change. The next 6, derived from the other .inf file (iastor.inf), share a different ClassGUID. Finally, both .inf files refer to the same service (iaStor) which has to be added. Note that in this example, the hexadecimal value of ImagePath means “system32\drivers\iaStor.sys”.

    6.   Double-clicked the .reg file to merge the settings in the registry

    7.   Unloaded the Temp hive (File>Unload Hive)

    8.   Unmounted the WIM image without forgetting the /commit switch (or all the changes would be lost):

    imagex /unmount C:\Mount /commit

    9.   Reimaged the laptop which booted just fine and installed the SATA drivers from within the OS to ensure proper installation.