From ff541ba2856a7d8fb53eec172483d260b10dddb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20M=C3=ADnguez?= Date: Thu, 16 Oct 2025 16:26:22 +0200 Subject: [PATCH] feat: Added how to clean up efi entries (#904) (cherry picked from commit e22a4c1237e8052a0febc6fc70599e33ee95fc08) --- asciidoc/tips/metal3.adoc | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/asciidoc/tips/metal3.adoc b/asciidoc/tips/metal3.adoc index 57821eba..c46e03cc 100644 --- a/asciidoc/tips/metal3.adoc +++ b/asciidoc/tips/metal3.adoc @@ -205,3 +205,32 @@ spec: ==== Kubernetes namespaces can be also used to better organize the different objects. ==== + +== Clean up old EFI boot entries + +Sometimes, the https://en.wikipedia.org/wiki/UEFI#UEFI_booting[UEFI boot manager] contains multiple entries for older operating systems that are probably not needed anymore (especially for host being re-provisioned multiple times). +You can clean up those old entries by following any of the following procedures: + +* Delete them on the BIOS/EFI setup interface directly (the exact procedure will depend on the hardware). +* Run the UEFI https://uefi.org/sites/default/files/resources/UEFI_Shell_2_2.pdf[`bcfg`] shell as: ++ +---- +# List the entries +bcfg boot dump -b +# Delete entry number X +bcfg boot rm X +# X is the number associated the entry to remove. For example, if the entry is "Boot0002 foobar", then X is 2. +---- + +* Use `efibootmgr` on a Linux system as: ++ +---- +# List the entries +efibootmgr -v +# Delete entry number X +efibootmgr -b X -B +---- + +The process may leave orphaned files on the EFI System Parition (ESP), usually found under subdirectories named by the vendor (e.g., `EFI/opensuse` or `EFI/Microsoft`). +While these files are generally harmless, they should be deleted if they consume excessive space as it can prevent the installation of a new OS or a boot manager update. +Removal may require explicitly mounting the ESP, typically mounted as `/boot/efi/EFI` on Linux systems.