Kickstart issue

Geoff Silver linuxgod at gmail.com
Tue Dec 18 15:06:33 UTC 2007


We ran into the same issue at my company, and I didn't want anaconda to install
on the SAN and wipe out a database.  The trick is to use a python script in the
%pre section of your kickstart to write out a partitioning file, then import
that using %import.  Your kickstart should looks like so:

install
text
network --bootproto dhcp
...
zerombr yes
bootloader --location mbr
clearpart --all --initlabel
%include /tmp/part-include

%packages
...

%pre
/usr/bin/python <<EOB
import sys

sys.path.append("/usr/lib/anaconda")

import isys

drive = isys.hardDriveDict().keys()[0]
f = open("/tmp/part-include", "w")
f.write("partition /boot --fstype=ext3 --size=200 --ondisk=%s\n" % (drive,))
f.write("partition / --fstype=ext3 --size=10240 --ondisk=%s\n" % (drive,))
f.write("partition /var --fstype=ext3 --size=4096 --ondisk=%s\n" % (drive,))
f.write("partition swap --size=2048 --ondisk=%s\n" % (drive,))
f.write("partition swap --size=2048 --ondisk=%s\n" % (drive,))
f.write("partition pv.01 --size=1 --grow --ondisk=%s\n" % (drive,))
f.write("volgroup vg0 pv.01 --pesize=32768\n")
f.write("logvol /logs --vgname vg0 --size=1 --grow --name logs --fstype=ext3\n")
f.close()

EOB

%post
..








More information about the Kickstart-list mailing list