Chapter 19. Configuring LVM logical volumes using the web console

Red Hat Enterprise Linux 8 supports the LVM logical volume manager. When you install a Red Hat Enterprise Linux 8, it will be installed on LVM automatically created during the installation.

cockpit lvm rhel

The screenshot shows the web console view of a clean installation of a RHEL 8 system with two logical volumes automatically created during the installation.

To find out more about logical volumes, follow the sections describing:

Prerequisites

  • The RHEL 8 web console has been installed.

    For instructions, see Installing and enabling the web console.

  • The cockpit-storaged package is installed on your system.
  • Physical drives, RAID devices, or any other type of block device from which you can create the logical volume.

19.1. Logical Volume Manager in the web console

The RHEL 8 web console provides a graphical interface to create LVM volume groups and logical volumes.

Volume groups create a layer between physical and logical volumes. It makes you possible to add or remove physical volumes without influencing logical volume itself. Volume groups appear as one drive with capacity consisting of capacities of all physical drives included in the group.

You can join physical drives into volume groups in the web console.

Logical volumes act as a single physical drive and it is built on top of a volume group in your system.

Main advantages of logical volumes are:

  • Better flexibility than the partitioning system used on your physical drive.
  • Ability to connect more physical drives into one volume.
  • Possibility of expanding (growing) or reducing (shrinking) capacity of the volume on-line, without restart.
  • Ability to create snapshots.

19.2. Creating volume groups in the web console

Create volume groups from one or more physical drives or other storage devices.

Logical volumes are created from volume groups. Each volume group can include multiple logical volumes.

For details, see Managing LVM volume groups.

Prerequisites

  • Physical drives or other types of storage devices from which you want to create volume groups.

Procedure

  1. Log in to the RHEL 8 web console.
  2. Click Storage.
  3. In the Devices section, select Create LVM2 volume group in the drop down menu.

    cockpit adding volume groups

  4. In the Name field, enter a name of a group without spaces.
  5. Select the drives you want to combine to create the volume group.

    cockpit create volume group

    It might happen that you cannot see devices as you expected. The RHEL web console displays only unused block devices. Used devices means, for example:

    • Devices formatted with a file system
    • Physical volumes in another volume group
    • Physical volumes being a member of another software RAID device

      If you do not see the device, format it to be empty and unused.

  6. Click Create.

The web console adds the volume group in the Devices section. After clicking the group, you can create logical volumes that are allocated from that volume group.

cockpit volume group

19.3. Creating logical volumes in the web console

Logical volumes act as physical drives. You can use the RHEL 8 web console to create LVM logical volumes in a volume group.

Prerequisites

Procedure

  1. Log in to the RHEL 8 web console.
  2. Click Storage.
  3. In the Devices section, click the volume group in which you want to create logical volumes.
  4. In the Logical volumes section, click Create new Logical Volume.
  5. In the Name field, enter a name for the new logical volume without spaces.
  6. In the Purpose drop down menu, select Block device for filesystems.

    This configuration enables you to create a logical volume with the maximum volume size which is equal to the sum of the capacities of all drives included in the volume group.

    cockpit lv block dev

  7. Define the size of the logical volume. Consider:

    • How much space the system using this logical volume will need.
    • How many logical volumes you want to create.

    You do not have to use the whole space. If necessary, you can grow the logical volume later.

    cockpit lv size

  8. Click Create.

To verify the settings, click your logical volume and check the details.

cockpit lv details

At this stage, the logical volume has been created and you need to create and mount a file system with the formatting process.

19.4. Formatting logical volumes in the web console

Logical volumes act as physical drives. To use them, you must format them with a file system.

Warning

Formatting logical volumes erases all data on the volume.

The file system you select determines the configuration parameters you can use for logical volumes. For example, the XFS file system does not support shrinking volumes. For details, see Resizing logical volumes in the web console.

Prerequisites

Procedure

  1. Log in to the RHEL 8 web console.
  2. Click Storage.
  3. In the Devices section, click the volume group in which the logical volume is placed.
  4. In the Logical volumes section, click Format.

    Image displaying the details of the existing logical volumes.

  5. In the Name field, enter a name for the file system.
  6. In the Mount Point field, add the mount path.

    The format a logical volume dialog box with configurable fields.

  7. In the Type drop-down menu, select a file system:

    • XFS file system supports large logical volumes, switching physical drives online without outage, and growing an existing file system. Leave this file system selected if you do not have a different strong preference.

      XFS does not support reducing the size of a volume formatted with an XFS file system

    • ext4 file system supports:

      • Logical volumes
      • Switching physical drives online without an outage
      • Growing a file system
      • Shrinking a file system
  8. Based on how you want to format the volume, select the Overwrite option:

    • Do not overwrite existing data — the RHEL web console rewrites only the disk header. The advantage of this option is the short time required for the formatting process.
    • Overwrite existing data with zeros — the RHEL web console rewrites the whole disk with zeros. This option is slower because the program has to go through the whole disk. Use this option if the disk includes any data and you need to overwrite it.
  9. In the Encryption drop-down menu, select the type of encryption if you want to enable it on the logical volume.

    You can select a version with either the LUKS1 (Linux Unified Key Setup) or LUKS2 encryption, which allows you to encrypt the volume with a passphrase.

  10. In the At boot drop-down menu, select when you want the logical volume to mount after the system boots.
  11. Select the required Mount options.
  12. Format the logical volume:

    • If you want to format the volume and immediately mount it, click Format and mount.
    • If you want to format the volume without mounting it, click Format only.

      Formatting can take several minutes depending on the volume size and which formatting options are selected.

Verification

  1. After the formatting completes successfully, you can see the details of the formatted logical volume on the Filesystem tab.

    cockpit lv formatted

  2. If you had selected the Format only option, click Mount to use the logical volume.

19.5. Resizing logical volumes in the web console

Learn how to extend or reduce logical volumes in the RHEL 8 web console.

Whether you can resize a logical volume depends on which file system you are using. Most file systems enable you to extend (grow) the volume online (without outage).

You can also reduce (shrink) the size of logical volumes, if the logical volume contains a file system which supports shrinking. It should be available, for example, in the ext3/ext4 file systems.

Warning

You cannot reduce volumes that contains GFS2 or XFS filesystem.

Prerequisites

  • Existing logical volume containing a file system that supports resizing logical volumes.

Procedure

The following steps provide the procedure for growing a logical volume without taking the volume offline:

  1. Log in to the RHEL web console.
  2. Click Storage.
  3. In the Devices section, click the volume group in which the logical volume is placed.
  4. In the Logical volumes section, click the logical volume.
  5. On the Volume tab, click Grow.

    cockpit lv details

  6. In the Grow logical volume dialog box, adjust volume size.

    cockpit lv grow

  7. Click Grow.

LVM grows the logical volume without system outage.