You are not logged in.

#1 2016-10-03 14:19:39

risto3
Member
Registered: 2016-09-27
Posts: 36

auto.home, zfs and rbind

greenhorn Archlinux admin here.
I'm trying to migrate an existing topography on a zfs pool
namely user homes are under 'dpool/export/home' (mounted '/export/home') plus
some miscellaneous dirs under 'dpool/export/pub' (mounted '/export/pub').

Have always done a loopback mount (lofs) via the automounter (on illumos, which is SunOS 5.11),
but I'm having difficulties getting sub file systems going.

Manually, things seem to mount fine.. e.g. #mount --rbind /export/home/richard /mnt
will pick up my 'home' filesystem and child 'src' file system like it should.

But in the automounter, it doesn't... using:
>*     --rbind,defaults     :/export/home/&

For pub, though I'd try /etc/fstab with the following line:
>/export/pub    /pub    none    rbind,defaults,nofail,x-systemd.requires=zfs-mount.service    0 0
and it seems to work fine (and is okay for this shared system directory).

So, how to get the auto home mounter to work?

As these *are* nfs shared directories, I hope resorting to local nfs use isn't the only answer for obvious reasons.

[added a bit later]
I happened to come across a mention of the systemd automounter, so I gave the following a shot:
># remap zfs (and nfs shared) /export/home and /export/pub locally
>/export/home    /home    none    rbind,defaults,noauto,x-systemd.automount,x-systemd.requires=zfs-mount.service    0 0
>/export/pub    /pub        none    rbind,defaults,noauto,x-systemd.automount,x-systemd.requires=zfs-mount.service    0 0

(NB: dpool/export/home needs zfs property 'canmount=off')

seems to be okay... is this the 'right' way instead of autofs?

Last edited by risto3 (2016-10-03 15:07:31)

Offline

#2 2016-10-06 04:11:57

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: auto.home, zfs and rbind

Autofs mounts local directories via bind-mount. You can see this yourself by running automount in debug mode -- modify /etc/defaults/autofs to include OPTIONS="-d". So, it possibly ignores flags in the auto.home map.

I don't know about systemd automounter. In general, I prefer to not rely on systemd-* tools because systemd is often too smart to be useful. Besides, autofs is still a better solution if maps are distributed over network, say via NIS.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

Board footer

Powered by FluxBB