Fedora 39 Template unreadable /efi directory

The Fedora 39 templates have an unreadable /efi directory.

[user@fedora-39 ~]$ ls -ld /efi
drwxr-xr-x. 2 root root 0 Feb 29 14:19 /efi

Attempting to ls the directory gives:

[user@fedora-39 ~]$ ls /efi
ls: cannot open directory '/efi': No such device

It also cannot be removed:

[user@fedora-39 ~]$ sudo rm /efi
/usr/bin/rm: cannot remove '/efi': Is a directory
[user@fedora-39 ~]$ sudo rmdir /efi
/usr/bin/rmdir: failed to remove '/efi': Device or resource busy

I wouldn’t care except that it causes deja-dup to fail as it cannot read the directory.


From the output from

mount | grep efi

it looks like something SystemD related … but I have no clue to what it is or if it can be removed. :-/


You are right - it’s the systemd units efi.mount and efi.automount apparently. If I stop them I can remove the directory, but it comes back when I restart the qube. And you can’t disable those units :frowning:

Now that I know where to look I should be able to find a solution. Thanks.

exclude the directory

Thanks. I did try that, but it didn’t seem to work. For some reason it still tried to read /efi (even though I’m only backing up the user home directory).

I think I’ll be okay once I sort out the systemd issue.

Okay - I sorted it out. I had to set the “Ignore EFI” attribute on the EFI partition on my Fedora 39 template - this prevents the mounting of the EFI partition on /efi.

In case anyone else is interested, the steps I used are:

  1. Start a terminal session in the Fedora 39 template qube
  2. Install gdisk: sudo dnf install gdisk
  3. Run gdisk: sudo gdisk /dev/xvda
  4. At the Command prompt type p list list the partitions. Note the number of the EFI System partion (in my case it was 1).
  5. Enter x for expert mode.
  6. At the Expert Command prompt enter a for set attributes mode.
  7. Enter the EFI System partition number (e.g. 1)
  8. Enter 1 at the Toggle which attribute field prompt.
  9. Hit Enter to exit set attribute mode.
  10. At the Expert Command prompt type w to save the changes.

So far it doesn’t seem to have had any unwanted side-affects :slight_smile:

I wonder if selinux isn’t preventing you from doing stuff on /efi :thinking:

could you try to disable selinux and see if it helps? If so, a rule may be required to solve that.

setenforce 0 to disable it temporary

That’s an interesting thought. I don’t know anything about selinux unfortunately, but I might give it a try. For the moment, stopping the EFI partiton from being mounted seems to have done the trick.

Thanks for the help!