Restoring Lenovo X220 Windows 7 Disk From The Original Partition Backup

February 2016

Problem description: Background Information:

The original Win 7 disk contains 3 partitions:

Drive Letter Label Partition Size
S SYSTEM_DRV 1199
C Windows7_OS Remainder
Q Lenovo_Recovery 12000

Backup of the restore partition (Q) was created by using Linux command under running Knoppix:

dd if=/dev/sda3 of=sda3.img

Solution used:

  1. Boot the laptop from Win 7 recovery or install disk to command Windows line
  2. Delete unused partitions, then partition and format your new disk following way (this example deletes two existing partitions - adjust as needed):
    diskpart

    list disk
    select disk 0

    list partition
    select partition 1
    delete partition

    select partition 2
    delete partition

    create partition primary size=1199
    select partition 1
    active
    format fs=ntfs label="SYSTEM_DRV" quick
    assign letter=s

    create partition primary size=...calculate=diskSize-1199-12000(-2000 for SSD)...
    select partition 2
    format fs=ntfs label="Windows7_OS" quick
    assign letter=c

    create partition primary size=12000
    select partition 3
    format fs=ntfs label="Lenovo_Recovery" quick
    assign letter=q

    exit

    shutdown
  3. Convert sda3.img to VirtualBox disk image by:
    VBoxManage convertfromraw --format VDI sda3.img sda3.vdi
  4. Connect and mount sda3.vdi and the new Q partition in VirtualBox VM. The VM can run any Linux, Live Linux such as Knoppix or even Win 7.
    Copy all files and directories from the original Lenovo_Recovery (Q) partition to the new disk Q partition.
  5. Get imagex.exe Windows executable from The Windows® Automated Installation Kit (AIK) for Windows® 7
    I downloaded it from Microsoft https://www.microsoft.com/en-us/download/details.aspx?id=5753 and installed it in spare Win 7 machine. I found the file in: C:\Program Files\Windows AIK\Tools\amd64\imagex.exe
    Copy the file to Q partition on your new disk together with the Lenovo restore files.
  6. Put the new disk with the recovery data + imagex.exe to x220 and boot from Win 7 recovery or install disk to command Windows line.
    imagex.exe /apply /verify Q:\factoryrecovery\Sdrivebackup.wim 1 S:\
    imagex.exe /apply /verify Q:\factoryrecovery\Cdrivebackup.wim 1 C:\
    shutdown
  7. Reboot X220 from the new drive and everything should be as if you would be booting for the firs time.

Links: