How to set boot disk flag with diskpart

The diskpart in recovery console doesn't allow you to make a partition active(bootable).

Use Gparted Live.

http://en.wikipedia.org/wiki/Diskpart "On the Recovery Console, which is included in all Windows 2000, Windows XP and Windows Server 2003, there is a diskpart command which is significantly different from the one included in the actual operating system. It only provides functionality for adding and deleting partitions, but not for setting an active partition. The utility is also provided in the Windows Recovery Environment, the successor of the original Recovery Console"


I have successfully restored an VHD GPT-disk from a Windows 8.1 PC combining information from this and other threads on another windows 8.1 Hyper-V-Server.

My steps:

  1. Rip the disk using Disk2vhd from Microsoft Sysinternals.
  2. Mount the vhd in the file system of the Hyper-v-host. (i.e dubble click the vhd).
  3. Download and install AOMEI Partition Assistant.
  4. Start AOMEI Partition Assistant and select the VHD-disk which appear as an ordinary disk. Mark the disk av select to convert disk to MBR-disk from the Disk-menu.
  5. Remove all partitions that contains recovery disks and other non Windows partitions.
  6. Detach VHD from HOST (Restart may be necessary).
  7. Create a new Virtual Machine in Hyper-V Manager and use your modified VHD.
  8. Boot VM from Windows Installation disk an go to recovery console and select command prompt.
  9. Use diskpart as described below:
    • DISKPART (to open the partition utility),
    • LIST DISK (disk number(s) will be shown),
    • SELECT DISK n (where n is the number of the disk - probably 0),
    • LIST PARTITION (partition number(s) will be shown),
    • SELECT PARTITION n (where n is the number of the Primary partition you wish to make Active),
    • ACTIVE (the selected partition on the selected disk will be made Active),
    • EXIT (to exit DiskPart),
    • EXIT (to exit the Command Prompt),
    • Restart computer.
  10. Repeat step 8. 11.Rebuild MBR, as described bellow, ie:
    • bootrec /fixboot,
    • bootrec /fixmbr,
    • bootrec /rebuildbcd.
  11. Exit command prompt.
  12. Use Recovery options to restore windows system files (Both partial recovery and advanced recovery options may me used).
  13. Repeat 13 until VM boots from your VHD.

DISKPART (to open the partition utility)

LIST DISK (disk number(s) will be shown)

SELECT DISK n (where n is the number of the disk - probably 0)

LIST PARTITION (partition number(s) will be shown)

SELECT PARTITION n (where n is the number of the Primary partition you wish to make Active)

ACTIVE (the selected partition on the selected disk will be made Active)

EXIT (to exit DiskPart)

EXIT (to exit the Command Prompt)

Restart computer.