[systemd-devel] BUG: Huge Problem: systemd does not mount all filesystems on Boot

Andrei Borzenkov arvidjaar at gmail.com
Fri Oct 14 16:58:13 UTC 2016


14.10.2016 12:11, Juergen Sauer пишет:
> Moin,
> 
> Systemd 231, Archlinux current
> 
> The concept is /home is to be mounted from nfs server. Works.
> For performance reasons (email thunderbird, kde/plasma 5.8.x i.e odr
> gnome are unusable if home is pure nfs) the user sub dirs .local,
> .cache, .config, .thunderbird etc. are mounts from local fs (btrfs
> subvolume).
> 
> Network is without NetWorkmanager (masked), fixed configured via
> systemd-networkd.
> 
> The Problem is, after boot /home is mounted or not, random result. WTF?!?
> 

local mounts are by default ordered before remote mounts, so you have
dependency loop. Systemd resolves it by deleting one of units in this
loop. Depending on what unit gets deleted you get different results. I
do not know how deterministic algorithm is.

> The BUG is:
> The btrfs subvols are i.g. mounted - disobeying the
> x-systemd.requires=home.mount rule.
> 

Yes, systemdm will create mount point if it does not exist. I am still
unsure whether this is a good thing.

...

> 
> 192.168.11.10:/home        /home   nfs
> nofail,x-systemd.device-timeout=1,x-systemd.requires=network-online.target
>     0 0
> 

systemd already adds dependency on network-online.target to network
mounts. But do not forget that you need something that actually
implements waiting for network, otherwise this requirement is
effectively noop.

> LABEL=pc11root /home/leander/.cache       btrfs
> ssd,ssd_spread,discard,compress=lzo,noatime,subvol=user/leander/cache,x-systemd.requires=home.mount
> 0 0

systemd adds equivalent to RequiresMountsFor=mount-point so
x-systemd.requires here is redundant.
...

> 
> 
> How to fix?
>

Try adding _netdev to each mount that depends on /home to order them
after network.


More information about the systemd-devel mailing list