Product SiteDocumentation Site

A.2.9. logvol (optional) - Create LVM Logical Volume

Create a logical volume for Logical Volume Management (LVM) with the syntax:
logvol mntpoint --vgname= --name= [options]

Note

Do not use the dash (-) character in logical volume and volume group names when installing Fedora using Kickstart. If this character is used, the installation will finish normally, but the /dev/mapper/ directory will list these volumes and volume groups with every dash doubled. For example, a volume group named volgrp-01 containing a logical volume named logvol-01 will be listed as /dev/mapper/volgrp--01-logvol--01.
This limitation only applies to newly created logical volume and volume group names. If you are reusing existing ones using the --noformat or --useexisting option, their names will not be changed.
For a detailed example of logvol in action, see Section A.15.1, “Advanced Partitioning Example”.
mntpoint
Replace with the volume's mount point. This name can take the following forms:
/path
A path to the mount point - for example, / or /home
swap
The partition is used as swap space.
To determine the size of the swap partition automatically, use the --recommended option:
swap --recommended
To determine the size of the swap partition automatically but also allow extra space for your system to hibernate, use the --hibernation option:
swap --hibernation
The size assigned will be equivalent to the swap space assigned by --recommended plus the amount of RAM on your system.
For the swap sizes assigned by these commands, see the section describing swap in Section 5.4.10.6, “Recommended Partitioning Scheme”.
none
Used only when creating a thin pool volume.
--noformat
Use an existing logical volume and do not format it.
--useexisting
Use an existing logical volume and format it.
--fstype=
Sets the file system type for the logical volume. Valid values are xfs, ext2, ext3, ext4, swap, and vfat. See Section 5.4.10.5, “Device, File System and RAID Types” for information about available file systems.
--fsoptions=
Specifies a free form string of options to be used when mounting the filesystem. This string will be copied into the /etc/fstab file of the installed system and should be enclosed in quotes. For example:
--fsoptions="ro, x-systemd.device-timeout=0"
--mkfsoptions=
Specifies additional parameters to be passed to the program that makes a filesystem on this logical volume. No processing is done on the list of arguments, so they must be supplied in a format that can be passed directly to the mkfs program. This means multiple options should be comma-separated or surrounded by double quotes, depending on the filesystem.
--label=
Sets a label for the logical volume.
--grow
Grow the volume to fill available space (if any), or up to the limit set by the --maxsize= option.
--size=
The size of the logical volume in megabytes. This option can not be used together with the --percent= option.
--percent=
Specify the amount by which to grow the logical volume, as a percentage of the free space in the volume group after any statically-sized logical volumes are taken into account. This option can not be used together with the --size= and --grow options.

Important

When creating a new logical volume, you must either specify its size statically using the --size= option, or as a percentage of remaining free space using the --percent= option. You can not use both of these options on the same logical volume.
--maxsize=
The maximum size in megabytes when the logical volume is set to grow. Specify an integer value here such as 500 (do not include the unit).
--recommended
Use this option when creating a swap logical volume to determine the size of this volume automatically, based on your system's hardware. For details about the recommended scheme, see Section 5.4.10.6, “Recommended Partitioning Scheme”.

Important

This option can only be used for partitions which result in a file system such as the /boot partition and swap space. It can not be used to create partitionsm, LVM physical or logical volumes or RAID members.
--resize
Resize an existing logical volume. If you use this option, you must also specify --useexisting and --size.
--encrypted
Specifies that this logical volume should be encrypted, using the passphrase provided in the --passphrase= option. If you do not specify a passphrase, the installation program will use the default, system-wide passphrase set with the autopart --passphrase command, or stop the installation and prompt you to provide a passphrase if no default is set.
--passphrase=
Specifies the passphrase to use when encrypting this logical volume. You must use this option together with the --encrypted option. This option has no effect by itself.
--cipher=
Specifies which type of encryption will be used if the Anaconda default aes-xts-plain64 is not satisfactory. You must use this option together with the --encrypted option; by itself it has no effect. Available types of encryption are listed in the Fedora Security Guide, available at http://docs.fedoraproject.org/. Using either aes-xts-plain64 or aes-cbc-essiv:sha256 is strongly recommended.
--escrowcert=URL_of_X.509_certificate
Store data encryption keys of all encrypted volumes as files in /root, encrypted using the X.509 certificate from the URL specified with URL_of_X.509_certificate. The keys are stored as a separate file for each encrypted volume. This option is only meaningful if --encrypted is specified.
--backuppassphrase
Add a randomly-generated passphrase to each encrypted volume. Store these passphrases in separate files in /root, encrypted using the X.509 certificate specified with --escrowcert. This option is only meaningful if --escrowcert is specified.
--thinpool
Creates a thin pool logical volume. (Use a mount point of none)
--metadatasize=
Metadata area size (in MiB) for a new thin pool device.
--chunksize=
Chunk size (in KiB) for a new thin pool device.
--thin
Create a thin logical volume. (Requires use of --poolname)
--poolname=
Specify the name of the thin pool in which to create a thin logical volume. Requires the --thin option.
--profile=
Specify the configuration profile name to use with thin logical volumes. If used, the name will also be included in the metadata for the given logical volume. By default, the available profiles are default and thin-performance and are defined in the /etc/lvm/profile directory. See the lvm(8) man page for additional information.
--cachepvs=
A comma-separated list of (fast) physical volumes which should be used for LVM cache.
--cachesize=
Requested size of cache attached to the logical volume, in MiB. (Requires the --cachepvs= option.)
--cachemode=
Mode to be used for LVM cache (either writeback or writethrough).

Note

The --cachepvs=, --cachesize=, and --cachemode= options listed above are used to configure LVM caching. For more information, see the lvmcache(7) man page.
Create one or more partitions first using Section A.2.10, “part (required) - Create Physical Partition”, create the logical volume group (Section A.2.13, “volgroup (optional) - Create LVM Volume Group”), and then create logical volumes. For example:
part pv.01 --size 3000
volgroup myvg pv.01
logvol / --vgname=myvg --size=2000 --name=rootvol