0

I'm trying to resize a couple of my LVM partitions. I have one that is 850GB (/dev/mapper/cl-home) and one that is 50GB (/dev/mapper/cl-root). I'd like to make it so that cl-home is 750GB and cl-root is 150GB. I resized the partitions so that if I use system-config-lvm and look at the size cl-home appears as 750GB and cl-root is 150GB. However, if I do a df -h, both cl-home and cl-root appear as their old sizes (850GB and 50GB respectively). How do I make it so that I am able to see and use the resized partitions?

Thanks!

1 Answers1

1

NB: As Zoredache points out in the comment, when you are shrinking things, you must first resize the filesystem, then the underlying block devices, otherwise you will likely lose data.

In general, resizing a block device does not resize any filesystem that may be resident on your block device. So, if you used lvresize to resize a logical volume, you would then need to use the resize2fs command (for ext[34] filesystems) to resize the filesystem. The -r flag to lvresize will do this for you.

If you have actually resized a partition, which would correspond to an LVM "physical volume" (or "PV"), you would need to:

  • pvresize the physical volume to expose the additional space to your volume group, and then
  • lvresize the logical volume, and finally
  • resize the filesystem (which maybe you did in the previous step with -r)
larsks
  • 4,493