Score:2

How to get more space on /boot? (extra kernels have been removed)

ke flag

i'm on ubuntu 21.04 trying to update to 21.10, and getting the usual error

The upgrade has aborted. The upgrade needs a total of 287 M free space on disk '/boot'. Please free at least an additional 31,6 M of disk space on '/boot'. You can remove old kernels using 'sudo apt autoremove' and you could also set COMPRESS=xz in /etc/initramfs-tools/initramfs.conf to reduce the size of your initramfs.

i usually fix this error by following obvious instructions like those here, but not this time:

$ ls /boot
config-5.11.0-22-generic      lost+found                    vmlinuz
config-5.11.0-25-generic      memtest86+.bin                vmlinuz-5.11.0-22-generic
grub                          memtest86+.elf                vmlinuz-5.11.0-25-generic
initrd.img                    memtest86+_multiboot.bin      vmlinuz.old
initrd.img-5.11.0-22-generic  System.map-5.11.0-22-generic
initrd.img.old                System.map-5.11.0-25-generic
$ dpkg -l linux-image-\* | grep ^ii
ii  linux-image-5.11.0-22-generic          5.11.0-22.23 amd64        Signed kernel image generic
ii  linux-image-5.11.0-25-generic          5.11.0-25.27 amd64        Signed kernel image generic

it doesn't look like i have too many kernels. (5.11.0-22 is what i'm running, i think 5.11.0.25 is what i'm upgrading to?) i'm guessing there may be some issue with LVM and having an encrypted LUKS partition?

James S. avatar
de flag
Do you actually have that much space on the partition? what does ` df -h ` tell you?
hu flag
The message you've quoted is very imformative, so do what it says. There are two kernels, which is one more then needed. 21.10 has kernel 5.13.
llywrch avatar
eg flag
Also have a look at the contents of /boot/grub. If /boot is mounted on a large enough partition, there might be unneeded files hiding in a subdirectory.
ludant avatar
ke flag
` df -h ` gives ` /dev/sda2 447M 169M 244M 41% /boot `, so total disk space is 447M. i guess i'll delete the extra kernel and resize my partition after i've done a backup. thank you!
cc flag
Be careful, it looks like you don't have a complete 5.11.0-25 install, the initrd is missing. Look at the /etc/initramfs-tools/initramfs.conf file and ensure the COMPRESS is set to something to reduce the initrd images from 150M to 50M.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.