[CentOS] kickstart raid disk partitioning

Thu Nov 18 18:11:38 UTC 2010
Roberto Nunnari <roberto.nunnari at supsi.ch>

Hello.

A couple of years ago I installed two file-servers
using kickstart. The server has two 1TB sata disks
with two software raid1 partitions as follows:

# cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sdb4[1] sda4[0]
       933448704 blocks [2/2] [UU]
md0 : active raid1 sdb1[1] sda2[2](F)
       40957568 blocks [2/1] [_U]


Now the drives are starting to be failing and next week I'll
backup /homes, reinstall OS with kickstart, and finally
restore /homes.

There's a problem with how the kickstart process partitions
the disks, though. As you may have noticed above, md0 is made
up of sdb1 and sda2.

Could anybody help me understand how to make the partitions
on the two drives identical still using kickstart?

Here's the relevant part from the kickstart file:

zerombr yes
clearpart --all --initlabel
bootloader --location=mbr
part /boot --fstype ext3 --size 250 --asprimary --ondisk sda
part swap --size 2048 --asprimary --ondisk sda
part raid.01 --size 40000 --asprimary --ondisk sda
part raid.03 --size 1 --grow --asprimary --ondisk sda
part /boot2 --fstype ext3 --size 250 --asprimary --ondisk sdb
part swap --size 2048 --asprimary --ondisk sdb
part raid.02 --size 40000 --asprimary --ondisk sdb
part raid.04 --size 1 --grow --asprimary --ondisk sdb
raid / --level=1 --device=md0 --fstype ext3 raid.01 raid.02
raid /home --level=1 --device=md1 --fstype ext3 raid.03 raid.04

..but here's the produced partitioning on the two drives:

# parted /dev/sda print
Disk geometry for /dev/sda: 0.000-953869.710 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031    251.015  primary   ext3        boot
2        251.016  40248.786  primary   ext3        raid
3      40248.787  42296.132  primary   linux-swap
4      42296.133 953867.219  primary   ext3        raid

# parted /dev/sdb print
Disk geometry for /dev/sdb: 0.000-953869.710 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031  39997.771  primary   ext3        boot, raid
2      39997.771  42045.117  primary   linux-swap
3      42045.117  42296.132  primary   ext3
4      42296.133 953867.219  primary   ext3        raid


I'm not asking because I'm picky, but just because, it would
have made my life easier to fix bad blocks on disks by
dd from good block on disk1 to bad block on disk2, and as
next week I'll reinstall, I'd prefer to do it the right way.

Some more bits about my environment:

# cat /etc/redhat-release
CentOS release 4.8 (Final)

# uname -rms
Linux 2.6.9-89.0.18.ELsmp i686

Thank you and best regards.
Robi