Project

General

Profile

Feature #3248

There should be a way to exclude a pool from import at boot

Added by Arne Jansen about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2012-10-02
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

I'd like to exclude a pool from import on every boot, even after an unclean shutdown. Exporting the pool before shutdown is not an option.
A pool-property might be a good way to implement it.
The point is that this pool takes > 10 minutes to import and I want to get it out of the boot process.

#1

Updated by Gary Mills about 8 years ago

You can accomplish this by specifying a private cache file when you import or export the zpool. That way, it won't be included in the normal cache file that's used to do imports at boot time. Here's an example:

    # zpool list
    NAME    SIZE  ALLOC   FREE    CAP  HEALTH  ALTROOT
    rpool   136G  8.66G   127G     6%  ONLINE  -
    # ll /etc/zfs/*.cache
    -rw-r--r--   1 root     root        1704 Jul 18 13:29 /etc/zfs/zpool.cache
    # ll /etc/zfs/clust.cache
    /etc/zfs/clust.cache: No such file or directory
    # zpool import -o cachefile=/etc/zfs/clust.cache space
    # zpool list
    NAME    SIZE  ALLOC   FREE    CAP  HEALTH  ALTROOT
    rpool   136G  8.66G   127G     6%  ONLINE  -
    space   278G   212M   278G     0%  ONLINE  -
    # ll /etc/zfs/*.cache
    -rw-r--r--   1 root     root        1824 Jul 18 17:51 /etc/zfs/clust.cache
    -rw-r--r--   1 root     root        1716 Jul 18 17:51 /etc/zfs/zpool.cache

#2

Updated by Arne Jansen about 8 years ago

great, works as described, thanks!

#3

Updated by Alasdair Lumsden about 8 years ago

  • Status changed from New to Closed

Closing issue as method provided.

#4

Updated by Richard PALO about 8 years ago

Arne Jansen wrote:

great, works as described, thanks!

If I understand what you would like to do, I've been using the syntax
'zpool import -R <root> <pool>' which seems to work ok. Apparently
this is a shortcut for "-o cachefile=none,altroot=root"

If the pool is another "rpool", use 'zpool import -R <root> <id> <newpool>'
with the id indicated in the "zpool import" command, which lists the available pools.

Also available in: Atom PDF