cheat.sheets:resize2fs
# resize2fs
# ext2/ext3/ext4 file system resize tool
# resize filesystem up to the block device size
# make e2fsck /dev/xvdb1 before
# filesystem must be not mounted for ext2
resize2fs /dev/xvdb1
# shrink filesystem (20G is new size)
resize2fs /dev/xvdb1 20G
tldr:resize2fs
# resize2fs
# Resize an ext2, ext3 or ext4 filesystem.
# Does not resize the underlying partition. The filesystem may have to be unmounted first, read the man page for more details.
# More information: <https://manned.org/resize2fs>.
# Automatically resize a filesystem:
resize2fs /dev/sdXN
# Resize the filesystem to a size of 40G, displaying a progress bar:
resize2fs -p /dev/sdXN 40G
# Shrink the filesystem to its minimum possible size:
resize2fs -M /dev/sdXN
$
cheat.sh