Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jun 2017 13:19:38 -0700
From:      David Christensen <dpchrist@holgerdanske.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: zpool import -N mounts filesystems anyway
Message-ID:  <c2fff621-9ec7-e790-8b58-67170f97e42e@holgerdanske.com>
In-Reply-To: <d4b055f2-2273-6df8-fe55-640f3b56e04d@bluerosetech.com>
References:  <7f41df25-df2e-298e-d33e-cc95874e831c@bluerosetech.com> <eb778163-8387-fd55-8e8f-d65ec221e6e8@holgerdanske.com> <d4b055f2-2273-6df8-fe55-640f3b56e04d@bluerosetech.com>

index | next in thread | previous in thread | raw e-mail

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@freebsd ~
$ freebsd-version
11.0-RELEASE-p10

2017-06-18 13:06:16 dpchrist@freebsd ~
$ uname -a
FreeBSD freebsd 11.0-RELEASE-p9 FreeBSD 11.0-RELEASE-p9 #0: Tue Apr 11 
08:42:58 UTC 2017 
root@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



home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c2fff621-9ec7-e790-8b58-67170f97e42e>