How to free space in /efi partition

How do I delete an unnecessary boot image?

I just installed the latest (mercury) version of endeavouros, replacing a windows install (just linux, NOT dual-boot).

I allocated 1022MiB to the /efi partition. However, after the first install I tried creating a new /home partition and discovered I could no longer login to the new install. Being a newbie I reinstalled the OS. I then figured out how to move the existing /home to the new /home partition without breaking the system.

With the two installs, my /efi partition is down to 172MiB free (84% used). When I tried doing a general package upgrade today, the update appears to be trying to rebuild the boot images causing the package upgrade to fail.

I don’t need the two boot images – is there an easy way to remove the original boot image to free up space in /efi?

Should 1022MiB be large enough for a single boot image, or should the /efi partition need to be expanded?

( 8/13) Reloading system bus configuration... 
( 9/13) eos-nvidia-fix.hook 
Installing kernel 6.17.6-arch1-1 
dracut[I]: Executing: /usr/bin/dracut --no-hostonly --force /efi/c05154185b1e4909aa6bf3796834d8f0/6.17.6-arch1-1/i
nitrd-fallback 6.17.6-arch1-1

<snip>

dracut[I]: *** Creating image file '/efi/c05154185b1e4909aa6bf3796834d8f0/6.17.6-arch1-1/initrd-fallback.tmp' *** 
dracut[I]: *** Hardlinking files *** 
dracut[I]: *** Hardlinking files done *** 
cp: error writing '/efi/c05154185b1e4909aa6bf3796834d8f0/6.17.6-arch1-1/initrd-fallback.tmp': No space left on dev
ice 
dracut[F]: Creation of /efi/c05154185b1e4909aa6bf3796834d8f0/6.17.6-arch1-1/initrd-fallback.tmp failed 
/usr/lib/kernel/install.d/50-dracut-fallback.install failed with exit status 1. 
error: command failed to execute correctly

If you aren’t reformatting the ESP, you probably have multiple installs worth of initrds in there.

Take in a look in /efi. You will see some long strings in there that look like c05154185b1e4909aa6bf3796834d8f0. Type cat /etc/machine-id. That will return an ID string. That is the one you want to keep. Any other long ID strings are from past installs.

2 Likes

So I can just delete the directory in /efi that does not correspond to /etc/machine-id (the unused instance)? It looks like there are also a couple of files in /efi/loader/entries that correspond to this unused instance. I just want to make sure there isn’t a “correct” way to remove it besides just deleting the directory and its contents.

Also, I noticed that the unused instance is identified as 6.17.5-arch-1.1, while the used one is 6.17.6-arch-1.1. Does that mean that the 6.17.6-arch-1.1 (the running instance) has been successfully updated, while the 6.17.5-arch-1.1 (the unused instance) was not updated? In other words, if I deleted the 6.17.5-arch-1.1 instance then I shouldn’t need to worry about the post-package-update failure in dracut (since the running instance has been updated to version 6.17.5)?

Yes, you can delete the extras without any risk of harm. As long as they are the ones for the old install, they aren’t being used for anything.

And just an aside, todays recommendation for the EFI (ever growing) is 2 GB minimum.

Public safety notice.

1 Like

I deleted the unused install, leaving me with 42% used in my 1022M /efi partition. Hopefully that’s OK for now. If there’s no immediate danger, I’d like to see how my root and home partitions grow before resizing partitions. I have 64 GiB allocated to root and that’s only 24% used so far but I’d like to get a feel for how fast that will grow after regular system updates.

I was able to do a pacman system update and reboot and all looks well so far. Thanks for your help!

when was that I wonder? when I installed it was 1GB (2 yrs ago?) or I was led to believe somehow.

efi

look comfortable.

what does it take to get a stuffed /efi partition? lots of distro-hopping?

correct amundo I guess. initrds get big

March 10th of this year.

People who install lots of kernels and need large drivers(like nvidia).

2 Likes

thank you

You won’t be needing that large of an ESP if you will be using Grub. Grub’s files and folders won’t normally take more that 10-20 MB.

If using systemd-boot or thinking you may be switching from Grub to systemd-boot in the future, in that case size matters.

1 Like

no I got sysd bootloader…and have only the current kernel and the fallback kernel afaik. I agree I almost feel I should have a bigger /efi. But all works.

1 Like