[CentOS] Analyzing the MBR

Thu Jun 5 11:01:50 UTC 2014
Timothy Murphy <gayleard at eircom.net>

Is there any tool for analysing the MBR on a computer?
I know one can just dd it and see roughly what it contains.
But surely one should be able to work out the exact content
of the MBR and the neighbouring sectors read at boot time?

I had a difficult day, probably due to my ignorance,
which would have been solved at once by such a tool.
I had taken one of three hard disks out of my home server
(to see exactly what it was, as smartctl said it was not
in its database) and this had the effect of altering 
the order of the disks in the BIOS, preventing re-booting.

It was only after I had re-installed CentOS in a spare partition
that I realized what had happened.
Incidentally, before this I had tried 
what I take to be the standard way of solving this problem, 
by running a CentOS Live USB stick, mounting the root partition
and trying to chroot to this, but that did not work -
chroot on the stick would not run,
and neither would chroot on the disk.

I'm wondering if there was some other method I could have tried?
For example, I tried running a Fedora netinstall USB stick,
which has a "Try to repair the system" option in Troubleshooting.
This saw the system OK, but did not have grub-install on it.
As far as I could see, none of the CentOS install disks
has such a tool on it?

Timothy Murphy  
e-mail: gayleard /at/ eircom.net
School of Mathematics, Trinity College, Dublin 2, Ireland