How to extend an ext4 partition and filesystem?

You must begin with the partition unmounted. If you can’t unmount it (e.g. it’s your root partition or something else the system needs to run), use something like System Rescue CD instead.

  1. Run parted, or gparted if you prefer a GUI, and resize the partition to use the extra space. I prefer gparted as it gives you a nice graphical representation, very similar to the one you’ve drawn in your question.

  2. resize2fs /dev/whatever

  3. e2fsck /dev/whatever (just to find out whether you are on the safe side)

  4. Remount your partition.

While I’ve never seen this fail, do back up your data first!

Leave a Comment