VM HDD Recovery after SAN Failure

Our EMC storage lost too many drives recently, which caused several VMs to have HDD “physical” failures. Although many VMs were permanently damaged, several showed promise of recovery. The following methods allowed me to bring one VM back from the edge of despair:

  1. Highly recommend creating a snapshot before proceeding. There are always unknown issues that will come up, and it’s sometimes best to just start over than to attempt correcting an irritating mistake.
  2. Add a second HDD with the same size to the VM
  3. Run CHKDSK /R on the damaged drive (methods include booting into Windows and scheduling a chkdsk at boot or booting into a recovery CD to run at the command prompt). Chances are if the CHKDSK cannot run, the HDD is toast.
  4. After finishing a CHKDSK, reboot the machine twice, then boot into a GPARTED live CD. (Any *NIX Live CD would probably work)
  5. Open a terminal and run the following commands:
    • sfdisk -d /dev/sda | sfdisk --force /dev/sdb
    • sfdisk --re-read /dev/sdb
    • ntfsclone --overwrite /dev/sdb1 --force --rescue /dev/sda1 (DO THIS STEP FOR EACH PARTITION ON THIS DEVICE!!)
  6. If the process completes successfully, then you will have two identical HDDs. Shutdown the VM and remove the original HDD. The VM will then boot from the new HDD.
  7. If the screen remains blank after booting into the new HDD, attach a Windows recovery CD (aka installation CD) and boot to recovery mode, run FIXMBR and FIXBOOT. (Aside: I realize that simply running FIXMBR will fix this in most situations because it updates the drive that points to the partition boot sector. That said, running both ensures a higher chance of boot.). This will rewrite the MBR on the HDD to point to your cloned Windows installation partition. Upon reboot, the VM should successfully boot into your recovered Windows partition.

Leave a Reply