Translate

Image of Advanced Programming in the UNIX Environment, Second Edition (Addison-Wesley Professional Computing Series)
Image of Beginning Google Maps API 3
Image of Modern Operating Systems (3rd Edition)
Image of RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302) (Certification Press)

GRUB2 and Post-MBR Gap

Section 3.2 of the current GRUB2 manual states that for bootable MBR-partitioned disks:

With this partition table format, there are two ways to install GRUB: it can be embedded in the area between the MBR and the first partition (called by various names, such as the “boot track”, “MBR gap”, or “embedding area”, and which is usually at least 31 KiB), or the core image can be installed in a file system and a list of the blocks that make it up can be stored in the first sector of that partition.
….
You must ensure that the first partition starts at least 31 KiB (63 sectors) from the start of the disk

The second method, i.e. blocklists, is not recommended as it was deprecated by the GRUB2 developers some time ago.

The error message you will get from GRUB2 if less than 63 sectors are available is “insufficient post-MBR gap not detected before installation”
.
Where did this minimum 63 sector gap come from? It is due to the fact that disk partitions are aligned on cylinders for efficiency and if an MBR is installed on LBA 0, then the rest of cylinder 0 cannot be used by a disk partition. It is not specified in any specification or standard but older preinstalled Microsoft Window systems always started on LBA 64. Nowadays, preinstalled Microsoft Windows 7 systems start at LBA 2048 which is compatible with 512e alignment. Note that Microsoft Windows can be installed on a partition starting at LBA 1 if you so wish; the operating system does not have a dependency on a post-MBR gap existing.

GRUB legacy and GRUB2 expect a minimum 63 sector MBR-gap for stage 1.5 to exist and be available for their exclusive use! Talk about poor design decisions! Worse still, GRUB2 requires more space than GRUB Legacy.

Do all PC vendors honor this? Recent Bugzilla reports 986431 and 979805 indicate not. In 986431, a Dell PC, the first partition (containing a Dell utility) started at sector 36 (maybe a 4K sector disk?) and in 979805, a refurbished Lenovo laptop, the first partition started at sector 28.

The responses to these bug reports by some people was interesting:

The best thing to do might be to contact NBWN and let them know that their disk partitioning is incompatible with Fedora

The standard here is what the Windows installer does, not what Dell’s inept manufacturing process produces.

Have you called Dell tech support yet about the defective product they sold you?

There is lots of useful background information in these two bug reports. It is well worth your time to read the bug reports.

Comments are closed.