Resizing LVM¶
Grow lv¶
See also ./crytpsetup.md for growing encrypted LVM partions
Grow physical volume (eventually):
Then grow logical volume:
or extend with max available free space on vg:
If the automatic filesystem resize with --resize didn't work:
grow lv to max¶
Shrink PV¶
Example: Disk was cloned to slightly smaller disk:
WARNING: Device /dev/mapper/dapple has size of 468356272 sectors which is smaller than corresponding PV size of 487890944 sectors. Was device resized?
Show where segments were allocated:
Swap partition was at end of disk so we remove it before shrinking:
Now shrink to much less than actual disk size:
And then grow to max:
Shrink logical volume¶
- Online shrinking is not supported
- Offline shrinking with live CD
Boot from live cd, then:
Use --resizefs support in lvreduce¶
First check the file system:
Then reduce the lv including the file system in one command: