This is a known problem: /boot will run out of space after some time, due to obsolete kernel images. It will only become evident when /boot is on a separate filesystem, as it is the case for encrypted systems.
Can anyone confirm whether this has (finally!!) been fixed in 14.04? If so, ignore the rest of this post.
Otherwise. Please let us find a solution for this ridiculous design error.
The general recommendation is to run a chain as follows:
1.) dpkg --get-selections to get all installed packages 2.) grep out kernel images 3.) remove the current kernel from the list, based on uname -r 4.) run apt-get remove on the remaining ones
This may be OK if run semi-automatically. But I need it to run completely unattended, alongside completely unattended system upgrades. (Because I'm preparing a system for a non-tech person who has better things to do than to care about old kernel images.)
In combination with an unattended system upgrade, the following could happen (I imagine):
1.) let the current kernel be version N 2.) a new kernel is installed, say version M 3.) the above procedure is run, but uname -r still gives version N, so version M is removed again 4.) FAIL
One idea of mine was to sort the list of kernels lexicographically and then remove all but the, say, last 2 in the list. (And also remove the one given by uname -r from the list.) This way the latest kernels would never be removed. That is, IF lexicographical ordering puts the latest kernel last. Which, by looking at past package names, appears probably not to be the case. m(
So the next idea is to write a more sophisticated kernel version parser.
Any ideas? Has anyone already implemented a working solution?
Thank you!