EFI Out of Space

dstrobel

Active Member
Feb 23, 2020
4
0
41
50
Hello,

I have seen many threads about the EFI space problem, and I have been able to fix it in the past. However, I currently have it again on one of my hosts and can't seem to get it cleaned up. None of the other threads have helped this time.

I mounted my EFI partitions and cleaned out some space by removing the ancient 5.3 and 5.4 from EFI/proxmox. I then deleted one of the versions from the base directory to make some more space. then I get

/dev/sda2 523248 323512 199736 62% /mnt/efi
/dev/sdf2 523248 318140 205108 61% /mnt/efi2

So now I have some space (I have tried deleting more and gotten to 45% full and it does the same thing as below).

I then try to purge an old kernel (by the way it tells me the kernel is not installed - WTF?):

root@pve2:~# apt purge proxmox-kernel-6.17.13-1-pve
Package 'proxmox-kernel-6.17.13-1-pve' is not installed, so not removed
REMOVING:
proxmox-kernel-6.17.13-6-pve-signed proxmox-kernel-6.17.2-1-pve-signed

Summary:
Upgrading: 0, Installing: 0, Removing: 2, Not Upgrading: 0
9 not fully installed or removed.
Freed space: 1,980 MB

Continue? [Y/n]
(Reading database ... 118429 files and directories currently installed.)
Removing proxmox-kernel-6.17.13-6-pve-signed (6.17.13-6) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 6.17.13-6-pve /boot/vmlinuz-6.17.13-6-pve
update-initramfs: Deleting /boot/initrd.img-6.17.13-6-pve
run-parts: executing /etc/kernel/postrm.d/proxmox-auto-removal 6.17.13-6-pve /boot/vmlinuz-6.17.13-6-pve
run-parts: executing /etc/kernel/postrm.d/zz-proxmox-boot 6.17.13-6-pve /boot/vmlinuz-6.17.13-6-pve
Re-executing '/etc/kernel/postrm.d/zz-proxmox-boot' in new private mount namespace..
No /etc/kernel/cmdline found - falling back to /proc/cmdline
Copying and configuring kernels on /dev/disk/by-uuid/09F3-32DF
Copying kernel 6.17.13-1-pve
Copying kernel 6.17.13-8-pve
Copying kernel 7.0.0-3-pve
Copying kernel 7.0.2-3-pve
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-7.0.2-3-pve
Found initrd image: /boot/initrd.img-7.0.2-3-pve
Found linux image: /boot/vmlinuz-7.0.0-3-pve
Found initrd image: /boot/initrd.img-7.0.0-3-pve
Found linux image: /boot/vmlinuz-6.17.13-8-pve
Found initrd image: /boot/initrd.img-6.17.13-8-pve
Found linux image: /boot/vmlinuz-6.17.13-1-pve
Found initrd image: /boot/initrd.img-6.17.13-1-pve
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
Copying and configuring kernels on /dev/disk/by-uuid/09F3-A22E
Copying kernel 6.17.13-1-pve
Copying kernel 6.17.13-8-pve
Copying kernel 7.0.0-3-pve
Copying kernel 7.0.2-3-pve
cp: error writing '/var/tmp/espmounts/09F3-A22E/initrd.img-7.0.2-3-pve': No space left on device
run-parts: /etc/kernel/postrm.d/zz-proxmox-boot exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/proxmox-kernel-6.17.13-6-pve-signed.postrm line 15.
dpkg: error processing package proxmox-kernel-6.17.13-6-pve-signed (--remove):
installed proxmox-kernel-6.17.13-6-pve-signed package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
proxmox-kernel-6.17.13-6-pve-signed
Processing was halted because there were too many errors.
Error: Sub-process /usr/bin/dpkg returned an error code (1)


And the apt process fills my EFI partitions back up with the same damn kernels I just deleted before trying the purge.

root@pve2:~# ls -al /mnt/efi
total 415533
drwxr-xr-x 5 root root 4096 Dec 31 1969 .
drwxr-xr-x 5 root root 5 May 16 04:17 ..
drwxr-xr-x 5 root root 4096 Nov 6 2019 EFI
drwxr-xr-x 5 root root 4096 May 16 04:51 grub
-rwxr-xr-x 1 root root 88949017 Mar 7 22:14 initrd.img-6.17.13-1-pve
-rwxr-xr-x 1 root root 89334426 May 16 03:35 initrd.img-6.17.13-8-pve
-rwxr-xr-x 1 root root 91480874 May 16 03:34 initrd.img-7.0.0-3-pve
-rwxr-xr-x 1 root root 91456376 May 16 03:36 initrd.img-7.0.2-3-pve
drwxr-xr-x 3 root root 4096 Nov 6 2019 loader
-rwxr-xr-x 1 root root 15842088 Feb 10 08:06 vmlinuz-6.17.13-1-pve
-rwxr-xr-x 1 root root 15956776 May 14 17:48 vmlinuz-6.17.13-8-pve
-rwxr-xr-x 1 root root 16227432 Apr 21 17:56 vmlinuz-7.0.0-3-pve
-rwxr-xr-x 1 root root 16223336 May 14 11:28 vmlinuz-7.0.2-3-pve

For some reason this particular host has an extra kernel in the list:

root@pve2:~# proxmox-boot-tool kernel list
Manually selected kernels:
None.

Automatically selected kernels:
6.17.13-1-pve
6.17.13-8-pve
7.0.0-3-pve
7.0.2-3-pve

I can't seem to get rid of that 6.17.13-1-pve and it re-fills the EFI partitions every time I try.

Can I get rid of any of these kernels that are automatically selected without apt filling my EFI partitions?

Please Help!
 
No unfortunately it does the same thing with autoremove. I believe I tried that first before purging.

I can't complain too much. I've had this and one other host running non stop since 2019 :) this is at least the 3rd time I've had this problem and it's never been the same solution.
 
Just to get you some ideas to try:

Code:
root@pve1:~# apt autoremove
Summary:
  Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0
root@pve1:~# proxmox-boot-tool kernel list
Manually selected kernels:
None.

Automatically selected kernels:
6.17.13-8-pve
7.0.2-2-pve
7.0.2-3-pve
root@pve1:~# uname -a
Linux pve1 7.0.2-3-pve #1 SMP PREEMPT_DYNAMIC PMX 7.0.2-3 (2026-05-14T16:28Z) x86_64 GNU/Linux
root@pve1:~# dpkg -l proxmox-kernel-\*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                Version      Architecture Description
+++-===================================-============-============-==============================================
ii  proxmox-kernel-6.17                 6.17.13-8    amd64        Latest Proxmox Kernel Image
un  proxmox-kernel-6.17.13-2-pve        <none>       <none>       (no description available)
rc  proxmox-kernel-6.17.13-2-pve-signed 6.17.13-2    amd64        Proxmox Kernel Image (signed)
un  proxmox-kernel-6.17.13-4-pve        <none>       <none>       (no description available)
rc  proxmox-kernel-6.17.13-4-pve-signed 6.17.13-4    amd64        Proxmox Kernel Image (signed)
un  proxmox-kernel-6.17.13-6-pve        <none>       <none>       (no description available)
rc  proxmox-kernel-6.17.13-6-pve-signed 6.17.13-6    amd64        Proxmox Kernel Image (signed)
un  proxmox-kernel-6.17.13-7-pve        <none>       <none>       (no description available)
rc  proxmox-kernel-6.17.13-7-pve-signed 6.17.13-7    amd64        Proxmox Kernel Image (signed)
un  proxmox-kernel-6.17.13-8-pve        <none>       <none>       (no description available)
ii  proxmox-kernel-6.17.13-8-pve-signed 6.17.13-8    amd64        Proxmox Kernel Image (signed)
un  proxmox-kernel-6.17.4-2-pve         <none>       <none>       (no description available)
rc  proxmox-kernel-6.17.4-2-pve-signed  6.17.4-2     amd64        Proxmox Kernel Image (signed)
un  proxmox-kernel-6.17.9-1-pve         <none>       <none>       (no description available)
rc  proxmox-kernel-6.17.9-1-pve-signed  6.17.9-1     amd64        Proxmox Kernel Image (signed)
un  proxmox-kernel-6.8.12-1-pve         <none>       <none>       (no description available)
rc  proxmox-kernel-6.8.12-1-pve-signed  6.8.12-1     amd64        Proxmox Kernel Image (signed)
un  proxmox-kernel-6.8.12-10-pve        <none>       <none>       (no description available)
rc  proxmox-kernel-6.8.12-10-pve-signed 6.8.12-10    amd64        Proxmox Kernel Image (signed)
un  proxmox-kernel-6.8.12-9-pve         <none>       <none>       (no description available)
rc  proxmox-kernel-6.8.12-9-pve-signed  6.8.12-9     amd64        Proxmox Kernel Image (signed)
un  proxmox-kernel-6.8.4-2-pve          <none>       <none>       (no description available)
ii  proxmox-kernel-6.8.4-2-pve-signed   6.8.4-2      amd64        Proxmox Kernel Image (signed)
ii  proxmox-kernel-7.0                  7.0.2-3      amd64        Latest Proxmox Kernel Image
un  proxmox-kernel-7.0.0-3-pve          <none>       <none>       (no description available)
rc  proxmox-kernel-7.0.0-3-pve-signed   7.0.0-3      amd64        Proxmox Kernel Image (signed)
un  proxmox-kernel-7.0.2-2-pve          <none>       <none>       (no description available)
ii  proxmox-kernel-7.0.2-2-pve-signed   7.0.2-2      amd64        Proxmox Kernel Image (signed)
un  proxmox-kernel-7.0.2-3-pve          <none>       <none>       (no description available)
ii  proxmox-kernel-7.0.2-3-pve-signed   7.0.2-3      amd64        Proxmox Kernel Image (signed)
ii  proxmox-kernel-helper               9.0.4        all          Function for various kernel maintenance tasks.
root@pve1:~# du -sch /boot
423M    /boot
423M    total
root@pve1:~# apt purge proxmox-kernel-6.8.4-2-pve-signed
REMOVING:
  proxmox-kernel-6.8.4-2-pve-signed*

Summary:
  Upgrading: 0, Installing: 0, Removing: 1, Not Upgrading: 0
  Freed space: 578 MB

Continue? [Y/n]
(Reading database ... 84085 files and directories currently installed.)
Removing proxmox-kernel-6.8.4-2-pve-signed (6.8.4-2) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 6.8.4-2-pve /boot/vmlinuz-6.8.4-2-pve
update-initramfs: Deleting /boot/initrd.img-6.8.4-2-pve
run-parts: executing /etc/kernel/postrm.d/proxmox-auto-removal 6.8.4-2-pve /boot/vmlinuz-6.8.4-2-pve
run-parts: executing /etc/kernel/postrm.d/zz-proxmox-boot 6.8.4-2-pve /boot/vmlinuz-6.8.4-2-pve
Re-executing '/etc/kernel/postrm.d/zz-proxmox-boot' in new private mount namespace..
No /etc/kernel/proxmox-boot-uuids found, skipping ESP sync.
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 6.8.4-2-pve /boot/vmlinuz-6.8.4-2-pve
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-7.0.2-3-pve
Found initrd image: /boot/initrd.img-7.0.2-3-pve
Found linux image: /boot/vmlinuz-7.0.2-2-pve
Found initrd image: /boot/initrd.img-7.0.2-2-pve
Found linux image: /boot/vmlinuz-6.17.13-8-pve
Found initrd image: /boot/initrd.img-6.17.13-8-pve
Found memtest86+ 64bit EFI image: /boot/memtest86+x64.efi
Found memtest86+ 32bit EFI image: /boot/memtest86+ia32.efi
Found memtest86+ 64bit image: /boot/memtest86+x64.bin
Found memtest86+ 32bit image: /boot/memtest86+ia32.bin
Adding boot menu entry for UEFI Firmware Settings ...
done
(Reading database ... 76379 files and directories currently installed.)
Purging configuration files for proxmox-kernel-6.8.4-2-pve-signed (6.8.4-2) ...
Examining /etc/kernel/postrm.d.
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 6.8.4-2-pve /boot/vmlinuz-6.8.4-2-pve
update-initramfs: Deleting /boot/initrd.img-6.8.4-2-pve
run-parts: executing /etc/kernel/postrm.d/proxmox-auto-removal 6.8.4-2-pve /boot/vmlinuz-6.8.4-2-pve
run-parts: executing /etc/kernel/postrm.d/zz-proxmox-boot 6.8.4-2-pve /boot/vmlinuz-6.8.4-2-pve
Re-executing '/etc/kernel/postrm.d/zz-proxmox-boot' in new private mount namespace..
No /etc/kernel/proxmox-boot-uuids found, skipping ESP sync.
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 6.8.4-2-pve /boot/vmlinuz-6.8.4-2-pve
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-7.0.2-3-pve
Found initrd image: /boot/initrd.img-7.0.2-3-pve
Found linux image: /boot/vmlinuz-7.0.2-2-pve
Found initrd image: /boot/initrd.img-7.0.2-2-pve
Found linux image: /boot/vmlinuz-6.17.13-8-pve
Found initrd image: /boot/initrd.img-6.17.13-8-pve
Found memtest86+ 64bit EFI image: /boot/memtest86+x64.efi
Found memtest86+ 32bit EFI image: /boot/memtest86+ia32.efi
Found memtest86+ 64bit image: /boot/memtest86+x64.bin
Found memtest86+ 32bit image: /boot/memtest86+ia32.bin
Adding boot menu entry for UEFI Firmware Settings ...
done
root@pve1:~# du -sch /boot
343M    /boot
343M    total
root@pve1:~#

I don't know why proxmox-kernel-6.8.4-2-pve-signed has not been automatically removed from the system, but purging it manually released some space in /boot. You are talking about EFI, so I don't know if there is some nuance that I miss, but anyway.
 
Isn't the problem in /var/tmp, not in /boot?
Good eye seeing that.

The EFI isn't mounted during normal running. The kernel scripts apt runs mount the partitions in /var/tmp/espmounts in order to work with them. I manually mounted them to /mnt/esp and esp2 so I can work on them.

You want to know something crazy? I'm booting these old dell r520's in legacy bios mode because back when I first set them up booting from zfs wasn't supported with EFI boot. So these two partitions I'm having trouble with aren't even used by the boot process