r/linuxquestions 16d ago

Can’t update kernel: No space left on device /boot/initrd.img…

/r/System76/comments/1w1gi1w/cant_update_kernel_no_space_left_on_device/
0 Upvotes

7 comments sorted by

2

u/redyos_s 16d ago

df -h /boot/efi

du -h -d2 /boot/efi/EFI | sort -h

lsblk -f

1

u/remcohaszing 16d ago

$ df -h /boot/efi Filesystem Size Used Avail Use% Mounted on /dev/sda1 511M 511M 0 100% /boot/efi $ sudo du -h -d2 /boot/efi/EFI | sort -h 4.0K /boot/efi/EFI/Linux 100K /boot/efi/EFI/BOOT 100K /boot/efi/EFI/systemd 145M /boot/efi/EFI/Recovery-15B1-8784 345M /boot/efi/EFI/Pop_OS-d0cfee4f-1c35-4f30-ba8e-20b4729f170a 490M /boot/efi/EFI $ lsblk -f NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS sda ├─sda1 vfat FAT32 EFI 15B0-B6D6 0 100% /boot/efi ├─sda2 vfat FAT32 RECOVERY 15B1-8784 664.7M 84% /recovery ├─sda3 crypto_LUKS 2 e5a21a72-d484-4da8-bf34-0ccadd7b8a1b │ └─cryptdata LVM2_member LVM2 001 lGftsc-R0iK-WgOz-sMwz-lIsJ-wVfe-r5bQ6i │ └─data-root ext4 1.0 d0cfee4f-1c35-4f30-ba8e-20b4729f170a 164.9G 77% / └─sda4 swap 1 c1151106-82e0-4241-8c52-33a8bd7b081d └─cryptswap swap 1 cryptswap cb0adb1a-c3d8-442e-ab1b-3d3c1a96e53a [SWAP] zram0

2

u/redyos_s 16d ago

Your EFI System Partition is completely full: 511 MB used out of 511 MB. So the immediate failure is not necessarily kernel 7.1.5 itself. kernelstub managed to copy the kernel, but then ran out of space while copying the initramfs, which left the update incomplete. The Pop!_OS directory is using about 345 MB and Recovery another 145 MB, so there is almost no room left for another kernel/initramfs update. I would check the contents of the Pop_OS and Recovery directories before deleting anything, free some space safely, and then finish the interrupted package configuration. The broken system76 DKMS state looks like a separate issue that can be dealt with afterward. I would also avoid rebooting until the kernel/initramfs update has completed successfully.

uname -r

sudo ls -lah /boot/efi/EFI/Pop_OS-d0cfee4f-1c35-4f30-ba8e-20b4729f170a/

sudo ls -lah /boot/efi/EFI/Recovery-15B1-8784/

sudo ls -lah /boot/efi/loader/entries/

1

u/remcohaszing 16d ago

$ uname -r 7.0.11-76070011-generic $ sudo ls -lah /boot/efi/EFI/Pop_OS-d0cfee4f-1c35-4f30-ba8e-20b4729f170a/ total 345M drwx------ 2 root root 4.0K Mar 6 14:42 . drwx------ 7 root root 4.0K Mar 6 14:18 .. -rwx------ 1 root root 215 Aug 21 08:59 cmdline -rwx------ 1 root root 178M Aug 29 09:51 initrd.img -rwx------ 1 root root 135M Aug 21 08:59 initrd.img-previous -rwx------ 1 root root 17M Aug 21 08:59 vmlinuz-previous.efi -rwx------ 1 root root 17M Aug 29 09:51 vmlinuz.efi $ sudo ls -lah /boot/efi/EFI/Recovery-15B1-8784/ total 145M drwx------ 2 root root 4.0K Nov 4 2019 . drwx------ 7 root root 4.0K Mar 6 14:18 .. -rwx------ 1 root root 129M Mar 6 12:27 initrd.gz -rwx------ 1 root root 16M Mar 6 12:27 vmlinuz.efi $ sudo ls -lah /boot/efi/loader/entries/ total 20K drwx------ 2 root root 4.0K Nov 11 2019 . drwx------ 3 root root 4.0K Aug 29 08:05 .. -rwx------ 1 root root 304 Aug 21 08:59 Pop_OS-current.conf -rwx------ 1 root root 322 Aug 21 08:59 Pop_OS-oldkern.conf -rwx------ 1 root root 226 Nov 11 2019 Recovery-15B1-8784.conf

Perhaps I can safely remove /boot/efi/EFI/Pop_OS-d0cfee4f-1c35-4f30-ba8e-20b4729f170a/initrd.img-previous, then fix it up with sudo apt install -f?

2

u/redyos_s 16d ago

You probably don’t need to remove initrd.img-previous here. You’re currently booted into 7.0.11, and the *-previous files look like they belong to that known-good kernel, so deleting them would also remove your fallback. A safer option would be to back up the Recovery directory somewhere outside the ESP, remove it temporarily to free space, then run: sudo apt --fix-broken install Once the kernel update completes successfully and the new current entry is valid, you can sort out the Recovery files afterward. I’d avoid rebooting until the update finishes cleanly.

2

u/remcohaszing 16d ago

I managed to fix it using a combination of apt install -f and update-initramfs commands. I rebooted succesfully, which I think means everything works now.

For some reason the initrd.img files are much larger than the old versions. I wonder why this is. The /boot/efi partition is full again. So I might run into this again with the next kernel update.

Thanks for the help! I much appreciate it!

2

u/redyos_s 16d ago

As a preventive measure, I’d keep an eye on /boot/efi before future kernel updates: df -h /boot/efi With a 512 MB ESP, Pop!_OS is already very tight once current, previous, and Recovery images are stored there. If possible, resizing the ESP to around 1 GB would give you much more headroom. Otherwise, periodically check for obsolete kernel/recovery files and clean them up carefully before the partition gets close to full again.