Re: ondisk

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

 



On Wed, Feb 26, 2003 at 03:43:04PM -0500, Reza Hedayati wrote:
> 
> My questions is how can we ask kickstart to automatically pick the first 
> drive, regardless of the drive type, but to put all the partitions on the 
> same drive.
> 
You can do something like this in %pre to create partitioning information,
write it to a file (/tmp/partitions in this example), and then %include that
file in your ks.cfg...

%pre --interpreter /usr/bin/python
# load the modules needed to make this work
import os, sys
sys.path.append('/usr/lib/anaconda')
import isys

# get a sorted list of drives
drives = isys.hardDriveDict().keys()
drives.sort()

# write the include file to /tmp/kspart, drives[0] is the first drive,
# drives[1] is the second, etc.  To get the filet to be used, put
# '%include /tmp/partitions' in your kickstart configuration.
f = open("/tmp/partitions", "w")
f.write("part / --size 1500 --ondisk %s\n" % drives[0])
f.write("part /boot --size 1500 --ondisk %s\n" % drives[0])
f.write("part /usr --size 1500 --ondisk %s\n" % drives[0])
f.write("part /var --size 1500 --ondisk %s\n" % drives[0])
f.write("part /home --size 1500 --ondisk %s --grow\n" % drives[0])
f.close()

-- 
Jason Kohles                                 jkohles@xxxxxxxxxx
Senior Engineer                 Red Hat Professional Consulting





[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux