[CentOS] Install on two discs with Software Raid and LVM

Tue Feb 5 00:00:45 UTC 2008
nate <centos at linuxpowered.net>

Joseph L. Casale wrote:
> I am mirroring two drives during install, what's the best practice here for
> the swap partition? Maybe two separate lv's from independent vg's *not*
> mirrored for swap and the let the OS manage it? Boot and the / vg will be
> mirrored.

More of a comment than a answer but I don't use LVM for the internal
disks on my systems, only for external disks(SAN, etc). I've found that
at least for me LVM is very problematic when used in kickstart, I get
frequent failures(python errors). So I just go with normal partitions
internally.

My software raid setup for systems that use it, is 100MB
/boot partition, a 4G swap partition and the rest of the
drive is one big root partition. All of them in software
RAID 1.

#Partition clearing information
clearpart --all
#Partition the Drives
part raid.01  --size=100 --ondisk=sda
part raid.02  --size=100 --ondisk=sdb
raid /boot --level 1 --device=md0 raid.01 raid.02

part raid.03  --size=4096 --ondisk=sda
part raid.04  --size=4096 --ondisk=sdb
raid swap --level 1 --device=md1 raid.03 raid.04

part raid.05  --size=100 --ondisk=sda --grow
part raid.06  --size=100 --ondisk=sdb --grow
raid / --level 1 --device=md2 raid.05 raid.06

Then to work around a software raid bug in anaconda in
CentOS/RHEL 4(not sure about 5, but I still do it anyways),
in my %post I do:
cat >/tmp/grub.txt <<EOF
root (hd0,0)
geometry (hd0)
setup (hd0)
geometry (hd1)
setup (hd1)
quit
EOF

grub --batch </tmp/grub.txt 2>&1 | tee /root/grub-install.txt

Without the workaround there's a high likely hood that the
system won't boot to the OS afterwards.

If you foresee frequent changes on your OS disks then LVM
is probably a good choice, I just got sick of the kickstart
failures with it.

nate