[CentOS] Analyzing the MBR

Fri Jun 6 02:09:31 UTC 2014
Robert Nichols <rnicholsNOSPAM at comcast.net>

On 06/05/2014 03:31 PM, John R Pierce wrote:
> traditional PC partitioning tools, dating back to MSDOS, put partitions
> on 'cylinder' boundaries.   this is a bad idea on modern disks, whether
> they be SSD's that often have 128K physical write blocks, or newer HD's
> with 4096 byte physical sectors, or raids where there's several of the
> above striped together.
>
> the rest of the space between the sector 0 MBR and the first primary
> partition is completely empty, nothing puts anything there.

That last sentence is simply wrong.  GRUB will try to install stage1_5 of
the boot loader there if space is available.  This is to eliminate the
problem with the boot sequence breaking if the stage2 boot loader ever
gets physically moved on the disk.  The stage1_5 boot loader understands
one type of filesystem (there is a different stage1_5 for each supported
filesystem), and loads stage2 from there.  There is simply not enough
room in the MBR for code to handle anything more complex than a short
list of absolute disk addresses.

If there is not space for a stage1_5, GRUB will still install successfully
(you see an error message with "This is not fatal"), but will have to
be reinstalled if the stage_2 file ever moves to a different physical
location on the disk.  This can result in a time bomb, because booting
can work successfully for a while using the data still present in what
are now free blocks in the filesystem, and will fail when some totally
unrelated action causes those blocks to be rewritten with something else.

A lot of other boot loaders and boot managers do something similar with
that space.

-- 
Bob Nichols     "NOSPAM" is really part of my email address.
                 Do NOT delete it.