How can I resize logical volume to fit filesystem automagically?
To increase the size of a filesystem you must first grow the logical volume container and then increase the size of the filesystem within. When decreasing the size of a filesystem, shrinking the surrounding logical volume is done last.
A shorthand way of expanding a logical volume and the filesystem is contains can be achieved using
This increases the logical volume size to a total of 1600 extents and then grows the filesystem associated with it. There is no need to unmount the filesystem to perform this operation.
In order to shrink the size of a filesystem, you must first unmount it and
JRFerguson provided a great answer. I think the OP was looking for something like this:
It's convenient to be able to refer to the available space in relative terms than calculating the number of blocks by hand. For more information, you can check out the man page for lvextend or any of the other lvm2 commands.