Use anaconda procedure for partiton and format a new HD
Peter Eisch
peter at boku.net
Tue Sep 27 18:03:14 UTC 2005
On 9/27/05 12:36 PM, "Shabazian, Chip" <Chip.Shabazian at bankofamerica.com>
wrote:
...
> # Determine how many drives we have
> set $(list-harddrives)
> let numd=$#/2
> d1=$1
> d2=$3
>
> # This is the scheme for two or more drives
>
> if [ $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
That would only use the first two drives. If I detect multiple disks, I
loop over them. This was on a 7.3 (pre list-harddrives and logical volume
manager vintage) installer. Updating it with logval should be somewhat
trivial. (Of course, $hds contains a list of the available drives, but
determining that seems to be outside the scope of this thread.)
echo "zerombr yes" >> /tmp/partinfo
echo "clearpart --all --initlabel" >> /tmp/partinfo
drive=0
bootdevs=''
rootdevs=''
for pdev in $hds
do
bootp=raid."$drive"1
rootp=raid."$drive"2
bootdevs="$bootdevs $bootp"
rootdevs="$rootdevs $rootp"
cat << EOF >> /tmp/partinfo
part $bootp --size 50 --ondisk $pdev"
part $rootp --size 1 --grow --ondisk $pdev"
part swap --recommended --ondisk $pdev"
EOF
let drive=$drive+1
done
echo "raid /boot --level=1 --device=md0 --fstype ext3 $bootdevs" >>
/tmp/partinfo
if [ $numhd -gt 2 ]; then
echo "raid / --level=5 --device=md1 --fstype ext3 $rootdevs" >>
/tmp/partinfo
else
echo "raid / --level=1 --device=md1 --fstype ext3 $rootdevs" >>
/tmp/partinfo
fi
More information about the Kickstart-list
mailing list