]> granicus.if.org Git - zfs/commit
zfs-import: Perform verbatim import using cache file
authorJames Lee <jlee@thestaticvoid.com>
Sun, 20 Sep 2015 02:00:36 +0000 (22:00 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 13 Oct 2015 17:37:05 +0000 (10:37 -0700)
commit33df62d052bad11a1ebb220810672fcfba2a8d86
treefbc78fd25a2411397125944217ed22479174e988
parent2986b3fd2587b1da5b6047a5c0b6bbb0b6d9c47e
zfs-import: Perform verbatim import using cache file

This change modifies the import service to use the default cache file
to perform a verbatim import of pools at boot.  This fixes code that
searches all devices and imported all visible pools.

Using the cache file is in keeping with the way ZFS has always worked,
how Solaris, Illumos, FreeBSD, and systemd performs imports, and is how
it is written in the man page (zpool(1M,8)):

    All pools  in  this  cache  are  automatically imported when the
    system boots.

Importantly, the cache contains important information for importing
multipath devices, and helps control which pools get imported in more
dynamic environments like SANs, which may have thousands of visible
and constantly changing pools, which the ZFS_POOL_EXCEPTIONS variable
is not equipped to handle.  Verbatim imports prevent rogue pools from
being automatically imported and mounted where they shouldn't be.

The change also stops the service from exporting pools at shutdown.
Exporting pools is only meant to be performed explicitly by the
administrator of the system.

The old behavior of searching and importing all visible pools is
preserved and can be switched on by heeding the warning and toggling
the ZPOOL_IMPORT_ALL_VISIBLE variable in /etc/default/zfs.

Signed-off-by: James Lee <jlee@thestaticvoid.com>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3777
Closes #3526
etc/init.d/zfs-import.in
etc/init.d/zfs.in