ZPOOL-IMPORT(8)
π zpool-import(8) π
okay bestie, gather round, because this is ZPOOL-IMPORT(8) from the System Manager's Manual and it's literally the page that tells you how to bring your ZFS storage pools home π β¨ β or just vibe-check which pools are out there waiting for you. Let's get into it. π¦
β¨ NAME β¨
zpool-import β import ZFS storage pools or list available pools π
π SYNOPSIS π
zpool import [-D] [-d dir|device]β¦
zpool import -a [-DflmN] [-F [-nTX]] [--rewind-to-checkpoint]
[-c cachefile|-d dir|device] [-o mntopts] [-o property=value]β¦
[-R root]
zpool import [-Dflmt] [-F [-nTX]] [--rewind-to-checkpoint]
[-c cachefile|-d dir|device] [-o mntopts] [-o property=value]β¦
[-R root] [-s] pool|id [newpool]
π DESCRIPTION π
πΈ zpool import [-D] [-d dir|device]β¦ β the "so what's out there" one
This form lists the pools that are available to import. π΅οΈββοΈ If you don't hand it the -d or -c options, it goes hunting for devices on its own β using libblkid on Linux and geom on FreeBSD. And yes, you can drop -d more than once, and it'll search all the directories you gave it, no cap.
If a device looks like it's part of an exported pool, this command spills the tea: it shows a summary of the pool with the pool's name, a numeric identifier, plus the vdev layout and the current health of the device for every device or file. π©Ί
Destroyed pools β like, pools you already took out with thezpool destroycommand β will not show up here unless you pass-D. π
That numeric identifier? It's unique, and you can use it instead of the pool name whenever you've got multiple exported pools all flexing the same name. π«Ά
-ccachefile β reads the config from the cachefile you made with thecachefilepool property. This cachefile gets used instead of searching for devices. π-ddir|device β uses device, or searches for devices or files inside dir. You can pass-dmore than once. π-Dβ lists destroyed pools only. π
π zpool import -a [-DflmN] [-F [-nTX]] [-c cachefile|-d dir|device] [-o mntopts] [-o property=value]β¦ [-R root] [-s] β the "import literally everything" one
Imports all the pools it finds in the search directories. It's basically the previous command's twin, except it actually imports every pool that has enough devices available. Destroyed pools β y'know, the ones you previously destroyed with zpool destroy β won't get imported unless you say -D. π«
-aβ searches for and imports all pools it can find. π-ccachefile β reads the config from the cachefile you made with thecachefilepool property. This cachefile is used instead of searching for devices. π-ddir|device β uses device, or searches for devices or files inside dir. You can pass-dmore than once. Heads up though: this option is incompatible with the-coption. π§-Dβ imports destroyed pools only. And the-foption is also required. πβ-fβ forces the import, even if the pool looks like it might be potentially active. π€-Fβ recovery mode for a non-importable pool. It tries to bring the pool back to an importable state by tossing out the last few transactions. Not every damaged pool can be saved this way, ngl. And if it does work? The data from those discarded transactions is irretrievably lost. π This option gets ignored if the pool is importable or already imported.-lβ says that this command will request encryption keys π for every encrypted dataset it tries to mount while bringing the pool online. Careful though: if any datasets have akeylocationofprompt, this command will block waiting for the keys to be typed in. Without this flag, encrypted datasets just sit there unavailable until the keys get loaded. π-mβ lets a pool import even when there's a missing log device. Recent transactions can be lost, because the log device is gonna get discarded. ποΈ-nβ used together with the-Frecovery option. It figures out whether a non-importable pool can be made importable again, but it does not actually perform the pool recovery. More deets on pool recovery mode are under the-Foption, above. π-Nβ imports the pool without mounting any file systems. π«π-omntopts β a comma-separated list of mount options to use when mounting datasets inside the pool. Peepzfs(8)for a rundown of dataset properties and mount options. π§Ύ-oproperty=value β sets the given property on the imported pool. Check thezpoolprops(7)manual page for more on the available pool properties. π οΈ-Rroot β sets thecachefileproperty tononeand thealtrootproperty to root. π³--rewind-to-checkpointβ rewinds the pool to its checkpointed state. βͺ And bestie, listen: once the pool is imported with this flag, there is no way to undo the rewind. Every change and every bit of data written after the checkpoint is lost! π± The one exception is when thereadonlymounting option is enabled β in that case the checkpointed state of the pool is opened, and an admin can see how the pool would look if they were to fully rewind. π-sβ scans using the default search path, and thelibblkidcache will not be consulted. You can specify a custom search path by setting theZPOOL_IMPORT_PATHenvironment variable. π§-Xβ used with the-Frecovery option. It decides whether extreme measures to find a valid txg should happen. This lets the pool be rolled back to a txg that is no longer guaranteed to be consistent. Pools imported at an inconsistent txg may contain uncorrectable checksum errors. More deets on pool recovery mode live under the-Foption, above. π
WARNING: this option can be extremely hazardous to the health of your pool and should only ever be used as a last resort. π¨π
-Tβ specify the txg to use for rollback. It implies-FX. More deets on pool recovery mode are under the-Xoption, above. π
WARNING: this option can be extremely hazardous to the health of your pool and should only ever be used as a last resort. π¨π
π zpool import [-Dflmt] [-F [-nTX]] [-c cachefile|-d dir|device] [-o mntopts] [-o property=value]β¦ [-R root] [-s] pool|id [newpool] β the "import this specific one" one
Imports one specific pool. π― You can point at it by its name or by its numeric identifier. If you hand it newpool, the pool gets imported under the name newpool. Otherwise, it comes in with the same name it had when it was exported. π·οΈ
Now here's a thing: if a device got yanked out of a system without running zpool export first, that device shows up as potentially active. There's genuinely no way to tell whether that was a failed export or whether the device is actually in use from some other host. To import a pool in that state, the -f option is required. π¬
-ccachefile β reads the config from the cachefile you made with thecachefilepool property. This cachefile is used instead of searching for devices. π-ddir|device β uses device, or searches for devices or files inside dir. You can pass-dmore than once. Just know this option is incompatible with the-coption. π§-Dβ imports a destroyed pool. The-foption is also required. πβ-fβ forces the import, even if the pool looks like it might be potentially active. π€-Fβ recovery mode for a non-importable pool. It attempts to return the pool to an importable state by discarding the last few transactions. Not all damaged pools can be recovered with this option. If it succeeds, the data from the discarded transactions is irretrievably lost. π This option is ignored if the pool is importable or already imported.-lβ indicates that this command will request encryption keys π for all encrypted datasets it attempts to mount while it's bringing the pool online. Note that if any datasets have akeylocationofprompt, this command will block waiting for the keys to be entered. Without this flag, encrypted datasets are left unavailable until the keys get loaded. π-mβ allows a pool to import when there's a missing log device. Recent transactions can be lost because the log device will be discarded. ποΈ-nβ used with the-Frecovery option. Determines whether a non-importable pool can be made importable again, but does not actually perform the pool recovery. For more details about pool recovery mode, see the-Foption, above. π-omntopts β comma-separated list of mount options to use when mounting datasets within the pool. Seezfs(8)for a description of dataset properties and mount options. π§Ύ-oproperty=value β sets the specified property on the imported pool. See thezpoolprops(7)manual page for more information on the available pool properties. π οΈ-Rroot β sets thecachefileproperty tononeand thealtrootproperty to root. π³-sβ scans using the default search path, and thelibblkidcache will not be consulted. A custom search path may be specified by setting theZPOOL_IMPORT_PATHenvironment variable. π§
part 2 is coming bestie, don't you dare go anywhere ππ¦
-Xβ Used with the-Frecovery option. Determines whether extreme measures to find a valid txg should take place. This allows the pool to be rolled back to a txg which is no longer guaranteed to be consistent. Pools imported at an inconsistent txg may contain uncorrectable checksum errors. For more details about pool recovery mode, see the-Foption, above. WARNING: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.-Tβ Specify the txg to use for rollback. Implies-FX. For more details about pool recovery mode, see the-Xoption, above. WARNING: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.-tβ Used with newpool. Specifies that newpool is temporary. Temporary pool names last until export. Ensures that the original pool name will be used in all label updates and therefore is retained upon export. Will also set-o cachefile=nonewhen not explicitly specified.
β¨ EXAMPLES β¨
π¦ Example 9: Importing a ZFS Storage Pool π¦
Okay so this command? It displays available pools, and then imports the pool tank for use on the system. The results from this command are similar to the following:
# zpool import
pool: tank
id: 15451357997522795478
state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:
tank ONLINE
mirror ONLINE
sda ONLINE
sdb ONLINE
# zpool import tank
π SEE ALSO π
This page is from the OpenZFS crew π July 11, 2022 ZPOOL-IMPORT(8) β stay slay, bestie π
β¨
π¦ where this page comes from
- alpine 3.23: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- alpine 3.24: zfs-doc 2.4.4-r0 Β· CDDL-1.0
- nixos 26.05: zfs-user 2.4.4
- nixpkgs unstable: zfs-user 2.4.4
- ubuntu resolute: zfsutils-linux 2.4.1-1ubuntu5 Β· CDDL-1.0
- ubuntu resolute: zfsutils-linux 2.4.1-1ubuntu5.1 Β· CDDL-1.0
- ubuntu stonking: zfsutils-linux 2.4.4-1ubuntu4 Β· CDDL-1.0
- π the page's license: CDDL-1.0
- Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
- Copyright (c) 2012, 2018 by Delphix. All rights reserved
- Copyright (c) 2012 Cyril Plisko. All Rights Reserved
- Copyright (c) 2017 Datto Inc
- Copyright (c) 2018 George Melikov. All Rights Reserved
- Copyright 2017 Nexenta Systems, Inc
- Copyright (c) 2017 Open-E, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms