1

I need to shrink a Logical Volume, and some of the articles on the Internet were saying that there are three ways of achieving this:

1) the simplest route - use the same size for file system and logical volume group

2) shrink the file system, check the numbers with vgdisplay and shring the LV based on this number with the option of --extent

3) set file system to 90% of the size of the LV that you want to have. So this could be 45G for file size part and create the LV of 50G after that. The last step here would be to "grow the file system so that it uses all available space on the logical volume". The article that was saying that was like 6-7 years old, so I am not sure. I read another article that was suggesting the same method, but people in the comments were not sure about it, and were thinking that this may be wrong (a mistake; they were thinking about the same numbers).

I am using Centos 7 and ext4. What is the best way of going about that now?

Thanks.

1

If by "best" you mean least math, you can let lvm deal with the fs.

lvreduce --resizefs --size -2G /dev/vg/lv

Where --size if it has the - in front is the amount to reduce, absolute size if no negative sign.

Reduce does require unmount, but this integration with fsadm can do that for you.

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.