You can reduce the size if an LVM data partition only. You cannot reduce the size of a root volume.
Unmount the disk and reduce the filesystem using your hypervisor tools. For example:
# umount /dev/mapper/clear_myvg-myvol # e2fsck -f /dev/mapper/clear_myvg-myvol # resize2fs /dev/mapper/clear_myvg-myvol <newsize>
Shrink the underlying volume. For example:
# lvreduce -L<new size> /dev/myvg/myvol
Resize the crypto mapping so that it matches the volume size using the command hcl resize [-y] diskname
, where:
diskname
is the short form of the disk name, as shown in the hcl status
command. For example, myvg-myvol
.
-y
makes the command non-interactive.
# hcl resize myvg-myvol
Remount the filesystem.
# mount /dev/mapper/clear_myvg-myvol