Shrink ext4 partition

Shrink ext4 partition

The common scenario with file systems and partitions is to increase the size of the partition. What about when you need to decrease the size? In this short tutorial I will demonstrate how to make the partition smaller and the file system as well.

Shrink ext4 partition

We want a 10G partition therefore we need to resize the file system to a smaller size to something like 9G.

e2fsck -f /dev/sda2
resize2fs /dev/sda2 9G

Using cfdisk

Delete the partition and create a new one with 10 G size.

cfdisk /dev/sda

Using resize2fs

Run resize2fs without size parameter

resize2fs /dev/sda2