How to to resize an ext4 partition from the command line?

If you're going to be increasing the size of both the partition and the filesystem, then first run fdisk to increase the size of the partition, and then run resize2fs to increase the size of the filesystem.

If you're going to be shrinking the size of both, run resize2fs first and then run fdisk.


You can use fdisk to change your partition table while running.Refer this link http://codesilence.wordpress.com/2013/03/14/live-resizing-of-an-ext4-filesytem-on-linux/


gparted uses resize2fs to change the partition's size. It doesn't take many arguments. Below are the ones I've found useful.

-M shrinks to the file system's minimum size.

-p shows a percentage indicator.

-P prints the file system's minimum size and exits.