TIL: How to Extend a Logical Volume on Ubuntu
- Identify the LVM setup
lsblkshows logical volumes (e.g.,lv_varmapped to/var).lvdisplayverifies details, like LV Path/dev/VolGroup00/lv_var.
- Resize the Physical Volume
- Use
sudo pvresize /dev/xvdf(or the relevant device name) to claim the extra disk space.
- Use
- Extend and Grow in One Step
- For XFS (and many other filesystems),
lvextend -r -L +100G /dev/VolGroup00/lv_varautomatically resizes both the LV and the filesystem.
- For XFS (and many other filesystems),
- Finding the Device Name
cat /proc/partitionslists partitions and sizes (e.g.,/dev/nvme1n1might be your new disk topvresize).
Also available at the Wordpress link
Thanks Nagendra Sahni for teaching me this technique on a deadline and reviewing the draft.