Skip to content
Calcrivo

Filesystem Resize Calculator

Calculate new usable capacity after growing or shrinking a filesystem or partition.

Inputs

Positive to grow, negative to shrink

New Filesystem Size (GB)

150.00

Feasibility Note

Growth can be performed online (filesystem mounted and in use).

Can Grow Online

true

Shrink Supported

true

LVM Extents Changed

N/A

Suggested Command Pattern

resize2fs /dev/xxx (or xfs_growfs for XFS, after growing the block device)

Step by step

  1. Values used

    Current Filesystem Size (GB) = 100; Change Amount (GB) = 50; Filesystem Type = ext4; Currently Used Space (GB) = 60

  2. New size

    new_size = current_size + delta (delta negative for shrink)

  3. New Filesystem Size (GB)

    = 150.00

  4. Feasibility Note

    = Growth can be performed online (filesystem mounted and in use).

  5. Can Grow Online

    = Yes

  6. Shrink Supported

    = Yes

  7. LVM Extents Changed

    = N/A

  8. Suggested Command Pattern

    = resize2fs /dev/xxx (or xfs_growfs for XFS, after growing the block device)

How it works

Growing a filesystem is almost always safe and often possible online (ext4, XFS and Btrfs all support online growth once the underlying block device has more space). Shrinking is riskier: XFS cannot shrink at all — only ext4 and Btrfs (and, at the block-device level, LVM) support it, and it must never take the filesystem below its currently used space. For LVM-backed filesystems, remember the correct order matters: grow the LV before growing the filesystem, but shrink the filesystem before shrinking the LV, or you risk truncating live data.

Formula

New size

new_size = current_size + delta (delta negative for shrink)

S_cur
current filesystem size
\Delta
requested change (signed)

Frequently Asked Questions

Why can't XFS filesystems be shrunk?

XFS's on-disk allocation group layout is fixed at creation time and doesn't support relocating data to free space at the end of the device, which shrinking requires. The only reliable path to a smaller XFS filesystem is backup, reformat at the new size, and restore.

What order should I resize an LVM logical volume in?

When growing: extend the LV first (lvextend), then grow the filesystem (resize2fs/xfs_growfs) to fill it. When shrinking: shrink the filesystem first to a size at or below the target, then shrink the LV (lvreduce) — doing it in the wrong order on a shrink can truncate live data.

Do I need to unmount the filesystem to resize it?

Growing ext4, XFS and Btrfs can all be done online (mounted). Shrinking ext4 requires unmounting; Btrfs can shrink online in most cases; XFS cannot shrink under any circumstance.

You might also need