[CentOS] CentOS 5 grub boot problem

Wed Aug 5 20:00:27 UTC 2015
Chris Murphy <lists at colorremedies.com>

- Ahh OK now I see why I was confused. The originally posted partition
map uses cylinders as units, not LBA. I missed that. Cylinder 1 is the
same as LBA 63. And that is sufficiently large for a GRUB legacy stage
2.

- OK this is screwy. Partitions 1 and 3 on both drives have the same
number of sectors, but partitions 2 differ:

/dev/hde2             401,625   975,691,709   975,290,085  fd Linux
raid autodetect
/dev/hdg2             401,625 1,952,491,904 1,952,090,280  fd Linux
raid autodetect

That can't work as these are two partitions meant to form /dev/md2 and
need to be the same size.

- Also, 401625 is not 8 sector aligned. So it's a double whammy and
since it has to be repartitioned anyway you might as well fix the
alignment also.

First off fail+remove hdg2 (you need to confirm I've got the devices
and commands right here):
mdadm --manage /dev/md2 -f /dev/hdg2 -r /dev/hdg2
mdadm --zero-superblock /dev/hdg2

Using fdisk delete hdg2, then make a new primary partition (partition
2) and hopefully figure out how to get it to do LBA rather than CHS
entry; or use parted which can but it's UI is totally unlike fdisk.
The start sector for hdg2 should be 401623 which is 8 sector aligned,
and the end value should be 975691717 in order to make it the same as
hde2. And change the type to 0xfd.

Now you probably have to reboot because the partition map has changed,
I'm not sure if partprobe exists on CentOS5, could be worth a shot
though and see if the kernel gets the new partition map. Check with
blkid.

And then finally add the "new" device.
mdadm --managed /dev/md2 -a /dev/hdg2

And now it should be resyncing...
cat /proc/mdstat

Something like that. Proof read it!

---
Chris Murphy