Kickstart and LVM

Creating Partitions with Kickstart

Partitioning with Kickstart


Partitions can be created either manually or by using the kickstart configuration tool. If you are working with partitions that require LVM, then unfortunately, the kickstart configuration tool can not be used as this is currently not supported.



Basic Partitioning with Kickstart Configurator Tool


To create a partition using the kickstart configurator tool simply click on the "Add" button. Next you need to supply the following information: Mount Point, Filesystem Type, Size in MB, Specify if this partition is to be a Primary partition.


Kickstart Partition Information

Mount Point


Specify the mount point:

/
boot
home
var
tmp
usr
opt

The above mount points are available from the pull down menu.


File System Type


The main filesystem types available are:

PPC PRep Boot
ext2
ext3
ext4
software RAID
swap
vfat


Make Partition on Specific Drive


Specify disk: hda, sdc (Do not specify disks as /dev/sdx or /dev/hdx. Only specify name such as sda or hda)


Use an existing Partition


hda1, sdc3


Size Options


Fixed size in MB
Grow to Maximum size (MB)
Fill all unused space on disk

Use recommended swap size (If your filesystem type is swap, then you can use the recommended swap size)


Special Options


Force to be a primary option
Format Partition


Kickstart Partitions with LVM


To create Volume Groups and Logical Volumes form kickstart, you can not use the configurator tool. These settings will need to be defined manually. Below is an example of a simple setup.



zerombr 
clearpart --all --drives=sda
####################################
part /boot --fstype ext4 --size=500
part swap --size=1024
part pv.01      --size=1000     --grow  --ondisk=sda
volgroup vg00 pv.01
logvol / --vgname=vg00  --fstype=ext4  --size=2048 --name=lv_root
logvol /var --vgname=vg00 --fstype=ext4 --size=1024 --name=lv_var
logvol /tmp --vgname=vg00 --fstype=ext4 --size=512 --name=lv_tmp

The above is an extract from a kickstart file with a simple LVM partition scheme.

zerombr Specifies that we will reinitialize our disk. (Recommended with an unattended installation)

clearpart --all --drives=sda Specifies that all partitions will be cleared on drive sda

part /boot --fstype ext4 --size=500 Creates a boot partition. File system ext4 has been chosen and a size of 500MB specified

part swap --size=1024 Creates a swap partition of 1024MB (For sizing, generally a rule of thumb is to double the amount of memory. Example if you have 512MB of physical memory you would specify a size of 1024MB)

part pv.01 --size=1000 --grow --ondisk=sda Create first partition initially with a size of 1000MB, however, allow it to consume the remainder of available space. (--grow option is useful if this configuration is used on different sized disks)

volgroup vg00 pv.01 Create a VolumeGroup called vg00 on specified Physical Volume (pv.01)

logvol / --vgname=vg00 --fstype=ext4 --size=2048 --name=lv_root Create a Logical Volume called lv_root on VolumeGroup vg00 with a filesystem type of ext4 with a size of 2048MB

logvol /var --vgname=vg00 --fstype=ext4 --size=1024 --name=lv_var Create a Logical Volume called lv_var on Volume Group vg00 with a filesystem type of ext4 and a size of 1024MB

logvol /tmp --vgname=vg00 --fstype=ext4 --size=512 --name=lv_tmp Create a Logical Volume called lv_tmp on Volume Group vg00 with a filesystem type of ext4 with a size of 512MB

Note: The sizes specified here are only for testing purposes. You should size your Partitions/Logical Volumes to match the role that your server will be carrying out.


Useful Options


--grow This command is used to tell the anaconda installer to create a partition as large as possible.

-–maxsize= This command is used in conjunction with the grow command to set an max upper limit on the size

Note: It is recommended that if you use the grow option that you also use the maxsize parameter. If you don't specify a maxsize, you may end up with unpredictable space shortages!