Re: canmount=noauto not behaving as expected
- In reply to: Gerrit Kühn : "Re: canmount=noauto not behaving as expected"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 28 Apr 2023 09:02:21 UTC
Am Thu, 27 Apr 2023 15:54:49 +0200 schrieb Gerrit Kühn <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=noauto 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=noauto 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