how do I detect the HDD's on the system?

Rudi Ahlers Rudi at SoftDux.com
Mon Mar 3 11:03:50 UTC 2008


Pablo Iranzo Gómez wrote:
> 	Hi!
>
> 	%include /tmp/part-include
>
> 	%pre
> set $(list-harddrives)
> let numd=$#/2 # Número de discos
> d1=$1 # 1st HDD drive
> S1=$2 # 1st HDD size
>
> DISCO=$d1
>
> echo "clearpart --drives=$DISCO --all --initlabel" >> /tmp/part-include
> echo "part /boot --fstype ext3 --size=100 --ondisk=$DISCO" >> /tmp/part-include
> echo "part pv.100000 --size=1 --grow --ondisk=$DISCO" >>  /tmp/part-include
> echo "volgroup VolGroup --pesize=32768 pv.100000" >> /tmp/part-include
> echo "logvol swap --fstype swap --name=Swap --vgname=VolGroup --size=2047" >> /tmp/part-include
> echo "logvol  / --fstype ext3 --name=root --vgname=VolGroup --size=1024" >> /tmp/part-include
> echo "logvol /home --fstype ext3 --size=1024 --name=home --vgname=VolGroup" >> /tmp/part-include
> echo "logvol /tmp --fstype ext3 --size=1024 --name=tmp --vgname=VolGroup" >> /tmp/part-include
> echo "logvol /usr --fstype ext3 --size=3000 --name=usr --vgname=VolGroup" >> /tmp/part-include
> echo "logvol /opt --fstype ext3 --size=12000 --name=opt --vgname=VolGroup" >> /tmp/part-include
> echo "part /opt/iso --fstype vfat --size=4410 --ondisk=$DISCO" >> /tmp/part-include
>
>
> 	But with your intended partitioning layout and required "conditionals"
> to automatically setup raid as expressed in previous posts on this
> thread
>
> 	Regards
> 	Pablo
>
>
>
>   
Thanx Pablo

I've only had time to play around with this today, but with very little 
success. Here's my kickstart config for the partitioning:

# Determine how many number/type/size of drives we have
set $(list-harddrives)
let numd=$#/2 # This will provide the total # of drives
d1=$1 # This is the device of disk 1
d2=$3 # This is the device of disk 2, etc.
d3=$5
d4=$7
d5=%9
S1=$2 # This is the size of disk 1
S2=$4 # This is the size of disk 2, etc.
S3=$6
S4=$8
S5=$10

%include /tmp/partinfo

# This would be a partition scheme for three or more drives
if [ $numd -ge 3 ] ; then
cat << EOF >> /tmp/partinfo
part raid.11    --size 200      --asprimary     --ondrive=$d1
part raid.12    --size 2048     --asprimary     --ondrive=$d1
part raid.13    --size 1 --grow                 --ondrive=$d1

part raid.21    --size 200      --asprimary     --ondrive=$d2
part raid.22    --size 2048     --asprimary     --ondrive=$d2
part raid.23    --size 1 --grow                 --ondrive=$d2

part raid.31    --size 200      --asprimary     --ondrive=$d3
part raid.32    --size 2048     --asprimary     --ondrive=$d3
part raid.33    --size 1 --grow                 --ondrive=$d3

raid /boot      --fstype ext3 --device md0 --level=RAID1 raid.11 raid.21 
raid.31 --spare=1
raid swap       --fstype swap --device md1 --level=RAID1 raid.12 raid.22 
raid.32 --spare=1
raid pv.01      --fstype ext3 --device md2 --level=RAID1 raid.13 raid.23 
raid.33 --spare=1
EOF
elif [ $numd - ge 2 ]; then
cat << EOF >> /tmp/partinfo
part /boot     --fstype ext3 --size=150  --ondisk=$d1
part swap                    --size=4092 --ondisk=$d1,$d2
part pv.01     --fstype ext3 --size=100  --grow --ondisk=$d1
part pv.02     --fstype ext3 --size=100  --grow --ondisk=$d2
EOF
else
cat << EOF >> /tmp/partinfo
part /boot     --fstype ext3 --size=150  --ondisk=$d1
part swap                    --size=4092 --ondisk=$d1
part pv.01     --fstype ext3 --size=100  --grow --ondisk=$d1
EOF
fi


# LVM configuration so that we can resize /, /var and /usr/ later
logvol /                --vgname=sysvg  --size=3072     --name=root
logvol /usr             --vgname=sysvg  --size=8192     --name=usr
logvol /tmp             --vgname=sysvg  --size=1024     --name=tmp
logvol /var             --vgname=sysvg  --size=8192     --name=var
logvol /home            --vgname=sysvg  --size=20480    --name=home
if [ pv.02 ]; then
logvol /bck             --vgname=pv.02  --size=1 --grow --name=bck
fi


Yet, when I run fdisk -l, there's no partitioning information, almost 
asif the installation script doesn't run the included /tmp/partinfo file
Attached the the /tmp/partinfo & /tmp/anaconda.log files - maybe you 
could see something I missed?

-- 

Kind Regards
Rudi Ahlers
CEO, SoftDux

Web:   http://www.SoftDux.com
Check out my technical blog, http://blog.softdux.com for Linux or other technical stuff, or visit http://www.WebHostingTalk.co.za for Web Hosting stugg

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: anaconda2.log
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20080303/1f78059a/attachment.log>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: partinfo
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20080303/1f78059a/attachment.ksh>


More information about the Kickstart-list mailing list