logvol

The logvol Kickstart command is optional. It creates a logical volume for Logical Volume Manager (LVM).

Syntax

              logvol mntpoint --vgname=name --name=name [OPTIONS]
            
Mandatory options
  • mntpoint: The mount point where the partition is mounted. Must be of one of the following forms:
    • /path

      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 and 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 Recommended Partitioning Scheme for AMD64, Intel 64, and 64-bit ARM systems.

  • --vgname=name: Name of the volume group.
  • --name=name: Name of the logical volume.
Optional options
  • --noformat: Use an existing logical volume and do not format it.
  • --useexisting: Use an existing logical volume and reformat it.
  • --fstype=: Sets the file system type for the logical volume. Valid values are xfs, ext2, ext3, ext4, swap, and vfat.
  • --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. Note
    In the EFI system partition (/boot/efi), anaconda hard codes the value and ignores the users specified --fsoptions values.
  • --mkfsoptions=: Specifies additional parameters to be passed to the program that makes a filesystem on this partition. 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. For example,
    part /opt/foo1 --size=512 --fstype=ext4 --mkfsoptions="-O ^has_journal,^flex_bg,^metadata_csum"
    part /opt/foo2 --size=512 --fstype=xfs --mkfsoptions="-m bigtime=0,finobt=0"

    For details, see the man pages of the filesystems you are creating. For example, mkfs.ext4 or mkfs.xfs.

  • --fsprofile=: Specifies a usage type to be passed to the program that makes a filesystem on this partition. A usage type defines a variety of tuning parameters to be used when making a filesystem. For this option to work, the filesystem must support the concept of usage types and there must be a configuration file that lists valid types. For ext2, ext3, and ext4, this configuration file is /etc/mke2fs.conf.
  • --label=: Sets a label for the logical volume.
  • --grow: Extends the logical volume to occupy the available space (if any), or up to the maximum size specified, if any. The option must be used only if you have pre-allocated a minimum storage space in the disk image, and would want the volume to grow and occupy the available space. In a physical environment, this is a one-time-action. However, in a virtual environment, the volume size increases as and when the virtual machine writes any data to the virtual disk.
  • --size=: The size of the logical volume in MiB. This option cannot be used together with the --percent= option.
  • --percent=: The size of 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 cannot be used together with the --size= option. Important
    When creating a new logical volume, either specify its size statically by using the --size= option, or as a percentage of remaining free space by using the --percent= option. You cannot use both of these options on the same logical volume.
  • --maxsize=: The maximum size in MiB 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 logical volume to determine the size of this volume automatically, based on your system’s hardware. For details about the recommended scheme, see Recommended Partitioning Scheme for AMD64, Intel 64, and 64-bit ARM systems.
  • --resize: Resize a logical volume. If you use this option, you must also specify --useexisting and --size.
  • --encrypted: Specifies that this logical volume should be encrypted with Linux Unified Key Setup (LUKS) by using the passphrase provided in the --passphrase= option. If you do not specify a passphrase, the installation program stops the installation and prompts you to provide a passphrase if no default is set. Note
    When encrypting one or more partitions, Anaconda attempts to gather 256 bits of entropy to ensure the partitions are encrypted securely. Gathering entropy can take some time - the process will stop after a maximum of 10 minutes, regardless of whether sufficient entropy has been gathered. The process can be sped up by interacting with the installation system (typing on the keyboard or moving the mouse). If you are installing in a virtual machine, you can also attach a virtio-rng device (a virtual random number generator) to the guest.
  • --passphrase=: Specifies the passphrase to use when encrypting this logical volume. You must use this option together with the --encrypted option; it has no effect by itself.
  • --cipher=: Specifies the type of encryption to use 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 Security hardening. For example, aes-xts-plain64.
  • --escrowcert=URL_of_X.509_certificate: Store data encryption keys of all encrypted volumes as files in /root, encrypted by 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.
  • --luks-version=LUKS_VERSION: Specifies which version of LUKS format should be used to encrypt the filesystem. 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 by using the X.509 certificate specified with --escrowcert. This option is only meaningful if --escrowcert is specified.
  • --pbkdf=PBKDF: Sets Password-Based Key Derivation Function (PBKDF) algorithm for LUKS keyslot. See also the man page cryptsetup(8). This option is only meaningful if --encrypted is specified.
  • --pbkdf-memory=PBKDF_MEMORY: Sets the memory cost for PBKDF. See also the man page cryptsetup(8). This option is only meaningful if --encrypted is specified.
  • --pbkdf-time=PBKDF_TIME: Sets the number of milliseconds to spend with PBKDF passphrase processing. See also --iter-time in the man page cryptsetup(8). This option is only meaningful if --encrypted is specified, and is mutually exclusive with --pbkdf-iterations.
  • --pbkdf-iterations=PBKDF_ITERATIONS: Sets the number of iterations directly and avoids PBKDF benchmark. See also --pbkdf-force-iterations in the man page cryptsetup(8). This option is only meaningful if --encrypted is specified, and is mutually exclusive with --pbkdf-time.
  • --thinpool: Creates a thin pool of logical volume. (Use a mount point of none)
  • --metadatasize=size: Specify the metadata area size (in MiB) for a new thin pool device.
  • --chunksize=size: Specify the chunk size (in KiB) for a new thin pool device.
  • --thin: Create a thin logical volume. (Requires use of --poolname)
  • --poolname=name: Specify the name of the thin pool in which to create a thin logical volume. Requires the --thin option.
  • --profile=name: 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 physical volumes which should be used as a cache for this volume.
  • --cachemode=: Specify which mode should be used to cache this logical volume - either writeback or writethrough. Note
    For more information about cached logical volumes and their modes, see the lvmcache(7) man page on your system.
  • --cachesize=: Size of cache attached to the logical volume, specified in MiB. This option requires the --cachepvs= option.
Notes
  • Do not use the dash (-) character in logical volume and volume group names when installing Red Hat Enterprise Linux by using Kickstart. If this character is used, the installation finishes 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 by using the --noformat option, their names will not be changed.
  • If you lose the LUKS passphrase, any encrypted partitions and their data is completely inaccessible. There is no way to recover a lost passphrase. However, you can save encryption passphrases with the --escrowcert and create backup encryption passphrases with the --backuppassphrase options.
Examples
  • Create the partition first, create the volume group, and then create the logical volume:
    part pv.01 --size 3000
    volgroup myvg pv.01
    logvol / --vgname=myvg --size=2000 --name=rootvol
  • Create the partition first, create the volume group, and then create the logical volume to occupy 90% of the remaining space in the volume group:
    part pv.01 --size 1 --grow
    volgroup myvg pv.01
    logvol / --vgname=myvg --name=rootvol --percent=90