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

2016-10-19 Thread Lennart Poettering
On Fri, 14.10.16 11:11, Juergen Sauer (juergen.sa...@automatix.de) wrote:

> 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?!?

As others already pointed out: mounting local device-based file
systems inside of remote network-based ones isn't particularly well
supported. We generally mount network-based mounts pretty late (since
NM and friends are late-boot services usually, and we need to be
compatible with that), but local file systems pretty early during
the earliest boot phases. If you now nest local file systems into
remote ones, then this creates a cyclic ordering dependency: the local
mounts are mounted first, the network mounts second, but want to be
mounted before the local mounts. Which of course can't be fulfilled
fully.

If systemd runs into a cyclic dep like this it's usually approach is
to remove jobs from the cyclce until the cycle is gone. Which one is
removed is not deterministic, and that's what you are seeing.

My general recommendation would be not to do such setups of nesting
local mounts within remote mounts. But if you really want to do that,
you should probably be able to mark your nested mounts as remote and
thus remove the ordering problem. Specifically, adding "_netdev" as
mount option to the relevant mounts should suffice.

Hope this makes sense,

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2016-10-14 Thread Kai Krakow
Am Fri, 14 Oct 2016 19:58:13 +0300
schrieb Andrei Borzenkov :

> 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.

I'd create something like /home/local/leander which contains your local
directories. This also requires only one subvolume mount for exactly
this one directory. Then put symlinks into your /home/leander to the
local directories.

Since local mounts are strictly ordered before remote mounts, you can
be sure than the local directories are available when your nfs home dir
is mounted.

> > 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.


-- 
Regards,
Kai

Replies to list-only preferred.


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2016-10-14 Thread Andrei Borzenkov
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.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2016-10-14 Thread 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?!?

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

I have this fstab
## Grundsystem
LABEL=pc11root  /   btrfs
rw,relatime,compress=lzo,ssd_spread,discard,space_cache,subvol=rootfs   0 0
LABEL=pc11root  /vm btrfs
rw,relatime,compress=lzo,ssd_spread,discard,space_cache,subvol=vm   0 0
LABEL=pc11root  /pc11   btrfs
rw,relatime,compress=lzo,ssd_spread,discard,space_cache,subvol=/,noauto 0 0
LABEL=swap  noneswapdefaults0 0

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

LABEL=pc11root /home/leander/.cache   btrfs
ssd,ssd_spread,discard,compress=lzo,noatime,subvol=user/leander/cache,x-systemd.requires=home.mount
0 0
LABEL=pc11root /home/leander/.config  btrfs
ssd,ssd_spread,discard,compress=lzo,noatime,subvol=user/leander/config,x-systemd.requires=home.mount
0 0
LABEL=pc11root /home/leander/.kde4btrfs
ssd,ssd_spread,discard,compress=lzo,noatime,subvol=user/leander/kde4,x-systemd.requires=home.mount
0 0
LABEL=pc11root /home/leander/.local   btrfs
ssd,ssd_spread,discard,compress=lzo,noatime,subvol=user/leander/local,x-systemd.requires=home.mount
0 0
LABEL=pc11root /home/leander/.thumbnails  btrfs
ssd,ssd_spread,discard,compress=lzo,noatime,subvol=user/leander/thumbnails,x-systemd.requires=home.mount
0 0
LABEL=pc11root /home/leander/.thunderbird btrfs
ssd,ssd_spread,discard,compress=lzo,noatime,subvol=user/leander/thunderbird,x-systemd.requires=home.mount
0 0
LABEL=pc11root /home/leander/.winebtrfs
ssd,ssd_spread,discard,compress=lzo,noatime,subvol=user/leander/wine,x-systemd.requires=home.mount
0 0


How to fix?

mit freundlichen Grüßen
Jürgen Sauer
-- 
Jürgen Sauer - automatiX GmbH,
+49-4209-4699, juergen.sa...@automatix.de
Geschäftsführer: Jürgen Sauer,
Gerichtstand: Amtsgericht Walsrode • HRB 120986
Ust-Id: DE191468481 • St.Nr.: 36/211/08000
GPG Public Key zur Signaturprüfung:
http://www.automatix.de/juergen_sauer_publickey.gpg



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel