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

RE: Use anaconda procedure for partiton and format a new HD



This is how I create a partition information file, depending upon the
number of disks that I have:

In the command section, I use an include:
%include /tmp/partinfo

And then in %pre, I figure out how many disks I have, and then create
/tmp/partinfo using one of two standard schemes that we use in our
environment:

# 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
logvol / --vgname=volgrp01 --size=10240 --name=slash
logvol /var --vgname=volgrp01 --size=8192 --name=var
part /boot --fstype ext3 --size=256 --ondisk=$d1
logvol /home --vgname=volgrp02 --size=4096 --name=home
logvol /tmp --vgname=volgrp01 --size=2048 --name=tmp
part swap --recommended --ondisk=$d1
EOF

else

# This is the scheme for one drive

cat << EOF >> /tmp/partinfo
part pv.01 --size=1 --grow --fstype=ext3 --ondisk=$d1
volgroup volgrp01 pv.01
logvol / --vgname=volgrp01 --size=10240 --name=slashlogvol /var
--vgname=volgrp01 --size=8192 --name=var
part /boot --fstype ext3 --size=256 --ondisk=$d1
logvol /home --vgname=volgrp01 --size=4096 --name=home
logvol /tmp --vgname=volgrp01 --size=2048 --name=tmp
part swap --recommended --ondisk=$d1
EOF

fi



You don't have to use native partitions for /boot in RHEL 4.







-----Original Message-----
From: kickstart-list-bounces redhat com
[mailto:kickstart-list-bounces redhat com] On Behalf Of Dario Lesca
Sent: Tuesday, September 27, 2005 8:32 AM
To: Kickstart List
Subject: Use anaconda procedure for partiton and format a new HD

Hi, I am new of this list, My first question is: It is possible
to use the anaconda procedure (/usr/lib/anaconda/*) to format,
patition, and create LVM volumes on a new disk, taking the layout
info from a file whit anaconda KS syntax?

Something like this:

export PYTHONPATH=/usr/lib/anaconda
echo "
clearpart --all
part /boot --fstype ext3 --onpart hda1
part swap --onpart hda2
part pv.3 --noformat --onpart hda3
volgroup Vol0 pv.3
logvol /u --fstype ext3 --name=lvmu --vgname=Vol0 --size=10000.0
logvol /var --fstype ext3 --name=lvmvar --vgname=Vol0 --size=6000.0
logvol / --fstype ext3 --name=lvmroot --vgname=Vol0 --size=4000.0
" | python /tmp/mymkdisk.py /dev/hdb

Many thanks for your suggestions..

-- 
Dario Lesca <d lesca solinos it>

_______________________________________________
Kickstart-list mailing list
Kickstart-list redhat com
https://www.redhat.com/mailman/listinfo/kickstart-list


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