Difference between revisions of "Shrink ext4 volume"

From DWIKI
m
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
=Check minimum size=
=Check minimum size=
  resize2fs -P /dev/mapper/foo
  resize2fs -P /dev/mapper/foo
gives you minimum size in blocks
gives you minimum size in 4k blocks


=Shrink filesystem=
=Shrink filesystem=
Line 10: Line 10:


=Shrink volume=
=Shrink volume=
  lresize -L 500T /dev/mapper/foo
  lvresize -L 500T /dev/mapper/foo

Latest revision as of 09:24, 24 August 2022

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 volume

lvresize -L 500T /dev/mapper/foo