Space Reclamation Support for Logical Volume Storage
In AIX® 7.2 with the 7200-01 Technology Level, or later, the Logical Volume Manager (LVM) supports space reclamation for physical volumes that are capable of reclaiming space.
LVM informs the disk driver, which in-turn informs the storage subsystem that the partition space
is no longer in use and the storage subsystem can reclaim the allocated space. The disk driver helps
LVM detect the space reclaim capability of physical volume. LVM and file system configuration
commands such as the rmlv
command, rmlvcopy
command, and the
chfs(shrink fs)
command initiate the space reclamation for the partitions after
they are freed. LVM detects the physical volume's space reclaim capability when it opens the volume
during the execution of the varyonvg
or the extendvg
command. LVM
also tries to detect it while the volume group is online. If the state change detection requires
physical volume to be reopened, administrator must run the varyoffvg
command and
then run the varyonvg
command for the volume group.
Volume groups that are created before AIX 7.2 Technology Level 1 might have free partition space, which is not eligible for automatic reclamation. Administrator can create and delete dummy logical volume on those free partitions to reclaim this space. But space will be automatically reclaimed for the partitions, which are freed after installation of AIX 7.2 Technology Level 1.
The LVM process to reclaim the space runs in the background after a command such as
rmlv
completes execution. If the system crashes before the LVM process completes
the reclamation process for all the partitions, then the partitions are freed but the space is not
reclaimed for the pending partitions. If this scenario occurs, you can create and delete dummy
logical volume to reclaim the space from the remaining partitions.
The LVM process does not delay the processing of the varyoffvg
command or the
reducevg
command even if the space reclamation process is pending. The space
reclamation process is discarded instead of waiting for the process to finish.
The space reclamation functionality is available from the storage subsystem to reclaim the freed
space from a physical volume. Each storage subsystem expects the reclaim request to be aligned on
specific number of physical blocks, and the number of physical blocks varies according to the
storage subsystem. So sometimes reclaiming blocks (all or some) from partition is not possible
because reclaim size is not aligned with the physical blocks of the partition. Some storage
subsystems support reclaim of block size that is more than the LVM partition size, and partial block
reclamation is not possible. In this scenario, LVM might not be able to accumulate enough contiguous
free partitions to generate even a single reclaim request. Therefore, when you delete multiple LVM
partitions you might not reclaim the equivalent amount of space in the storage subsystem. You can
use the lvmstat
command with the -r option to get information
about the space reclamation requests generated by the LVM.