Recovering a windows install that doesn't boot after changing the disk controller

When you replace computer or server hardware (motherboard, drive controller), the BSOD with error 0x0000007B can appear at the first time you boot Windows Server 2008 R2 or Windows 7. This stop code corresponds to the INACCESSABLE_BOOT_DEVICE error and is related to the difference of the hard disk controller of a new server (a computer or a virtual machine) from the original equipment.

More thorough explanation: http://woshub.com/bsod-error-0x0000007b-boot-windows-7-2008-r2/

Some help

All the answers are correct but you may need to perform few additional steps after you have installed virtio drivers. Here are the steps I followed:
  1. Open an elevated command prompt and set the VM to boot into safe mode by typing

    bcdedit /set {current} safeboot minimal

  2. shut-down the VM and change the boot device type to virtio.

  3. boot the VM. It will enter in safe mode.

    Note: In Safe mode all boot-start drivers will be enabled and loaded, including the virtio driver. Since there is now a miniport installed to use it, the kernel will now make it part of the drivers that are to be loaded on boot and not disable it again.

  4. in the booted VM reset the bcdedit settings to allow the machine to boot into the Normal mode by typing (in elevated command prompt again):

    bcdedit /deletevalue {current} safeboot

  5. Done.

Start Windows 10 reset from command line

For those who prefer command line, you can use one command to bring out Windows 10 reset feature.

1. Open an elevated command prompt

2. From there, type “systemreset” (without quotes). If you want to refresh Windows 10 and install Windows updates, then you should type “systemreset -cleanpc

3. Then you can select the option you need to reset your PC.

If your Windows 10 cannot load normally, you can boot into WinRE and select Command Prompt from the recovery options. Command prompt from WinRE the working directory is X:\windows\system32\. Since the systemreset.exe is located in C: drive, you should type “C:” to change the working directory to C: drive.

Notice: sometimes, the drive letter assigned in WinRE may not be the same as normal Windows. So you can type “diskpart” and then use “list volume” command to show the drive letter assigned to each drive.

If WinRE also fails to load you can boot your computer from Windows 10 recovery disk or installation disk to use the recovery options.

If Windows 10 reset failed with no changed were made, then you should check if the WinRE image and reset image are in place. You can run the command “reagentc info” to check the recovery image status.

Using DISM to install Storage Drivers

If you migrate Windows installations between storage adapters, you're often left with the well known STOP 0x7B INACCESSIBLE_BOOT_DEVICE. This happens because Windows doesn't yet have the required drivers installed, and/or set as boot-critical.

The dism.exe tool allows us to install (boot-critical) drivers into an offline Windows "image". Note that an offline Windows "image" is nothing special - a regular Windows install is a valid Windows "image".

After a STOP 0x7B, Windows Boot Manager usually sets up fallback boot into WinRE (Windows Recovery Environment). WinRE has a copy of the DISM tool, so you're good to go. (Cancel the Startup Recovery assistant if you have to.)

Example DISM commands to use from the WinRE (or WinPE) Command Prompt:

Install Microsoft/Generic Storage Drivers

This includes MSAHCI, IntelIDE, AMDIDE, ATAPI, PCIIDE and so on:
dism /image:d:\ /add-driver /driver:d:\windows\inf\mshdc.inf /forceunsigned

(D: is assumed to be the Windows SystemDrive partition.)

Install LSI MegaRAID / SAS/SATA Drivers

dism /image:d:\ /add-driver /driver:d:\windows\inf\megaraid.inf /forceunsigned

(D: is assumed to be the Windows SystemDrive partition.)

Install VirtIO Storage Drivers

If you have the VirtIO drivers ISO mounted, and added the drivers in the Recovery GUI, dism can add them to the offline Windows as well:
dism /image:c:\ /add-driver /driver:d:\win7\amd64\viostor.inf

(C: is assumed to be the Windows SystemDrive partition, and D: is the virtio ISO/CD.)

How to load VirtIO storage drivers in Windows System Restore

If you need to load VirtIO block storage driver (aka viostor) in Windows System Restore (aka Windows Recovery Mode) to recover your Windows virtual machine, take the following steps. (Also please read my note below).
  1. Download virtio-win iso and in your VM settings add it as a CD/DVD drive.

  2. Boot Windows System Restore and launch the Command Prompt:

  3. Run wmic logicaldisk get caption to get an idea of what drives are currently available. X: is System Restore itself and the virtio-win iso should be available either as D: or E:

  4. If you’re using Windows 10 x64, the command to load the storage driver would be:
    drvload D:\viostor\w10\amd64\viostor.inf. For other drivers and systems refer to VirtIO documentation.

  5. Verify there are new drives available by running wmic logicaldisk get caption again.

Once you have access to the system drive, you might want to install or update VirtIO storage driver on it. To do so, use the DISM command from this post by Christian Hofstaedtler.
Topic revision: r4 - 13 Sep 2021, NickDemou
Copyright © enLogic