Re: kickstart question

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



Jerry Geis wrote:
I have a couple lines like:

part /     --ondisk=sda --fstype ext3 --size=20000 --asprimary
part swap  --ondisk=sda               --size=4000  --asprimary
part /home --ondisk=sda --fstype ext3 --size=1     --asprimary --grow

in my kickstart file.

Is there a way to have 1 kickstart file that works for hda and sda both???

So I would like to have 1 kickstart file that works for either a hda install or sda install.
Thanks,
Jerry

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

Jerry,

see the attached example of my partitioning %pre script i use for all my builds.

hope it helps.

Ben
%include /tmp/part-include

%pre

#!/bin/bash

set $(list-harddrives)

#    $1 = 1st disk name
#    $2 = 1st disk size
#    $3 = 2nd disk name
#    $4 = 2nd disk size
#    so on

let numhd=$#/2

drive1=$1
drive2=$3

# calculate swap
mem=$(grep MemTotal /proc/meminfo | awk '{print $2}')
swap=$(( $mem / 1000 * 2 ))

#Write out partition scheme based on whether there are 1 or 2 hard drives

if [ $numhd == "2" ] ; then
        #2 drives
        echo "# partitioning scheme generated in %pre for 2 drives"             > /tmp/part-include
        echo "bootloader --location=mbr --driveorder=$drive1,$drive2"           >> /tmp/part-include
        echo "clearpart --all --initlabel"                                      >> /tmp/part-include
        echo "part raid.11 --size=100 --ondisk=$drive1"                         >> /tmp/part-include
        echo "part raid.21 --size=100 --ondisk=$drive2"                         >> /tmp/part-include
        echo "part raid.13 --size=100 --ondisk=$drive1 --grow"                  >> /tmp/part-include
        echo "part raid.23 --size=100 --ondisk=$drive2 --grow"                  >> /tmp/part-include

        echo "raid /boot --fstype ext3 --level=RAID1 --device=md0 raid.11 raid.21"      >> /tmp/part-include
        echo "raid pv.01 --level=RAID1 --device=md2 raid.13 raid.23"                    >> /tmp/part-include

        echo "volgroup vg0 pv.01"                                                       >> /tmp/part-include

        echo "logvol swap --fstype swap --name=swap --vgname=vg0 --size=$swap"           >> /tmp/part-include
        echo "logvol / --fstype ext3 --name=root --vgname=vg0 --size=300 --grow"        >> /tmp/part-include
else
        #1 drive
        echo "# partitioning scheme generated in %pre for 1 drives"                     > /tmp/part-include
        echo "bootloader --location=mbr --driveorder=$drive1"                           >> /tmp/part-include
        echo "clearpart --all --initlabel"                                              >> /tmp/part-include
        echo "part /boot --fstype ext3 --size=100   --ondisk=$drive1"                   >> /tmp/part-include
        echo "part swap  --fstype ext3 --size=$swap --ondisk=$drive1"                   >> /tmp/part-include
        echo "part /     --fstype ext3 --size=300   --ondisk=$drive1  --grow"           >> /tmp/part-include
fi

[ -f /tmp/part-include ] || touch /tmp/part-include
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux