Instructions for resizing root directory on Linux OS(Ubuntu as an example)

This post works as a memo to show how to resize any directory on Linux when facing “short on storage” problem.

Tool: GParted, GNOME Partition Editor (https://gparted.org/index.php)

GParted is a general tool to create, move, resize any partition on Unix-like system. It can be installed and directly open on Linux. But since we need to resize root directory, it is not possible to do it when the system is booted. In other words, we need to do it outside of Linux system itself.

And that’s why we need GParted Live, which can be installed on USB and booted from there.

Instructions:

  1. Download newest GParted Live on its website.
  2. Follow the manual to setup GParted Live on any USB drive.
  3. Reboot and in your bios options, select “boot from usb”(or anything similar, it depends on which system and hardware you use)
  4. If above procedures works, you will now see the “GParted Live” menu, select the first option, which is “GParted Live (Default Settings)”. It will ask you select some of your preference, and then you will start GParted. Now you can do your jobs and resize any partition!

Additional Notes:

  1. If you are a HP user, you may face problems when you try to “boot from usb”. If that is the case, see this reference link. It is because new version of PC uses Secure Boot, which in some reason forbid your request to boot the GParted Live. So, in your boot options, disable Secure Boot by enabling Legacy Boot, and things will work smoothly.