Ubuntu Boot Loop Problem: Fix Full Disk with 0 Bytes Space Left
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 (
/home
) - 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:
- Plug in your PC / Laptop and start the system.
- Press
ESC
orShift
one time directly after the vendor logo to get into the GRUB menu (if it doesn't work, try it another time, it 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 autoremove
to free up more space or navigate withcd
and remove some files and folders withrm -rf FILE/FOLDERNAME
where you are sure that they are unimportant. - Check with
df -h
if 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.
References
- Header Image Penguin (Tux) by Larry Ewing (lewing@isc.tamu.edu) and the GIMP