Date: Fri, 28 Apr 2023 11:02:21 +0200 From: Gerrit =?UTF-8?B?S8O8aG4=?= <gerrit.kuehn@aei.mpg.de> To: freebsd-fs@freebsd.org Subject: Re: canmount=noauto not behaving as expected Message-ID: <20230428110221.3f620207@arc.aei.uni-hannover.de> In-Reply-To: <20230427155449.2b94bdb3@arc.aei.uni-hannover.de> References: <20230427152159.508f097c@arc.aei.uni-hannover.de> <20230427155449.2b94bdb3@arc.aei.uni-hannover.de>
next in thread | previous in thread | raw e-mail | index | archive | help
Am Thu, 27 Apr 2023 15:54:49 +0200 schrieb Gerrit K=C3=BChn <gerrit.kuehn@aei.mpg.de>: > However, I still don't get any of the nested filesystems mounted on > "zpool import", they all stay unmounted there. So canmount is (quite > unexpectedly to me) treated differently for "zpool import" and "zfs > mount -a". More precisely: --- root@crest:/etc # zfs get canmount data/syncoid/pt-vault NAME PROPERTY VALUE SOURCE data/syncoid/pt-vault canmount on default root@crest:/etc # zfs get canmount data/syncoid/pt-vault/home NAME PROPERTY VALUE SOURCE data/syncoid/pt-vault/home canmount noauto local root@crest:/etc # zfs get canmount data/syncoid/pt-vault/home/archives NAME PROPERTY VALUE SOURCE data/syncoid/pt-vault/home/archives canmount on default --- So canmount=3Dnoauto is just set for one filesystem "in the middle", not for the one above, nor for the one below. --- root@crest:/etc # zfs mount -a root@crest:/etc # zfs get mounted data/syncoid/pt-vault NAME PROPERTY VALUE SOURCE data/syncoid/pt-vault mounted yes - root@crest:/etc # zfs get mounted data/syncoid/pt-vault/home NAME PROPERTY VALUE SOURCE data/syncoid/pt-vault/home mounted no - root@crest:/etc # zfs get mounted data/syncoid/pt-vault/home/archives NAME PROPERTY VALUE SOURCE data/syncoid/pt-vault/home/archives mounted yes - --- After a "zfs mount -a" only the filesystem that is explicitely set to "noauto" will be left out, the ones below will still mount. I didn't really expect this, but so be it. However, what I find really strange now is that "zpool import" behaves differently: --- root@crest:/etc # zpool export data root@crest:/etc # zpool import data root@crest:/etc # zfs get mounted data/syncoid/pt-vault/home/archives NAME PROPERTY VALUE SOURCE data/syncoid/pt-vault/home/archives mounted no - root@crest:/etc # zfs get mounted data/syncoid/pt-vault/home NAME PROPERTY VALUE SOURCE data/syncoid/pt-vault/home mounted no - --- Importing appears to stop right at the level where canmount=3Dnoauto is set and does not consider the filesystems below. The zfsprops manpage doesn't comment on this situation explicitely, but from this I would have expected that import and mount are treated the same way: --- When set to noauto, a dataset can only be mounted and unmounted explicitly. The dataset is not mounted automatically when the dataset is created or imported, nor is it mounted by the zfs mount -a command or unmounted by the zfs unmount -a command. --- Maybe the manpage could be improved here to mention this? The manpage for zpool-import also doesn't mention which filesystems are mounted automatically and which ones aren't (it just features the -N flag that prevents any filesystems from being mounted). cu Gerrit
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20230428110221.3f620207>