3

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
3

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

3
  • 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 May 10 '18 at 15:56
  • according to this Gparted does support most operations on LVM2: gparted.org/features.php – Gaia May 13 '18 at 19:06
  • Yeah I'm not sure why that comment was left. LVM 1/2 is supported. – slm May 13 '18 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.