Product SiteDocumentation Site

A.15. Example Kickstart Configurations

A.15.1. Advanced Partitioning Example

The following is an integrated example showing the clearpart, zerombr, part, raid, volgroup, and logvol Kickstart options in action:
Example A.3. Advanced Partitioning Example
clearpart --drives=hda,hdc
zerombr
# Raid 1 IDE config
part raid.11 --size 1000 --asprimary --ondrive=hda
part raid.12 --size 1000 --asprimary --ondrive=hda
part raid.13 --size 2000 --asprimary --ondrive=hda
part raid.14 --size 8000 --ondrive=hda
part raid.15 --size 16384 --grow --ondrive=hda
part raid.21 --size 1000 --asprimary --ondrive=hdc
part raid.22 --size 1000 --asprimary --ondrive=hdc
part raid.23 --size 2000 --asprimary --ondrive=hdc
part raid.24 --size 8000 --ondrive=hdc
part raid.25 --size 16384 --grow --ondrive=hdc

# You can add --spares=x
raid / --fstype xfs --device root --level=RAID1 raid.11 raid.21
raid /safe --fstype xfs --device safe --level=RAID1 raid.12 raid.22
raid swap --fstype swap --device swap --level=RAID1 raid.13 raid.23
raid /usr --fstype xfs --device usr --level=RAID1 raid.14 raid.24
raid pv.01 --fstype xfs --device pv.01 --level=RAID1 raid.15 raid.25

# LVM configuration so that we can resize /var and /usr/local later
volgroup sysvg pv.01
logvol /var --vgname=sysvg --size=8000 --name=var
logvol /var/freespace --vgname=sysvg --size=8000 --name=freespacetouse
logvol /usr/local --vgname=sysvg --size=1 --grow --name=usrlocal

This advanced example implements LVM over RAID, as well as the ability to resize various directories for future growth.
First, the clearpart command is used on drives hda and hdc to wipe them. The zerombr command initializes unused partition tables.
Then, the two drives are partitioned to prepare them for RAID configuration. Each drive is divided into five partitions, and each drive is partitioned into an identical layout.
The next part uses these pairs of physical partitions to create a software RAID device with RAID1 level (mirroring). The first four RAID devices are used for / (root), /safe, swap and /usr. The fifth, largest pair of partitions is named pv.01 and will be used in the following part as a physical volume for LVM.
Finally, the last set of commands first creates a volume group named sysvg on the pv.01 physical volume. Then, three logical volumes (/var, /var/freespace and /usr/local) are created and added to the sysvg volume group. The /var and /var/freespace volumes have a set size of 8 GB, and the /usr/local volume uses the --grow option to fill all remaining available space.

Important

The above example uses identifiers hda and hdc to identify disk drives. You should use unique identifiers, such as a disk labels or an UUIDs, to identify disk drives. See the note in introduction to this appendix.