How to add NVME drivers to Windows 7 (install/repair) ?

In this blog post I will explain how to add NVME drivers to a Windows 7 installation.

Current setup and situation

  • An old Windows 7 from a hard drive that I copied into an NVME M2 disk
    • dd if=/dev/sda of=/dev/nvme0n1 bs=10M conv=sync,noerror status=progress.
    • The old disk was plugged into an USB port. I used Debian live to copy the data.
  • A ThinkPad T590.
  • The old Windows 7 system booted fine on a ThinkPad P70
  • On the new ThinkPad T590 it does not boot, because some drivers are missing.

Making an USB key

WARNING: For recovery you should use an ISO that is the same variant than the system you are trying to repair.

I used the ISO 7601.24214.180801-1700.win7sp1_ldr_escrow_CLIENT_HOMEPREMIUM_x64FRE_en-us.iso from archive.org

ISO fingerprints:

  • sha512: 91c5cb78fbbaff269bab48f4b67b041afca5ec71cc7beb5ff7fb05e1e4fe8b44aae0e4b8d5fe5a62894a7f7c2e90f024abec66cc72e06b30eb7ab5d52d42381b
  • sha256: 42dc3f66741a3afbb9223b1e45e811c4f881c7ef19ccb7ac2fdb43025193901a
  • sha1: c15bb9873548bd4a69371bc7966560c13162128c
  • rg-adguard: proof this is an official ISO (Windows 7 with Service Pack 1 (Updated August 2018))

On Windows you can use Rufus to make the USB drive.

Rufus 4.9p ready to make the Windows USB key Rufus 4.9p done making the Windows USB key

On Linux/Debian 13 you can maybe do the work of Rufus, but I have no easy solution for you (given that we need to edit the result/ISO).

Adding drivers and all updates using UpdatePack7R2.exe

The tool is published here: simplix's blog

You can download it here: UpdatePack7R2-25.8.12.exe from archive.org

You can find your Index by running: dism.exe /Get-ImageInfo /imagefile:F:\sources\boot.wim
Or it will take ages by applying updates 4 times, one for each edition of Windows.

UpdatePack7R2-25.8.12.exe /WimFile=F:\sources\install.wim /Index=* /Boot=F:\sources\boot.wim /Optimize

Then, when it is finished and presents a log: you can ask to eject the USB key.

For installation

It works ! It works !

Note: I used the ISO fr_windows_7_home_premium_with_sp1_x64_dvd_u_676521.iso

For recovery

Using 7-zip you need to open F:\sources\install.wim and then copy C:\Windows\System32\Recovery\winRE.wim into an USB key.
Then use this key with Debian live ISO and replace the winRE.wim file you will find in the SYSTEM partition. You can now reboot, you will now have NVME and USB 3.0 working fine in recovery mode !

Add drivers to Windows 7

When you are in recovery mode, open a terminal and run:

diskpart
list volume
exit

You can now understand what letter is assigned to your install drive.
Then run (G: is another USB key):

mkdir G:\TEMP
dism /Image:C:\ /Add-Package /PackagePath:"G:\WIM-TEMP" /ScratchDir:"G:\TEMP"


dism /Mount-Image /Image:D:\ /Add-Package /PackagePath:"G:\WIM-TEMP"

dism /Image:D:\ /Add-Driver /Driver:"G:\WIM-TEMP" /Recurse /forceunsigned

dism /Unmount-Image /MountDir:C:\tmp\mount /Commit

See: Dism /Add-Package documentation at Microsoft

If needed (ROLLBACK): dism /image:C:\ /cleanup-image /RevertPendingActions

https://superuser.com/a/938104/609233

Adding the NVME driver with dism

Check out pc2s.fr blog post that has a similar way to do it.

Alternative downloads:

Update WIM files

We will need some Microsoft updates & drivers:

  • NVMe Support Hotfix (KB2990941)
  • NVMe Bugfix (KB3087873)
  • Kernel-Mode Driver Framework version 1.11 (KMDF supports kernel-mode drivers)
  • Intel(R) USB 3.0 eXtensible Host Controller drivers (unzip: Intel_USB_3.0_xHC_Driver_KBL_MR3_5.0.3.42\Drivers\Win7\x64)

On the USB key, create a folder named WIM-TEMP in your local user and extract the files into it:

The folder WIM-TEMP ready

From the start menu, open the terminal as an Administrator: Open the terminal as an Administrator

The boot.wim image

You can check by running: dism.exe /Get-ImageInfo /imagefile:F:\sources\boot.wim

  • The first Index (1) is for Windows PE
    • Run the commands
      • mkdir C:\WIM-MOUNT
      • dism.exe /Mount-WIM /WimFile:"F:\sources\boot.wim" /index:1 /MountDir:"C:\WIM-MOUNT"
      • dism.exe /image:"C:\WIM-MOUNT" /Add-Package /PackagePath:"C:\Users\Williamdes\Documents\WIM-TEMP"
      • dism.exe /image:"C:\WIM-MOUNT" /Add-Driver /Driver:"C:\Users\Williamdes\Documents\WIM-TEMP" /Recurse
      • dism.exe /Unmount-wim /mountdir:"C:\WIM-MOUNT" /commit

Update boot.wim index 1

  • The second Index (2) is for Windows Setup
    • Run the commands
      • dism.exe /Mount-WIM /WimFile:"F:\sources\boot.wim" /index:2 /MountDir:"C:\WIM-MOUNT"
      • dism.exe /image:"C:\WIM-MOUNT" /Add-Package /PackagePath:"C:\Users\Williamdes\Documents\WIM-TEMP"
      • dism.exe /image:"C:\WIM-MOUNT" /Add-Driver /Driver:"C:\Users\Williamdes\Documents\WIM-TEMP" /Recurse
      • dism.exe /Unmount-wim /mountdir:"C:\WIM-MOUNT" /commit

Update boot.wim index 2

The install.wim image

You should check by running: dism.exe /Get-ImageInfo /imagefile:F:\sources\install.wim

For the second ISO, there is 4 indexes:

  • 1 -> Windows 7 Home Basic
  • 2 -> Windows 7 Home Premium
  • 3 -> Windows 7 Professional
  • 4 -> Windows 7 Ultimate

Use the right one. For the second ISO use the index 3.

  • The third index (3) is for Windows 7 Professional
    • Run the commands
      • dism.exe /Mount-WIM /WimFile:"F:\sources\install.wim" /index:3 /MountDir:"C:\WIM-MOUNT"
      • dism.exe /image:"C:\WIM-MOUNT" /Add-Package /PackagePath:"C:\Users\Williamdes\Documents\WIM-TEMP"
      • dism.exe /image:"C:\WIM-MOUNT" /Add-Driver /Driver:"C:\Users\Williamdes\Documents\WIM-TEMP" /Recurse
      • dism.exe /Unmount-wim /mountdir:"C:\WIM-MOUNT" /commit
      • rmdir C:\WIM-MOUNT

Update install.wim index 3

Now, eject the USB key.

It works !

The winRE.wim image

This is the recovery image from the SYSTEM partition.
You can extract it from an existing Windows installation and perform the following commands:

You can check by running: dism.exe /Get-ImageInfo /imagefile:C:\Users\Williamdes\Documents\winRE.wim

  • The first index (1) is Microsoft Windows Recovery Environment (x64)
    • Run the commands
      • mkdir C:\WIM-MOUNT
      • dism.exe /Mount-WIM /WimFile:"C:\Users\Williamdes\Documents\winRE.wim" /index:1 /MountDir:"C:\WIM-MOUNT"
      • dism.exe /image:"C:\WIM-MOUNT" /Add-Package /PackagePath:"C:\Users\Williamdes\Documents\WIM-TEMP"
      • dism.exe /image:"C:\WIM-MOUNT" /Add-Driver /Driver:"C:\Users\Williamdes\Documents\WIM-TEMP" /Recurse
      • dism.exe /Unmount-wim /mountdir:"C:\WIM-MOUNT" /commit
      • rmdir C:\WIM-MOUNT

Put the image back into the original computer.

Notes

This article is not perfect, it was a lot of trial an error.
Using UpdatePack7R2 was the best solution, as it made me a working USB drive to boot.
Please email me to improve the article or provide feedback.

Also, on the ThinkPad T590 I could get the graphics working for Windows 7 using this custom driver: Intel UHD Graphics 610/630 x64 driver for Windows 7, 8.x, 10 (up to 1607)
That said I could not find a way to make the USB 3.0 work in the running Windows 7 OS. And it seems to be impossible to have a driver that works for the Intel Wifi card 8086:9df0:8086:0030 - Cannon Point-LP CNVi. I tried modifying the Windows 10 driver and after it installs the network card does not work. That said ethernet worked as expected.

More ISOs

References