/boot/efi/EFI files after removing Ubuntu from dual boot with Fedora 41

  • I have deleted the partition that was storing Ubuntu root file system.

efibootmgr

  • I removed the ubuntu entries which existed before with sudo efibootmgr -b 0000 -B
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0001,2001,2002,2003
Boot0001* Fedora        HD(4,GPT,968564a9-c5e7-4e46-9aee-9f6ba67f4ef3,0x480800,0x40000)/\EFI\fedora\shim.efiRC
Boot2001* EFI USB Device        RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network   RC

tree /boot/efi/EFI

But the files for ubuntu exist as follows and also mmx64.efi exists in BOOT folder which is from Ubuntu

tree /boot/efi/EFI
/boot/efi/EFI
β”œβ”€β”€ BOOT
β”‚   β”œβ”€β”€ BOOTIA32.EFI
β”‚   β”œβ”€β”€ BOOTX64.EFI
β”‚   β”œβ”€β”€ fbia32.efi
β”‚   β”œβ”€β”€ fbx64.efi
β”‚   └── mmx64.efi
β”œβ”€β”€ fedora
β”‚   β”œβ”€β”€ BOOTIA32.CSV
β”‚   β”œβ”€β”€ BOOTX64.CSV
β”‚   β”œβ”€β”€ gcdia32.efi
β”‚   β”œβ”€β”€ gcdx64.efi
β”‚   β”œβ”€β”€ grub.cf
β”‚   β”œβ”€β”€ grub.cfg
β”‚   β”œβ”€β”€ grubia32.efi
β”‚   β”œβ”€β”€ grubx64.efi
β”‚   β”œβ”€β”€ mmia32.efi
β”‚   β”œβ”€β”€ mmx64.efi
β”‚   β”œβ”€β”€ shim.efi
β”‚   β”œβ”€β”€ shimia32.efi
β”‚   └── shimx64.efi
└── ubuntu
    β”œβ”€β”€ BOOTX64.CSV
    β”œβ”€β”€ grub.cfg
    β”œβ”€β”€ grubx64.efi
    β”œβ”€β”€ mmx64.efi
    └── shimx64.efi

4 directories, 23 files

Question

  1. Can I safely delete

    rm -rf /boot/efi/EFI/ubuntu  
    
  2. Do I need to remove any file(s) in /boot/efi/EFI/BOOT

  3. Do I need to regenerate initramfs or any other command like grub re-generation, etc?

The ubuntu files can be deleted as you no long use ubuntu.

Thre are files you can consider removing. But I recommend you have a backup of all the files and that you have a bootable Fedora live USB system just-in-case.

Here are the files I have in a newly install x86 system.

$ ls -lR  /boot/efi/EFI
/boot/efi/EFI:
total 8
drwx------. 2 root root 4096 Jul 19 01:00 BOOT/
drwx------. 2 root root 4096 Nov 28 16:49 fedora/

/boot/efi/EFI/BOOT:
total 1016
-rwx------. 1 root root 949424 Mar 19  2024 BOOTX64.EFI*
-rwx------. 1 root root  87816 Mar 19  2024 fbx64.efi*

/boot/efi/EFI/fedora:
total 6676
-rwx------. 1 root root     110 Mar 19  2024 BOOTX64.CSV*
-rwx------. 1 root root     159 Sep 18 15:58 grub.cfg*
-rwx------. 1 root root    7027 Sep 12 15:32 grub.cfg.rpmsave*
-rwx------. 1 root root 4066624 Nov 21 00:00 grubx64.efi*
-rwx------. 1 root root  848080 Mar 19  2024 mmx64.efi*
-rwx------. 1 root root  949424 Mar 19  2024 shim.efi*
-rwx------. 1 root root  949424 Mar 19  2024 shimx64.efi*
  1. Yes that is safe as long as you already have ubuntu removed
  2. Not necessary and potentially dangerous. Fedora also provides mmx64.efi as can be seen in the tree output. Fedora however does not put that file into /boot/efi/EFI/BOOT
/boot/efi/EFI
β”œβ”€β”€ BOOT
β”‚   β”œβ”€β”€ BOOTIA32.EFI
β”‚   β”œβ”€β”€ BOOTX64.EFI
β”‚   β”œβ”€β”€ fbia32.efi
β”‚   └── fbx64.efi
└── fedora
    β”œβ”€β”€ BOOTIA32.CSV
    β”œβ”€β”€ BOOTX64.CSV
    β”œβ”€β”€ gcdia32.efi
    β”œβ”€β”€ gcdx64.efi
    β”œβ”€β”€ grub.cfg
    β”œβ”€β”€ grubia32.efi
    β”œβ”€β”€ grubx64.efi
    β”œβ”€β”€ mmia32.efi
    β”œβ”€β”€ mmx64.efi
    β”œβ”€β”€ shim.efi
    β”œβ”€β”€ shimia32.efi
    └── shimx64.efi
  1. Try running sudo grub2-mkconfig -o /boot/grub2/grub.cfg
    That should remove all ubuntu entries from the grub menu after performing step 1.

If you have a multi-boot system of any kind, every system may (or may not) install its own boot/efi/EFI/ file which is the default boot entry if there are no other boot entries defined. It is typically use boot install media which would boot from EFI/BOOT/BOOTX64.EFI. The purpose of /boot/efi/EFI/BOOT/fbx64.efi is explained at https://github.com/rhboot/shim/blob/main/README.fallback. Again, if you have multiple bootable systems the contents of EFI/BOOT is basically unknown, but most likely is whatever the latest installed bootable system put there.

1 Like