5

I want to shrink a Linux LVM partition from 200GB to 150GB. A test is carried out with the following steps:

  • Shrink a file system in a logical volume with reszie2fs
  • Shrink the logical volume with lvreduce
  • Delete the 200GB LVM partition with fdisk
  • Recreate the same LVM partition, but with size a reduced of 150GB

I am able to access a test file using the above method. But, vgdisplay and vgs both reported the old size of 200GB. I think I might have missed out a vgreduce step after shrinking the logical volume. But, from the man page, it seems to say that vgreduce can only be performed on an empty physical volume. In my situation above, the whole volume group resides in one physical volume.

What is the correct way to shrink this LVM partition?

8

1 Answer 1

5

I'm not sure if you're just trying to learn using these tools or are trying to get something done, in either case I think I'd encourage you to use gparted instead of doing it using the straight commands in this manner.

Use GParted to resize the LVM physical volume. GParted won't let you shrink the LVM physical volume to a size smaller than what the unallocated space allows.

References

5
  • Gparted doesn't support LVM2 as stated here and on my personal experience. It even doesn't show used space on LVM partition properly.
    – Suncatcher
    Commented May 10, 2018 at 15:56
  • according to this Gparted does support most operations on LVM2: gparted.org/features.php
    – Gaia
    Commented May 13, 2018 at 19:06
  • Yeah I'm not sure why that comment was left. LVM 1/2 is supported.
    – slm
    Commented May 13, 2018 at 19:20
  • "9.5. Using the LVM utility system-config-lvm" link is down.
    – Scorpion
    Commented May 24, 2022 at 19:02
  • @Scorpion - ty fixed
    – slm
    Commented May 25, 2022 at 10:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .