How to set boot disk flag with diskpart

262,052

Solution 1

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"

Solution 2

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.

Solution 3

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.

Solution 4

While attempting to load Windows Server 2003 on a new drive of my Windows 7 machine, I somehow wiped out the boot on the Windows 7 drive.

Windows could not start because of a computer disk hardware configuration problem

After three days of poking around, I was able to use the following steps to correct the issue:

  1. Boot from Windows 7 Install Disk
  2. Select "Repair" Option
  3. Select "Startup Repair" (this will run but not find any issues)
  4. Select Advanced Options to get to "Command Prompt"
  5. bootsect /nt60 SYS
  6. Restart the computer normally
Share:
262,052
kockiren
Author by

kockiren

Updated on September 18, 2022

Comments

  • kockiren
    kockiren over 1 year

    My Windows Server 2008 R2 won't start and stops with Stop 7B, so I start the recovery console and use diskpart to check the disk. There are to partitions one of Type 17 and one of type 07, the detail disk command show me that the disk is not a boot disk. How can I set this boot flag with diskpart? Or is this flag only set true if the MBR works fine. I try following commands:

    bootsect /nt60 ALL /force /mbr
    bootrec /fixboot
    bootrec /fixmbr
    bootrec /rebuildbcd
    

    the last command show me the number of OS is 0, so how can I set this flag to true?

    Here is the output of diskpart detail disk: enter image description here

    • Admin
      Admin over 8 years
      you should detail how you fixed it, so that others can benefit. And if you can't remember then you should have detailed how you fixed it so that others could benefit
    • Admin
      Admin over 8 years
      As I mentioned in the Comments of your answer it was a issue with the driver signature. After deactivate the signature verification while startup I can start the system reinstall the driver and everything works well. So the solution was to recreate the MBR and start without driver verification.
    • Admin
      Admin over 8 years
      To clarify: Bugcheck 0x7b (INACCESSIBLE_BOOT_DEVICE) means that Windows did indeed begin booting, but was unable to find a driver for accessing its partition after switching to direct storage access.
  • kockiren
    kockiren about 11 years
    The the Partition is marked as active but not as Boot Disk. There is a flag called "Boot Disk" and has value no but in well working systems this flag is always set to yes.
  • kockiren
    kockiren about 11 years
    I boot from a live-Linux and start gparted. The Bootflag is set but the detail disk show me "boot disk" no
  • barlop
    barlop about 11 years
    @kockiren there are some more commands you can try social.technet.microsoft.com/Forums/en-US/winserversetup/thr‌​ead/… like sfc (with some parameters like sfc /SCANNOW /OFFBOOTDIR=d:\ /OFFWINDIR=d:\windows where d is your windows drive) and startrep.exe and if both those fail then you might have to reinstall windows. As windows server 2008 apparently has no repair installation w7 has no repair installation either! xp does.
  • barlop
    barlop about 11 years
    also if you just made it active/bootable when it those commands can't see windows, then you're not likely to be able to even start getting into windows. if you can reach a stage where those commands can see windows, particularly the rebuildbcd command which found 0 Oss, if running those other commands leads it to find the Os then great, if not, then maybe that's a basic problem that leads diskpart to not see that it's bootable when gparted set it to bootable.
  • barlop
    barlop about 11 years
    add a screenshot for detail partition, that would say active or not.
  • kockiren
    kockiren about 11 years
    I run sfc and startrep but it dosent help. No bootrec /rebuild find a Installation but the System won't start correctly. It stops with 7B and now Dumpfile was create :-(
  • barlop
    barlop about 11 years
    @kockiren so backup and reinstall windows. And by the way did diskpart when you do detail partition, does it say active?
  • kockiren
    kockiren about 11 years
    I didnt need a fresh install, Windows won't start with Drivererrors, after I fix it windows start correctly and then the Boot Disk flag is set.
  • barlop
    barlop about 11 years
  • barlop
    barlop over 9 years
    Maybe i'll try to ensure that chat links happen elsewhere and link to them, since chat links here seem to get deleted. I'd have liked to know what was in that chat, particularly as the answer got accepted
  • barlop
    barlop over 8 years
    maybe easeus or partition wizard are a thousand times better than gparted live 'cos i'd guess easeus and partition wizard let you resize. And from what I recall, gparted might not.
  • g2mk
    g2mk over 8 years
    Thank you for an answer, but please review "Mark the disk av" and try to provide better quality answer next time.
  • Cas
    Cas over 7 years
    Welcome to Super User! On this Q&A site we try to provide good answers to questions people post. Part of a good answer is including all the steps required to making your answer work. Referencing to someone else's answer by saying 'above' isn't enough because the order of answers on Stack Overflow is not fixed. Please include the steps you are referring to in your own post. Providing credit by linking to the answer you're referring to is never a problem, of course!
  • DavidPostill
    DavidPostill over 7 years
    This is an answer to a different question ...
  • Reg Edit
    Reg Edit over 3 years
    What does "13. Repeat 13 until VM boots from your VHD" mean? Evidently there is a problem with the step numbers, but I can't tell what step must actually be meant.