Pcornel
Linux · LVM

Resize Filesystem

Cheat sheet · https://pcornel.dk/topic.php?topic=2765

Back to the Topic

Answer

Resizing a filesystem changes its size to match its block device after the device (partition or LV) changed: resize2fs for ext4, xfs_growfs for XFS, btrfs filesystem resize for Btrfs.

Remember

Order: grow the device first, then the filesystem; shrink the filesystem first, then the device. lvextend -r and growpart + resize do this in the right order.

First checks

  • pvs — physical volumes
  • vgs — volume groups and free space
  • lvs -a -o +devices — logical volumes and their devices
  • lsblk — stack view

Verify in this order

device grown → filesystem grown to fill it (or shrunk before the device)

Where it usually breaks

First mismatch in hardware/block device → kernel driver/mapper/RAID/LVM → filesystem → mount namespace/options → path permissions/MAC → consumer I/O; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2765

Confirmation

Confirm action

Continue?