zpool import -N mounts filesystems anyway

David Christensen dpchrist at holgerdanske.com
Sun Jun 18 20:19:42 UTC 2017


On 06/18/17 01:24, Mel Pilgrim wrote:
> 11.0-RELEASE-p7
> The pools and filesystems are all at current feature sets and versions.

Your BSD appears to be out of date:

2017-06-18 12:47:54 dpchrist at freebsd ~
$ freebsd-version
11.0-RELEASE-p10

2017-06-18 13:06:16 dpchrist at freebsd ~
$ uname -a
FreeBSD freebsd 11.0-RELEASE-p9 FreeBSD 11.0-RELEASE-p9 #0: Tue Apr 11 
08:42:58 UTC 2017 
root at amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386


> # zpool list backupA
> cannot open 'backupA': no such pool
> # zpool import -N backupA
> # zpool list backupA
> NAME      SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH
> ALTROOT
> backupA   696G   189G   507G         -     1%    27%  1.00x  ONLINE  -
> # zfs list backupA
> NAME         USED  AVAIL  REFER  MOUNTPOINT
> backupA      189G   486G    22K  /backup-ext/backupA
> # zfs get canmount,mountpoint backupA
> NAME        PROPERTY    VALUE                   SOURCE
> backupA     canmount    on                      local
> backupA     mountpoint  /backup-ext/backupA     local
>
>
> It appears -N is ignored and the presence of canmount=on and mountpoint
> being set results in automatic mounting regardless of whether or not -N
> is given to the zpool import command.  The expected behaviour is that -N
> overrides canmount and mountpoint, leaving all filesystems in the pool
> unmounted.
>
> Currently, I work around this by setting mountpoint=none at the root
> prior to exporting (all datasets inherit mountpoint). I would prefer to
> leave mountpoint set so that the automated task that uses the pools just
> has to import and export them without twiddling properties.

I will assume 'mount' and 'ls /backup-ext' show the file system as mounted.


Checking the zfs properties documentation:

https://docs.oracle.com/cd/E23824_01/html/821-1448/gazss.html#gdrcf

Setting the canmount property to noauto means that the file system can 
only be mounted explicitly, not automatically.


Have you tried setting canmount to noauto?



David



More information about the freebsd-questions mailing list