Shrink ext4 volume

From DWIKI
Revision as of 12:27, 2 May 2024 by Tony (talk | contribs) (→‎Shrink volume)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Run fsck

e2fsck -f /dev/mapper/foo

Check minimum size

resize2fs -P /dev/mapper/foo

gives you minimum size in 4k blocks

Shrink filesystem

resize2fs -p /dev/mapper/foo 500G

Shrink logical volume

lvresize -L 500T /dev/mapper/foo