Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] automation for installing to or converting to RAID



Ok, let me try that again ...

FYI - here are the relevant parts of a kickstart I just used to build a 26
disk system with hardware and software raid and the resulting df of the
system after it was built. (CentOS 6.2, in case it matters)

The BIG problem I had was that there are 2 different LSI controllers, as
well as the motherboard SATA and the controllers always came up in a
random order (really) and the clearpart and zerombr commands do not seem
to work as advertised. Existing software raid arrays were getting mounted
by the kickstart and the LVM creation would cause the kickstart to fail.

I solved these problems with the %pre script at the end of the kickstart,
which, of course, runs pre-kickstart.

################

zerombr
clearpart --all --initlabel
# some of the LSI disks show up before the MB disks!
# sda and sdb are on the MB, sdc is a 16 disk hardware raid10 array, the
last 2 external disks are spares
# the 2 disks next to the spares are swap.
bootloader --location=mbr
--driveorder=sda,sdb,sdc,sdd,sde,sdf,sdg,sdh,sdi,sdj,sdk

part raid.01 --size=250 --asprimary --ondisk=sda
part raid.02 --size=1 --grow --ondisk=sda
part raid.04 --size=250 --asprimary --ondisk=sdb
part raid.05 --size=1 --grow --ondisk=sdb
part swap --size=1 --grow --ondisk=sdh
part swap --size=1 --grow --ondisk=sdi

part raid.09 --size=1 --grow --ondisk=sdd
part raid.10 --size=1 --grow --ondisk=sde
part raid.11 --size=1 --grow --ondisk=sdf
part raid.12 --size=1 --grow --ondisk=sdg

# rootvg (boot is below)
raid pv.01 --device=md1 --level=RAID1 raid.02 raid.05

# optvg
raid pv.03 --device=md3 --level=RAID1 raid.09 raid.10
raid pv.04 --device=md4 --level=RAID1 raid.11 raid.12
part pv.05 --size=1 --grow --ondisk=sdc

volgroup rootvg pv.01
volgroup optvg pv.03 pv.04 pv.05

logvol / --fstype ext4 --size=1 --grow --percent=100 --name=rootlv
--vgname=rootvg
raid /boot --fstype ext3 --device=md0 --level=RAID1 raid.01 raid.04
logvol /opt --fstype ext4 --size=262144 --name=optlv --vgname=optvg

%packages
....(omitted)
%end

%pre
#!/bin/bash
#
# put the disks in the right order since the controllers come up in random
order on these boxes!
# internal, external array, external raw disks
#
rmmod -f megaraid_sas > /dev/null 2>&1
rmmod -f mptsas > /dev/null 2>&1
rmmod -f sd_mod > /dev/null 2>&1
modprobe sd_mod > /dev/null 2>&1
modprobe megaraid_sas > /dev/null 2>&1
modprobe mptsas > /dev/null 2>&1
#
# wipe out any partitions and raid signatures since clearpart doesn't seem
to do it
#
for disk in a b c d e f g h i j k
do
        dd if=/dev/zero of=/dev/sd$disk bs=512 count=1 > /dev/null 2>&1
        # wipeout any dm-raid signatures
        dmraid -D -r /dev/sd$disk > /dev/null 2>&1
        dd if=/dev/zero of=/dev/sd$disk seek=`cat ddf1/sd${disk}.offset`
bs=1 count=`cat ddf1/sd${disk}.size` > /dev/null 2>&1
        # wipeout any mdadm raid signatures
        mdadm --zero-superblock --force /dev/sd$disk > /dev/null 2>&1
done > /dev/null 2>&1
exit 0
%end




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org