Show Table of Contents
26.4. Sample Kickstart Configurations
26.4.1. Advanced Partitioning Example
The following is an integrated example showing the
clearpart, zerombr, part, raid, volgroup, and logvol Kickstart options in action:
Example 26.9. Advanced Partitioning Example
clearpart --drives=hda,hdczerombr# Raid 1 IDE configpart raid.11 --size 1000 --asprimary --ondrive=hdapart raid.12 --size 1000 --asprimary --ondrive=hdapart raid.13 --size 2000 --asprimary --ondrive=hdapart raid.14 --size 8000 --ondrive=hdapart raid.15 --size 16384 --grow --ondrive=hdapart raid.21 --size 1000 --asprimary --ondrive=hdcpart raid.22 --size 1000 --asprimary --ondrive=hdcpart raid.23 --size 2000 --asprimary --ondrive=hdcpart raid.24 --size 8000 --ondrive=hdcpart raid.25 --size 16384 --grow --ondrive=hdc# You can add --spares=xraid / --fstype xfs --device root --level=RAID1 raid.11 raid.21raid /safe --fstype xfs --device safe --level=RAID1 raid.12 raid.22raid swap --fstype swap --device swap --level=RAID1 raid.13 raid.23raid /usr --fstype xfs --device usr --level=RAID1 raid.14 raid.24raid pv.01 --fstype xfs --device pv.01 --level=RAID1 raid.15 raid.25# LVM configuration so that we can resize /var and /usr/local latervolgroup sysvg pv.01logvol /var --vgname=sysvg --size=8000 --name=varlogvol /var/freespace --vgname=sysvg --size=8000 --name=freespacetouselogvol /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.
26.4.2. User Input Example
The following is an example showing how to prompt the user for input, and then read that input and save it as a variable, using bash:
Example 26.10. User Input Example
exec < /dev/tty6 > /dev/tty6 2> /dev/tty6chvt 6IFS=$'\n'echo -n "Enter input: "read USERINPUTechoecho -n "You entered:" "$USERINPUT"echochvt 1exec < /dev/tty1 > /dev/tty1 2> /dev/tty1
Due to the way Kickstart operates, the script must switch to a new virtual terminal before reading input from the user. This is accomplished by the
exec < /dev/tty6 > /dev/tty6 2> /dev/tty6 and chvt 6 commands. The read USERINPUT reads input from the user until enter is pressed, and stores it in the variable USERINPUT. The echo -n "You entered:" "$USERINPUT" command displays the text You entered: followed by the user's input. Finally, the chvt 1 and exec < /dev/tty1 > /dev/tty1 2> /dev/tty1 commands switch back to the original terminal and allow Kickstart to continue installation.
26.4.3. Example Kickstart file for installing and starting the RNG daemon
The following is an example Kickstart file which demonstrates how to install and enable a service, in this case the Random Number Generator (RNG) daemon, which supplies entropy to the system kernel:
Example 26.11. Example Kickstart file for installing and starting the RNG daemon
services --enabled=rngd%packagesrng-tools%end
The
services --enabled=rngd command instructs the installed system to start the RNG daemon each time the system starts. The rng-tools package, which contains the RNG daemon, is then designated for installation.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.