Review Current Configuration
Use the following commands to display information about the existing LVM setup:
-
Physical volumes:
pvs
-
Volume groups:
vgs
-
Logical volumes:
lvs
These commands help identify the relevant devices and volumes involved in the expansion process.
1. Resizing the physical volume:
Based on the output of
pvs
, determine the target physical volume.
Resize the physical volume:
pvresize /dev/$DEVICE_FILE
Verify the resize by re-running the
pvs
command. The updated size should now be reflected. 2. Extending the LVM volume:
Identify the full path to the logical volume. You can either construct it manually from the
vgs
and lvs
output or use
lvscan
which will give you the full path: /dev/$VOLUME_GROUP/$LOGICAL_VOLUMEExtend the logical volume to use 100% of the available space:
lvextend -l +100%FREE /dev/$VOLUME_GROUP/$LOGICAL_VOLUME
3. Resize the filesystem
Resize the filesystem on the extended logical volume:
resize2fs /dev/$VOLUME_GROUP/$LOGICAL_VOLUME
4. Re-scan the SR.
Finally, re-scan the SR to detect the newly available space:
xe sr-scan uuid=<SR_UUID>