Kickstart and multi-disks servers

Jason Edgecombe redhat at rampaginggeek.com
Wed Jan 17 23:20:19 UTC 2007


KENNEDY VAN DAM Eric wrote:
>  
>
>   
>> -----Message d'origine-----
>> De : Jason Edgecombe [mailto:redhat at rampaginggeek.com] 
>> Envoyé : mercredi 17 janvier 2007 15:02
>> À : Discussion list about Kickstart; KENNEDY VAN DAM Eric
>> Objet : Re: Kickstart and multi-disks servers
>>
>> In your disk line use the --ondisk option.
>>
>> use sda and sdb for SCSI/SATA disks and use hda & hdb for IDE disks.
>>
>> I use a shell script in my %pre to detect for sda/hda and write the 
>> proper disk lines.
>>
>>     
>
> Thanks for your quick answer.
> I'm not really sure the way to do this
> Could please post an example of the detection and the --ondisk  manipulation ?
>
>   
Sure, Here is a portion of my kickstart file for RHEL5beta2.I removed 
the %post stuff

install
nfs --server=server --dir=/kickstart/rhel5b2/distro


key DWV

lang en_US.UTF-8
keyboard us
#xconfig --driver "vesa" --resolution 800x600 --depth 16 --startxonboot
#xconfig --driver "vesa" --resolution 800x600 --depth 16
skipx

network --device eth0 --bootproto dhcp
rootpw --iscrypted foo
firewall --enabled --port=22:tcp
authconfig --enableshadow --enablemd5
selinux --enforcing
timezone --utc America/New_York


%include /tmp/part-include

reboot

%pre
#----- partitioning logic below--------------
# pick the first drive that is not removable and is over MINSIZE
DIR="/sys/block"

# minimum size of hard drive needed specified in GIGABYTES
MINSIZE=30


ROOTDRIVE=""

# /sys/block/*/size is in 512 byte chunks

for DEV in sda sdb hda hdb; do
  if [ -d $DIR/$DEV ]; then
    REMOVABLE=`cat $DIR/$DEV/removable`
    if (( $REMOVABLE == 0 )); then
      echo $DEV
      SIZE=`cat $DIR/$DEV/size`
      GB=$(($SIZE/2**21))
      if [ $GB -gt $MINSIZE ]; then
        echo "$(($SIZE/2**21))"
        if [ -z $ROOTDRIVE ]; then
          ROOTDRIVE=$DEV
        fi
      fi
    fi
  fi
done

eCho "ROOTDRIVE=$ROOTDRIVE"

cat << EOF >> /tmp/part-include
bootloader --location=mbr --driveorder=$ROOTDRIVE
clearpart --all --drives=$ROOTDRIVE --initlabel
part /boot --fstype ext3 --size=300 --ondisk=$ROOTDRIVE
part pv.4 --size=0 --grow --ondisk=$ROOTDRIVE
volgroup VolGroup00 --pesize=32768 pv.4
logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=1024 --grow --maxsize=2048
logvol / --fstype ext3 --name=root --vgname=VolGroup00 --size=1024 --grow --maxsize=20480
logvol /var/log --fstype ext3 --name=var-log --vgname=VolGroup00 --size=1024
logvol /tmp --fstype ext3 --name=tmp --vgname=VolGroup00 --size=4096
logvol /usr/vice/cache --fstype ext3 --name=usr-vice-cache --vgname=VolGroup00 --size=4096
logvol /home --fstype ext3 --name=home --vgname=VolGroup00 --size=1024 --grow
EOF


%packages
@admin-tools
@base
@gnome-desktop
@kde-desktop

@development-tools
@development-libs

# needed for ATI driver
@legacy-software-development

#@web-server
#@everything
gcc
make



Sincerely,
Jason Edgecombe




More information about the Kickstart-list mailing list