Discussion:
stacked automounts
(too old to reply)
Olaf Hering
2017-11-24 20:03:23 UTC
Permalink
Raw Message
Is there a way to have stacked automounts?
In this example only /d is mounted when /d/l/1/ is accessed:

LABEL=d /d xfs noatime,x-systemd.automount,x-systemd.idle-timeout=22 1 2
/d/i/1.iso /d/l/1 iso9660 ro,loop,x-systemd.automount,x-systemd.idle-timeout=11 0 0

In the logs I see:
Set up automount d-l-1.automount.
Unset automount d-l-1.automount.

Olaf
Michael Olbrich
2017-11-26 21:42:09 UTC
Permalink
Raw Message
On Fri, Nov 24, 2017 at 09:03:23PM +0100, Olaf Hering wrote:
> Is there a way to have stacked automounts?

Not really.

> In this example only /d is mounted when /d/l/1/ is accessed:
>
> LABEL=d /d xfs noatime,x-systemd.automount,x-systemd.idle-timeout=22 1 2
> /d/i/1.iso /d/l/1 iso9660 ro,loop,x-systemd.automount,x-systemd.idle-timeout=11 0 0
>
> In the logs I see:
> Set up automount d-l-1.automount.
> Unset automount d-l-1.automount.

Systemd mounts a autofs for each automount
filesystem. In this case this means autofs is mounted to /d/l/1 so the real
filesystem for /d is mounted at boot-time. So using x-systemd.automount for
/d is pointless. It's mounted immediately and cannot expire.

Which version are you using? I tested this with some tmpfs and it works as
expected with systemd v235.

Michael

--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Lennart Poettering
2017-11-27 14:05:33 UTC
Permalink
Raw Message
On Fr, 24.11.17 21:03, Olaf Hering (***@aepfle.de) wrote:

> Is there a way to have stacked automounts?

This is not supported right now. When an automount is first set up,
all mounts in its prefix paths are mounted first. Hence, while what
you configure there is accepted, it doesn't do what you want it to do:
it would set up two mounts and two automounts, but after boot you'll
find that the upper automount is already triggered, and thus the upper
mount already mounted.

This is fixable, but so far noone spent the time to do so.

> In this example only /d is mounted when /d/l/1/ is accessed:
>
> LABEL=d /d xfs noatime,x-systemd.automount,x-systemd.idle-timeout=22 1 2
> /d/i/1.iso /d/l/1 iso9660 ro,loop,x-systemd.automount,x-systemd.idle-timeout=11 0 0
>
> In the logs I see:
> Set up automount d-l-1.automount.
> Unset automount d-l-1.automount.
>
> Olaf



> _______________________________________________
> systemd-devel mailing list
> systemd-***@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel



Lennart

--
Lennart Poettering, Red Hat
Loading...