You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
systemd-gpt-auto-generator ignores existing mount units #13099
I expect systemd-gpt-auto-generator to not generate units for paths for which mount units already exist, like it does for /etc/fstab.
We have both a boot.mount and a boot-efi.mount shipped in FCOS. Yet, boot.automount was still generated and started. And so we end up with this mount structure:
Ahh. This could also be related to my issue. I'm trying to mount my /home via a systemd mount and automount file. This by itself works BUT it completely ignores the Options= line of my mount file. While I have set Options=rw,lazytime the mount command tells me that:
/dev/sda3 on /home type f2fs (rw,relatime,lazytime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=default,fsync_mode=posix)
And I cant find any way to make it stop adding this. There is nothing in the fstab about this one partition.
mount | grep "/home "
systemd-1 on /home type autofs (rw,lazytime,fd=44,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=12645)
/dev/sda3 on /home type f2fs (rw,relatime,lazytime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=default,fsync_mode=posix)
Note that this really shouldn't matter: gpt-auto-generator will only generate units in the "lower" layer of generator output. Anything you define will override things.
@YHNdnzj Does this actually fix the problem? The linked patch doesn't seem like it would.
The linked fix changes the behavior so automounts for the /boot and /efi are all-or-nothing, and only if neither /boot or /efi is in the fstab. That's not the problem OP reported here though.
The problem here is that fstab isn't being used at all, mount units are, and for some reason systemd-gpt-auto-generator ignores the fact that mount units can exist instead of direct entries in fstab (at least according to the OP's report). In the linked "fix" nothing about that seems to have been modified.
If however, there's also a race condition between the mount units mounting their target and the systemd-gpt-auto-generator running the generation, and the "fix" was "verified" only via real-world testing, it's possible a false success was seen.
The linked "fix" would have extended the window during which the generator would lose the race now that it only does all-or-nothing for both the /boot and /efi mountpoints. So if the generator lost either race against a mount unit, it would also guarantee it loses the race with the other mount unit. That's not actually a fix for the problem though, it's just shifting the timing of the race condition.
EDIT: @jlebon I'm guessing FCOS hasn't verified the linked fix actually solves the reported problem since I see in the FCOS config that systemd-gpt-auto-generator is simply disabled entirely still(?).
Activity
fabiscafe commentedon Jul 18, 2019
Ahh. This could also be related to my issue. I'm trying to mount my /home via a systemd mount and automount file. This by itself works BUT it completely ignores the
Options=line of my mount file. While I have setOptions=rw,lazytimethe mount command tells me that:And I cant find any way to make it stop adding this. There is nothing in the fstab about this one partition.
This behavior is really unexpected
poettering commentedon Jul 18, 2019
Note that this really shouldn't matter: gpt-auto-generator will only generate units in the "lower" layer of generator output. Anything you define will override things.
poettering commentedon Jul 22, 2019
btw, you really really want the automount in for the ESP and/or /boot, because that means the fs is always in a fully clean state when possible.
YHNdnzj commentedon May 12, 2025
Fixed by #31181
mtalexan commentedon Oct 29, 2025
@YHNdnzj Does this actually fix the problem? The linked patch doesn't seem like it would.
The linked fix changes the behavior so automounts for the
/bootand/efiare all-or-nothing, and only if neither/bootor/efiis in the fstab. That's not the problem OP reported here though.The problem here is that fstab isn't being used at all, mount units are, and for some reason
systemd-gpt-auto-generatorignores the fact that mount units can exist instead of direct entries in fstab (at least according to the OP's report). In the linked "fix" nothing about that seems to have been modified.If however, there's also a race condition between the mount units mounting their target and the
systemd-gpt-auto-generatorrunning the generation, and the "fix" was "verified" only via real-world testing, it's possible a false success was seen.The linked "fix" would have extended the window during which the generator would lose the race now that it only does all-or-nothing for both the
/bootand/efimountpoints. So if the generator lost either race against a mount unit, it would also guarantee it loses the race with the other mount unit. That's not actually a fix for the problem though, it's just shifting the timing of the race condition.EDIT: @jlebon I'm guessing FCOS hasn't verified the linked fix actually solves the reported problem since I see in the FCOS config that
systemd-gpt-auto-generatoris simply disabled entirely still(?).dracut: add 50remove-systemd-gpt-auto-generator
manifests: Move systemd-gpt-auto-generator to a manifest shared with EL
manifests: Move systemd-gpt-auto-generator to a manifest shared with EL