Practical steps to grow or shrink ext2/3/4 filesystems using the resize2fs tool. 25.04.2026 | reading time: 2 min Need to change the size of an ext4 filesystem without guesswork? The command `resize2fs` resizes ext2, ext3 and ext4 filesystems; use it to expand a filesystem after you enlarge the underlying block device or to shrink it carefully after a filesystem check. A real resize session Show, do not just read: grow a logical volume and expand the filesystem online with one command, for example: ```sudo lvextend -L +10G /dev/vg0/data; sudo resize2fs /dev/vg0/data``` and then verify with `df -h /data`; to shrink, work offline with checks and ordered steps like: ```sudo umount /data; sudo e2fsck -f /dev/vg0/data; sudo resize2fs /dev/vg0/data 20G; sudo lvreduce -L 20G /dev/vg0/data; sudo mount /data``` which forces a safe shrink by checking data first and only then reducing the block device. Flags that matter Remember a few parameters: `-p` shows progress, `-f` forces operations, `-M` shrinks to the minimum, and `-P` prints the minimum size; growing an ext4 filesystem can be done online if the kernel and filesystem support it, but shrinking requires an unmounted filesystem and a prior `e2fsck` to avoid corruption. Better together resize2fs rarely works alone: pair it with `e2fsck` for safety, with LVM tools when resizing logical volumes, and with partition tools like `parted` or `growpart` when you change partition sizes; sometimes `lvresize -r` automates both steps, but manual `resize2fs` gives full control and transparency. Next challenges Mastering `resize2fs` means mastering storage workflows: practice in a lab, learn how filesystems react to device changes, and then level up toward certifications; consider CompTIA Linux+ or LPIC-1 and intensive exam preparation at bitsandbytes.academy to turn these skills into credentials. Join Bits & Bytes Academy First class LINUX exam preparation. filesystem storage utilities troubleshooting infrastructure