Does rebuilding the BCD affect the MBR?

3

2

I'm dual booting Linux Mint and Windows 7, and windows 7 is having a "device inaccessible" error preventing it from booting. I'm using grub for my MBR.

From what I understand, the BCD is what manages the boot process for Windows 7 after the MBR has passed off control to the OS (which is currently only a logical partition). Is this correct?

So would using this command:

bootrec /RebuildBcd

make any changes to the MBR or any of the partition tables on the harddrive? Basically, is rebuilding the BCD something localized to the system drive, or does it actively change the hard-drive structure (or set any partitions active with the boot flag)?

Thanks!

Nathan

Posted 2013-07-28T09:21:43.340

Reputation: 125

Answers

4

The BCD is a file, named BCD, which lives in the Boot folder on the 100MB partition Windows makes before the main system partition during install (it's also possible you may have a Boot folder on your C:\ drive).

It's a registry hive. It's mounted in the registry at HKLM\BCD00000000.

bootrec /RebuildBCD only rebuilds this BCD file.

Other bootrec options can modify the MBR:

  • /FIXMBR: The /FIXMBR switch writes an MBR to the system partition.
  • /FIXBOOT: The /FIXBOOT switch writes a new boot sector onto the system partition.
  • /SCANOS: The /SCANOS switch scans all disks for Windows installations and displays entries currently not in the BCD store.
  • /REBUILDBCD: The /REBUILDBCD switch scans all disks for Windows installations and provides a choice of which entries to add to the BCD store.

LawrenceC

Posted 2013-07-28T09:21:43.340

Reputation: 63 487

I don't think this is accurate regarding 'fixmbr' and 'fixboot'. This documentation seems to say fixmbr affects all parts of the first sector, and fixboot affects the boot partition. My guess is fixboot changes the partition boot sector (SBL), which in turn is used to process the files in the boot folder. Also, grub does alter the MBR--I.e. primary bootsector.

– jiggunjer – 2017-01-28T18:55:24.183

Thanks. I got it all working! For future reference, how exactly does /FIXBOOT work? I get all the other options, but I'm not exactly sure how a new boot sector relates to the mbr/partition tables? – Nathan – 2013-07-29T02:42:18.613

The PC BIOS loads the first sector of the hard drive and then hands control to the code it finds there. /FIXBOOT puts this code back. Sector 0 is 512 bytes, the MBR lives in the last 64 of those, the boot code lives in the other bytes. /FIXMBR only writes the MBR part of that. – LawrenceC – 2013-07-29T03:24:08.147

Does GRUB write over the boot sector or just the MBR? What does the code that /FIXBOOT places actually do? – Nathan – 2013-07-29T03:52:34.907

GRUB doesn't alter the MBR when installed. The code that /FIXBOOT places is the 1st stage bootloader which loads the actual, 2nd stage bootloader (NTLDR on XP, GRUB or LILO on Linux, winload.exe on Vista and higher) – LawrenceC – 2013-07-30T02:50:52.360