2

Possibly a stupid question here, but I'm wanting to confirm a small detail about hard drive workings that up until now I've just assumed.

I understand that the 440-byte bootloader won't be present on a non-bootable data drive (i.e. a drive that doesn't have an operating system installed to it) but how about the boot sector that usually contains the bootloader in addition to the MBR/GPT partition table itself?

Do drives that are being used purely as data drives require boot sectors, and could running the CMD fixmbr command theoretically fix a data drive's damaged boot sector?

1
  • One of the answers states the area is always present even if unused, but there's nothing to enforce its contents. True; not only for the bootcode area but for the entire 0th sector. See what can happen when it's misinterpreted: Windows does not mount USB NTFS superfloppy. Jan 4, 2020 at 22:09

2 Answers 2

3

I understand that the 440-byte bootloader won't be present on a non-bootable data drive (i.e. a drive that doesn't have an operating system installed to it) but how about the boot sector that usually contains the bootloader in addition to the MBR/GPT partition table itself?

That's the same thing. Sector 0 on every disk contains 440 bytes of bootcode and 72 bytes of partition table information; that's why the partition table format is called "Master Boot Record".

(The same applies even to GPT disks. The GPT partition table starts at sector 1, but every disk still has a so-called "protective" MBR in sector 0, which has no real partitions but may still contain BIOS bootcode.)

Of course, since the MBR bootcode area on a data disk is not used for anything, it might be blank like it came from the factory – but it might also have a regular bootcode that searches for an 'active' partition, or it might have some other leftovers from whatever OS might have been installed on it 15 years ago.

So the area is always present even if unused, but there's nothing to enforce its contents.


Note that partition boot records (commonly called VBRs) are a different thing from whole disk boot sectors. Usually the 440-byte disk boot sector only knows how to find a bootable partition, and that partition's boot record knows how to boot the specific OS. (There are exceptions; e.g. GRUB stores its code elsewhere than a partition's boot record, but the general idea is still the same.)

The fixmbr command only updates the disk's MBR but will not touch the partition's boot information – for Windows that's done by fixboot instead.

Generally, filesystems always reserve some space for the bootloader (the actual size varies between filesystem types). If the partition never had an OS installed to it, then its boot record will usually be blank, or it might have some dummy code that prints something like "Not a bootable disk".

3

Yes, any partition contains boot sector. It is defined by the booting process order - during this process the first sector of the partition is checked for boot sector signature (55 AA in last two bytes - if it is absent the partition is considered as non-formatted), and, if it is found, the sector is loaded into memory, and the code execution jumps to it. In other words, a valid boot sector must contain either bootloader code or a 'far return' command (if not the boot process will hang). Whether the partition is bootable or not doesn't matter.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .