Recently, I stopped a virtual machine (VM) running on an Ubuntu host system which has led to entirely filling my root partition with 0 bytes left because I stored the volume on it without considering the remaining space. There are many more reasons that can cause the partition to be full. All in all, they result in a system that doesn't boot anymore and hangs in an infinity loop during the start process. I will show you how to fix it.
Partitioning in Linux / Ubuntu
When working with Linux, in my case Ubuntu, the system uses the classical file partitioning:
- A root partition for the system (
- A home partition for user data (
- Maybe a swap partition
- Maybe some other custom partitions
If the root partition is entirely full, the system can't start anymore which is very logical but still a big problem. To fix it, we need to delete some trash to get it back working.
How to free up Space on root Partition
The solution is very simple: We start the system in recovery mode, delete some files and that's it! Just follow this step-by-step guide:
- Plugin in your PC / Laptop and start the system.
Shiftone time directly after the vendor logo to get into the GRUB menu (if it doesn't work, try it another time, this is sometimes hard to find the correct moment).
- In the GRUB menu, select the advanced options and run the recovery mode.
- Select the life-saving option clean ("Try to make free space").
- To be sure, select the root option to run a shell.
- In the command prompt, use some well-known commands like
apt autoremoveto free up more space or navigate with
cdand remove some files and folders with
rm -rf FILE/FOLDERNAMEwhere you are sure that they are unimportant.
- Check with
df -hif there is enough space, reboot your system (
reboot) and the problem should be solved.
For more tips and tricks to free up space on the root partition, have a look at this great answer in the StackExchange AskUbuntu forum for additional commands like removing outdated kernels or core dumps.
- Header Image Penguin (Tux) by Larry Ewing (firstname.lastname@example.org) and the GIMP