A Sample Way To Generalize Disk Layouts
An email from "Shabazian, Chip" <Chip.Shabazia at bankofamerica.com>:
I've got a great way that I've been doing this for years. It works for
all types of drives, scsi, ide, even the cciss scsi controllers in HP DL
Servers.
In %pre, I figure out what drives exist in the system, and write out a
partion scheme based on one or two drives:
%pre# Determine how many drives we have
set $(list-harddrives)
let numd=$#/2
d1=$1
d2=$3if [ $numd -ge 2 ] ; then
cat << EOF >> /tmp/partinfo
part pv.01 --size=1 --grow --fstype=ext3 --ondisk=$d1
volgroup volgrp01 pv.01
part pv.02 --size=1 --grow --fstype=ext3 --ondisk=$d2
volgroup volgrp02 pv.02
#HOWEVER_YOU_WANT_TO_PARTITION
EOFelsecat << EOF >> /tmp/partinfo
part pv.01 --size=1 --grow --fstype=ext3 --ondisk=$d1
volgroup volgrp01 pv.01
#HOWEVER_YOU_WANT_TO_PARTITION
EOFfi
I then %include the partitioning back up in the command section:
Oops, forgot to mention that list-hardrives also returns the SIZE of the
drive. $2 is the size of the first drive, $4 the size of the second,
and so on.