Bump minimum /boot size in ubuntu-release-upgrader
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Won't Fix
|
Undecided
|
Unassigned | ||
dpkg (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
kernel-package (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
linux (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
linux-firmware (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
linux-kernel-headers (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
linux-restricted-modules (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
ubuntu-release-upgrader (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
System information:
ubuntu 23.04 x86_64
6.2.0-24-generic
Upgrading the system:
$ sudo dpkg --configure -a
Setting up linux-firmware (20230323.
update-initramfs: Generating /boot/initrd.
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/
I: Set the RESUME variable to override this.
zstd: error 70 : Write error : cannot write block : No space left on device
E: mkinitramfs failure zstd -q -1 -T0 70
Check space left (none):
$ df -h /boot
Filesystem Size Used Avail Use% Mounted on
/dev/sdb2 707M 693M 0 100% /boot
What is required is to remove older kernels (and purge them most likely). List all the installed kernels except the current one:
$ dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*
linux-headers-
linux-headers-
linux-headers-
linux-headers-
linux-image-
linux-libc-
linux-libc-dev:i386
linux-modules-
linux-modules-
linux-modules-
linux-modules-
Is not possible to uninstall any kernel because fails:
$ sudo apt purge linux-headers-
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
Reconfigure fails again so some kernel have to be manually removed to free up space:
$ sudo rm /boot/initrd.
$ sudo rm -rf /boot/initrd.
Now you can reconfigure:
$
Remove kernels:
$ sudo apt purge linux-headers-
Reboot:
$ sudo reboot
Upgrade as usual:
$ sudo apt update && sudo apt upgrade
Before upgrading new kernels I need to check for free space and remove older kernels manually. Fix this so there's only one kernel left.
tags: | added: 23.04 |
tags: | added: linux-headers linux-image linux-modules |
tags: | added: apt dpkg |
summary: |
- APT installs 3 kernels at once so /boot runs out of free space left and - partition size does not increase alongside with newer ubuntu versions + Bump minimum /boot size in ubuntu-release-upgrader |
tags: |
added: foundations-todo removed: rls-ll-incoming |
We generally don't know how much space is going to be needed. APT only keeps 2 kernel versions around, and the /boot partition is sized accordingly for 3.
If you override this by marking kernels as manually installed, or manually installing other versions you need to ensure that there is enough space for those.
I only see two kernels installed though, so it's not clear to me how you could be running out of space in /boot in the first place.
Are there additional files in there? The kernels shouldn't fill that up.