One day, you power up your computer, wait for Linux to boot, log in... and this message pops up:
You might decide to ignore it, or you might think this is an issue worth looking into. And you’d be right!
However, clicking "Examine" doesn't really tell you how to fix the issue. It "just" shows you the disk usage analysis of the /boot
partition:
This might look a little cryptic if you're not familiar with Linux internals...
This article breaks down what this message means and how to clean up the partition safely.
What is /root
?
The /boot
directory is a special partition that contains the files needed to start the operating system. It typically resides on its own partition.
When you click "Examine" the Disk Analyzer tool displays files from this partition:
-
grub
: the directory with the files for the GRUB bootloader, the first program that runs when you power on your computer. -
initrd.img-*
: the initial RAM disk, a small temporary filesystem loaded into memory before the actual filesystem can be mounted. -
vmlinuz-*
: the compressed Linux kernel, which is the core of the operating system. -
System.map-*
: a symbol table that maps kernel functions to memory addresses (mostly useful for debugging). -
config-*
: the kernel configuration file used to build each kernel.
Each kernel version comes with its own set of these files. That’s why you might see several groups with version numbers: 6.12.27, 6.12.22, 6.10.11, etc. The latest one is probably the kernel currently in use, while the others were left behind after system updates.
Over time, these accumulate and can fill up the partition. This is exactly what the message is telling us: the partition /boot
is almost full.
You probably got it: the files in this partition are critical for the system, and it's important to have space available for new kernel updates, as they often include security fixes.
In the next section, we’ll identify which files are still needed, and which ones can be safely removed.
How Resolve The Issue?
1: Expand The Partition
If a partition is almost full, one possible solution is increase its size. I've written a comprehensive guide on resizing partitions on Linux.
However, I don't believe it's a good solution here. New kernel are regularly installed, so you'll likely run out of space again. Furthermore, old kernel are generally no longer needed and can be removed.
2: Use Synaptic Package Manager
The easiest solution is to manually select and remove old kernel packages using Synaptic Package Manager.
Open it with root privileges, click the "Search" button, and search for "linux-image":
Sort the packages by installed version in descending order (the latest versions will appear at the top of the list):
It's wise to keep 2 or 3 kernels, just in case a newer kernel causes issues. Yes, a new kernel can break something on your computer. For example, read this story where I describe how my Wi-Fi stop working after an update from 6.10.11 to 6.11.10 and how I installed a new driver manually to restore connectivity.
Select the old kernels, right-click on them, and select "Mark for complete removal":
Here, I decided to keep 6.10.11 (where my Wi-Fi was still working out-of-the-box) and the 2 latest versions.
Finally, click on the apply button to remove them.
3: Use The Command Line
If you prefer command lines over GUIs, you can manually search for and remove the packages manually from a terminal.
First, list the installed packages:
$ apt list --installed | grep linux-image
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
linux-image-6.10.11+bpo-amd64/now 6.10.11-1~bpo12+1 amd64 [installed,local]
linux-image-6.12.22+bpo-amd64/stable-backports,now 6.12.22-1~bpo12+1 amd64 [installed,automatic]
linux-image-6.12.27+bpo-amd64/stable-backports,now 6.12.27-1~bpo12+1 amd64 [installed,automatic]
linux-image-amd64/stable-backports,now 6.12.27-1~bpo12+1 amd64 [installed]
I'm running this command on my computer after removing old kernels with Synaptic Package Manager, and we can see that 6.10.5 and 6.5.0 are no longer present.
Second, delete the packages you want with sudo apt remove linux-image-<version>
.
4: The Automatic Way
Another solution is to run sudo apt autoremove --purge
from a terminal.
This command removes unused packages, typically dependencies that were automatically installed and are now unused. The --purge
flag goes one step further by removing their configuration files as well.
However, this approach is somewhat indirect: you’re not specifically targeting old kernels, you just hope that the package manager considers them as unused and will remove them automatically. In my case, it wasn't enough: the free space went from 11 to 19 MB, and the message reappeared at the next boot.
If I run the command now on my computer, here's what I get:
% sudo apt autoremove --purge
[sudo] password for pierre:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
linux-headers-6.10.6+bpo-common* linux-kbuild-6.10.6+bpo*
0 upgraded, 0 newly installed, 2 to remove and 11 not upgraded.
After this operation, 63.6 MB disk space will be freed.
Do you want to continue? [Y/n]
Note that no linux-image
packages are selected for removal, not even 6.10.11 which is relatively old (it was released in September 2024, and I'm writing these lines in June 2025).
Still, it's a good idea to run this command after using one of the previous solutions, to be sure to clean up any leftover packages related to an uninstalled kernel (like this linux-headers-6.10.6+bpo-common
here).
Conclusion
After cleanup, we can check the results with the Disk Usage Analyzer:
Initially, 430 MB were used. Now, it's down to 273 MB. The df
command shows the percentage of free space:
$ df -h /boot
Filesystem Size Used Avail Use% Mounted on
/dev/nvme0n1p2 456M 260M 171M 61% /boot
Problem solved! Until /boot
is full again 😉
Great news! a limited-time token giveaway now live for Dev.to contributors as a thank-you for your contributions! Claim your rewards here (for verified Dev.to users only). – Dev.to Community Support