Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/efi does not automount on Fedora 40 - various systemd-gpt-auto-generator issues #75

Closed
marc-hb opened this issue Dec 10, 2024 · 1 comment
Labels
wontfix This will not be worked on

Comments

@marc-hb
Copy link
Collaborator

marc-hb commented Dec 10, 2024

Summarizing a (minor?) problem discussed first in #74.

In some conditions, /efi does not automount. It does mount manually. Also, booting works both from the ESP partition and not (run_qemu.sh --no-direct-kernel and not). So this is considered a minor issue and will be closed as wontfix. Please re-open if you disagree.

On Fedora, /efi automounting is performed by these:

[root@fedora ~]# systemctl list-units --all | grep efi
  efi.automount                                loaded    active   running   EFI System Partition Automount
  efi.mount                                    loaded    active   mounted   EFI System Partition Automount

These are automatically generated at boot time. However, the auto detection has a number of apparently fragile requirements that are not always fullfilled. The complete list can be found in man systemd-gpt-auto-generator. You can test systemd-gpt-auto-generator on a running system like this:

mkdir temp
/usr/lib/systemd/system-generators/systemd-gpt-auto-generator temp temp temp
tree temp

temp
|-- -.mount.wants
|   `-- systemd-growfs-root.service -> /usr/lib/systemd/system/systemd-growfs-root.service
|-- efi.automount
|-- efi.mount
|-- local-fs.target.d
|   `-- 50-order-systemd-growfs-root.service.conf
`-- local-fs.target.wants
    `-- efi.automount -> ../efi.automount

Repeating temp 3 times means you want all 3 "things" to be generated in the same place, see man systemd.generator for more.


Fedora uses btrfs by default. That default used to be overridden and configured by run_qemu.sh to ext4 when using mkosi v14 but not anymore when upgrading to mkosi v15, see #74 why.

btrfs is simply INCOMPATIBLE with systemd-gpt-auto-generator, see systemd/systemd#16953 why.

Dec 10 09:31:43 fedora systemd-gpt-auto-generator[142]: File system behind root file system is reported by btrfs
    to be backed by pseudo-device /dev/root, which is not a valid userspace accessible device node. Cannot determine correct backing block device.
Dec 10 09:31:43 fedora (sd-exec-[136]: /usr/lib/systemd/system-generators/systemd-gpt-auto-generator
    failed with exit status 1.

Interestingly, this /dev/root / btrfs obfuscation problem disappears after boot. In other words, systemd-gpt-auto-generator is able to generate efi.*mount configuration files after boot. But it's too late now. Longer explanation in systemd/systemd#16953


Another thing I noticed: for systemd-gpt-auto-generator to consider /efi on my system, I MUST use --no-direct-kernel. In other words, I must actually use the ESP partition in order for systemd-gpt-auto-generator to recognize it. I don't know why. This happens with both mkosi14 and mkosi v22. It could be down to the kernel command line parameters? Which systemd-gpt-auto-generator definitely looks at - among many other things.

@marc-hb
Copy link
Collaborator Author

marc-hb commented Dec 20, 2024

Adding to the confusion, I just discovered that the automount can be sometimes delayed:

$ mount | grep efi
efivarfs on

$ ls /efi
$ mount  | grep efi
efivars on ...
/dev/sda1 on /efi type vfat

The above was with mkosi v14, Fedora 40 and ext4 and booting the ESP with --no-direct-kernel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant