Expanding an LVM Data or Root Volume

How you expand an LVM data or root volume depends on whether you have enabled Online Encryption.

If you want to expand a LVM swap volume, see Expanding an LVM Swap Volume. If you want to expand a Linux root or data partition that is not managed by LVM, see Expanding a Root Partition and Expanding a Linux Data Partition.

Procedure 

  1. Expand the disk using your hypervisor tools.
  2. Extend the underlying volume using your Linux management tools.

    For example, if the disk is an LVM volume called myvg-myvol, you would use:

    # lvextend -L<new size> /dev/myvg/myvol

  3. Use the following command to resize the crypto mapping so that it matches the volume size: 

    hcl resize diskname, where diskname is the short form of the disk name, as shown in the hcl status command. For example, myvg-myvol.

    # hcl resize myvg-myvol

    Important: The hcl resize command will fail if there is any ongoing encryption, rekey, or decryption. Please wait until the process is over before you run this command.

  4. Expand the filesystem. How you do this depends on whether the volume uses the XFS or EXT filesystem. Both methods require you to specify the clear text path to the volume.

    Tip: The clear text path is shown in the hcl status command.

    XFS Filesystems

    Use the xfs_growfs clear_path command, where clear_path is the clear text path to the disk. For a data partition, the default path is /dev/mapper/clear_diskname. For a root partition, the clear text path is /dev/mapper/clear_htroot.

    # xfs_growfs /dev/mapper/clear_myvg_myvol
    meta-data=/dev/mapper/clear_myvg_myvol isize=512    agcount=8, agsize=65536 blks
            =                       sectsz=512   attr=2, projid32bit=1
             =                       crc=1        finobt=0 spinodes=0
    data     =                       bsize=4096   blocks=498688, imaxpct=25
             =                       sunit=0      swidth=0 blks
    naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
    log      =internal               bsize=4096   blocks=2560, version=2
             =                       sectsz=512   sunit=0 blks, lazy-count=1
    realtime =none                   extsz=4096   blocks=0, rtextents=0
    data blocks changed from 498688 to 524288

    EXT Filesystems

    Use the resize2fs clear_path command, where clear_path is the clear text path to the disk. For a data partition, the default path is /dev/mapper/clear_diskname. For a root partition, the clear text path is /dev/mapper/clear_htroot.

    # resize2fs /dev/mapper/clear_myvg-myvol
    # resize2fs /dev/mapper/clear_htroot