Shrinking a LVM root partition

  1. Boot from a helper system and get a root shell (I used the rescue mode of the Debian installer)
  2. Check the filesystem of the partition to resize:
    e2fsck -f /dev/vg_foo/lv_bar
  3. Resize the filesystem (make it a bit smaller than the target size, to have a safety margin when resizing the logical volume):
    resize2fs /dev/vg_foo/lv_bar 180G
  4. Reduce size of the logical volume:
    lvreduce -L 190G /dev/vg_foo/lv_bar
  5. Grow the filesystem to the new size of the logical volume:
    resize2fs /dev/vg_foo/lv_bar
  6. For good measure run another filesystem check:
    e2fsck -f /dev/vg_foo/lv_bar

blog comments powered by Disqus