Resize thin provisioned (EXT) SR after increasing LUN size
This procedure applies to extending LVM volumes on EXT thin provisioned SRs only.
Environment
- An XCP-ng host with an EXT (thin provisioned) SR whose underlying LUN size has been increased.
- Commands are run in the host console.
Procedure
Review the 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. Resize the physical volume
Based on the output of pvs, determine the target physical volume, then resize it:
# pvresize /dev/$DEVICE_FILE
Verify the resize by re-running the pvs command. The updated size should now be reflected.
2. Extend 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_VOLUME
Extend 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>
Verification
After the re-scan, pvs reflects the updated physical volume size and the SR shows the newly available space.