The boot partition filled up and updates now fail — what is safe to delete?
Package updates on a small server started failing with no space left on the boot partition. It is a separate, fairly small partition, and it has filled with what look like several kernel versions.
I am reluctant to delete anything there by hand, since it is the partition the machine starts from and I would rather not learn what happens if I remove the wrong file.
What is safe to remove, and how do I stop it happening again?
@sysadmin_sinem · 6d ago
Your caution is right, and the safe route is to let the package manager remove old kernels rather than deleting files.
First, find out which kernel you are actually running:
Never remove that one, and keep at least one other as a fallback. Everything older than those two is a candidate.
Then use the package manager's own cleanup, which knows what belongs to what and updates the bootloader afterwards. On Debian-family systems that is the autoremove operation, which is aware of which kernels are still needed; on others there is an equivalent that keeps a configured number of versions.
The reason to avoid deleting by hand is not that the files are magic — it is that the bootloader configuration still references them afterwards. A machine that boots into a rescue prompt because the entry points at a kernel you deleted is a much worse afternoon than a full partition.
Reply
Report