For When You Can't Have The Real Thing
[ start | index | login ]
start > RedHat > kickstart > auto-RAID


Created by dave. Last edited by dave, 10 years and 279 days ago. Viewed 3,184 times. #1
[edit] [rdf]

Kickstart with automatic RAID

# Partitioning information provided from the PRE script, below
clearpart --all --initlabel
%include /tmp/partinfo
bootloader --location=mbr

# PRE script to do partitioning. # this has to go at the end of the ks.cfg %pre

# find hard drives # if you are using cobbler, remember to escape the $ in the next line set $(list-harddrives) # this is the number of hard drives found let numd=$#/2 # these are the device names of the first two drives d1=$1 d2=$3 # these are the sizes of the first two drives s1=$2 s2=$4 # if we have two or more drives, try to raid-1 the first two if [ $numd -ge 2 ] ; then # paper-bag check -- only if the sizes are the same if [ "$s1" = "$s2" ] ; then cat << EOF >> /tmp/partinfo part raid.11 --size 2048 --asprimary --ondrive $d1 part raid.12 --size 1 --grow --ondrive $d1 part raid.21 --size 2048 --asprimary --ondrive $d2 part raid.22 --size 1 --grow --ondrive $d2 raid swap --fstype swap --device md1 --level RAID1 raid.11 raid.21 raid / --fstype ext3 --device md2 --level RAID1 raid.12 raid.22 EOF fi fi if [ ! -f /tmp/partinfo ] ; then # if we get here, then we either have only one disk # or the first two disks do not match in size. cat << EOF >> /tmp/partinfo part / --fstype ext3 --size=1 --ondisk=$d1 --grow --asprimary part swap --size=2048 --ondisk=$d1 --asprimary EOF fi

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful: | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt