[CentOS] CentOS 5 grub boot problem

Wed Aug 5 21:45:11 UTC 2015
Chris Murphy <lists at colorremedies.com>

On Wed, Aug 5, 2015 at 2:54 PM, Bowie Bailey <Bowie_Bailey at buc.com> wrote:

> That's because I'm intending to increase the size of that filesystem.  The
> raid should work as long as the new partition is at least as big as the old
> one.  Once I get this working, I will remove the original drive and add
> another 1TB drive so both partitions are the same (larger size) and extend
> the filesystem into the new space.

Got it. OK then it all comes down to the workload and whether 4KiB
alignment is worth changing the partitioning.


If it is, quite honestly I'd just start over with this 1TiB drive:
i.e. fail and remove all three partitions, and then wipe the
superblock off each partition too (I don't know if CentOS 5 has wipefs
but if it does use that with -a switch, e.g. 'wipefs -a /dev/hdg[123]'
and then ;wipefs -a /dev/hdg' which will remove the ext3, swap and
mdadm signatures and avoids problems down the road; then repartition
doing two things: start the first partition at sector 2048, and only
specify the size in whole megabytes. 2048 is aligned, and by making
each partition increment 1MB each partition is also aligned.






>
>> - 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
>
>
> But if both hde and hdg are using 401625, then wouldn't I have to
> repartition both drives so the sizes match?

No because as you said, the replacement just needs to be same or
larger sized. mdadm does not care if member device partitions have
different start sectors.


> I'm still not sure that this is a partitioning problem.  I did not have any
> problems create the partitions or syncing the three raid devices.

It's not a partitioning problem. But there's no point in proceeding
with the bootloader stuff until you've settled on the partition
layout. If you want, in the meantime, you could test if 'grub-install
--recheck /dev/hdg' is at least accepted, and if that changes the
outcome of either the bootinfoscript's bootloader section or actually
test if it boots. The misalignment is a performance penalty, it's not
a whether it works or not penalty.

-- 
Chris Murphy