volgroup and logvol

Latest response

I use to use the volgroup and log vol commands and now it is not working on my RHEL 7.1 system. Have the commands changed.

Responses

I see that by default in RHEL7.x when installed using default anaconda installer then it would create / and swap as lvs with vg name being set as "rhel" (lv names :root & swap) with separate partition for "boot". I hope this is what you are asking about.

Do you mean the Kickstart configuration commands, or something else?

Here's a working example of the use of volgroup and logvol Kickstart configuration keywords for RHEL 7.1. This is from a network installation Kickstart configuration file that is working just fine.

clearpart --all --initlabel --drives=sda
# Disk partitioning information
reqpart
part pv.293 --fstype="lvmpv" --ondisk=sda --size=27435 --grow
part /boot --fstype="xfs" --ondisk=sda --size=500
volgroup vgsys --pesize=4096 pv.293
logvol /home  --fstype="xfs" --size=4096 --name=home --vgname=vgsys
logvol /  --fstype="xfs" --size=8192 --name=lvroot --vgname=vgsys
logvol /tmp  --fstype="xfs" --size=3814 --name=tmp --vgname=vgsys
logvol /var  --fstype="xfs" --size=5722 --name=var --vgname=vgsys
logvol swap  --fstype="swap" --size=3968 --name=swap --vgname=vgsys
logvol /opt  --fstype="xfs" --size=6144 --name=opt --vgname=vgsys

Of course, your configuration must be internally consistent: the sum of the sizes of your logvols cannot be greater than the size of your LVM PV, and you cannot create a volgroup without specifying where to put its PV. If the disk partitioning configuration is not valid, then the installer falls back to the defaults and won't automatically proceed through the partitioning phase.

As disk partitions can have alignment restrictions, and am UEFI system needs an extra ESP partition (hence the "reqpart" keyword in my example), specifying the sizes of the partitions and LVs so that they'll completely fill the available disk is not a good idea. When specifying partitioning in the Kickstart file, always leave some slack: if you specify one of the partitions (usually the PV) with a --grow option, the installer will expand it to automatically take up any free space. Then the volume group will contain some unallocated space, which can then be added to whichever logical volume needs it most while the system is installed and running.

You may prefer to use "kickstart Generator" to get the file and use it to avoid any typo/syntax errors. [https://access.redhat.com/labs/kickstartconfig/] (https://access.redhat.com/labs/kickstartconfig/)

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.