Resize Logical Volumes

Use the Storage page in the web console, Cockpit administrators can resize the storage size of a logical volume.

Note:

Logical Volume Manager (LVM) caters for the ability to increase the space of a logical volume and its file system while it's in use. The ability to reduce the space of a logical volume depends on the file system type. For example, an XFS file system doesn't support the ability to reduce the volume size.

What Do You Need?

  • The Cockpit web console must be installed and accessible.

    For details, see these topics: Install and Enable Cockpit and Log in to the Cockpit Web Console.

  • The cockpit-storaged package must be installed.

    Note:

    If the cockpit-storaged package isn't installed, see this section Install and Manage Add-on Applications.
  • When increasing a logical volume size, the following considerations apply:
    • A mounted active logical volume exists on the host.

      Note:

      LVM caters for the ability to add space to a logical volume and its file system while the file system is mounted and in use.
    • Free space must be available in the volume group in which the logical volume resides.
  • When reducing a logical volume size, the following considerations apply:
    • The logical volume file system must support the ability to reduce the volume space. EXT 3 and 4 file systems support offline resizing when reducing the size. While XFS and GFS2 file systems don't allow you to reduce the volume size offline or online.
    • For EXT3 and EXT4 file systems, the logical volume must be unmounted before reducing its size.
    • An EXT3 or EXT4 file system must be reduced in size before the logical volume in which it resides can be reduced.
  • Administrator privileges.

Steps

Using the Cockpit web console, follow these steps to resize a logical volume.

  1. In the Storage page, find the table for Devices and select a volume group that contains the logical volume that you want to size.

    The LVM2 group [name] page appears.

  2. In the LVM2 group [name] page, navigate to the Logical volumes table.
  3. In the Logical volumes table, find the volume entry that you want to resize and then click the down arrow to expand the volume information.

    A Volume tab appears.

  4. In the Volume tab, click Grow or Shrink. One of the following dialogs appears.

    Note:

    An error message might appear for any of these reasons: (1) the volume group doesn't have free space available; (2) the logical volume content is unreadable; or (3) the logical file system doesn't support the ability for reducing the volume size.
    • Grow Logical Volume dialog.
      1. Click and drag the Grow slider to define the increased volume size.
      2. Click Grow.

        LVM grows the size of the logical volume space.

    • Shrink Logical Volume dialog.
      1. Click and drag the Shrink slider to define the reduced volume size.
      2. Click Shrink.

        LVM shrinks the size of the logical volume space.