How to shrink an ext4 partition without formatting it?

AbdulMomen عبدالمؤمن picture AbdulMomen عبدالمؤمن · Oct 15, 2013 · Viewed 16.9k times · Source

Recently i installed Ubuntu 13.04 and allocated 20 GB for it. The system got installed space less than 10 GB. Now, can i shrink it to 10 GB without formatting it? Thats to say, i don't want to have large empty space in the partition.

Answer

Basile Starynkevitch picture Basile Starynkevitch · Oct 15, 2013

You could use the resize2fs command.

However, I would suggest to backup the most important files (on e.g. an USB key) before doing that (e.g. /etc/ and some of /home/ )

See also this question...

BTW, 20GB for the system partition is not that much.....