4 .\" The contents of this file are subject to the terms of the
5 .\" Common Development and Distribution License (the "License").
6 .\" You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 .\" or http://www.opensolaris.org/os/licensing.
10 .\" See the License for the specific language governing permissions
11 .\" and limitations under the License.
13 .\" When distributing Covered Code, include this CDDL HEADER in each
14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 .\" If applicable, add the following below this CDDL HEADER, with the
16 .\" fields enclosed by brackets "[]" replaced with your own identifying
17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
21 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
22 .\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
23 .\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
24 .\" Copyright (c) 2017 Datto Inc.
25 .\" Copyright (c) 2018 George Melikov. All Rights Reserved.
26 .\" Copyright 2017 Nexenta Systems, Inc.
27 .\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
35 .Nd import ZFS storage pools or list available pools
40 .Oo Fl d Ar dir Ns | Ns Ar device Oc Ns …
46 .Op Fl -rewind-to-checkpoint
47 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns Ar device
49 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns …
55 .Op Fl -rewind-to-checkpoint
56 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns Ar device
58 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns …
61 .Ar pool Ns | Ns Ar id
70 .Oo Fl d Ar dir Ns | Ns Ar device Oc Ns …
72 Lists pools available to import.
76 options are not specified, this command searches for devices using libblkid
81 option can be specified multiple times, and all directories are searched.
82 If the device appears to be part of an exported pool, this command displays a
83 summary of the pool with the name of the pool, a numeric identifier, as well as
84 the vdev layout and current health of the device for each device or file.
85 Destroyed pools, pools that were previously destroyed with the
87 command, are not listed unless the
91 The numeric identifier is unique, and can be used instead of the pool name when
92 multiple exported pools of the same name are available.
95 Reads configuration from the given
97 that was created with the
102 is used instead of searching for devices.
103 .It Fl d Ar dir Ns | Ns Ar device
106 or searches for devices or files in
110 option can be specified multiple times.
112 Lists destroyed pools only.
120 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns Ar device
122 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns …
126 Imports all pools found in the search directories.
127 Identical to the previous command, except that all pools with a sufficient
128 number of devices available are imported.
129 Destroyed pools, pools that were previously destroyed with the
131 command, will not be imported unless the
136 Searches for and imports all pools found.
137 .It Fl c Ar cachefile
138 Reads configuration from the given
140 that was created with the
145 is used instead of searching for devices.
146 .It Fl d Ar dir Ns | Ns Ar device
149 or searches for devices or files in
153 option can be specified multiple times.
154 This option is incompatible with the
158 Imports destroyed pools only.
161 option is also required.
163 Forces import, even if the pool appears to be potentially active.
165 Recovery mode for a non-importable pool.
166 Attempt to return the pool to an importable state by discarding the last few
168 Not all damaged pools can be recovered by using this option.
169 If successful, the data from the discarded transactions is irretrievably lost.
170 This option is ignored if the pool is importable or already imported.
172 Indicates that this command will request encryption keys for all encrypted
173 datasets it attempts to mount as it is bringing the pool online.
174 Note that if any datasets have a
178 this command will block waiting for the keys to be entered.
180 encrypted datasets will be left unavailable until the keys are loaded.
182 Allows a pool to import when there is a missing log device.
183 Recent transactions can be lost because the log device will be discarded.
188 Determines whether a non-importable pool can be made importable again, but does
189 not actually perform the pool recovery.
190 For more details about pool recovery mode, see the
194 Import the pool without mounting any file systems.
196 Comma-separated list of mount options to use when mounting datasets within the
200 for a description of dataset properties and mount options.
201 .It Fl o Ar property Ns = Ns Ar value
202 Sets the specified property on the imported pool.
205 manual page for more information on the available pool properties.
215 .It Fl -rewind-to-checkpoint
216 Rewinds pool to the checkpointed state.
217 Once the pool is imported with this flag there is no way to undo the rewind.
218 All changes and data that were written after the checkpoint are lost!
219 The only exception is when the
221 mounting option is enabled.
222 In this case, the checkpointed state of the pool is opened and an
223 administrator can see how the pool would look like if they were
226 Scan using the default search path, the libblkid cache will not be
228 A custom search path may be specified by setting the
229 .Sy ZPOOL_IMPORT_PATH
230 environment variable.
235 Determines whether extreme measures to find a valid txg should take place.
236 This allows the pool to
237 be rolled back to a txg which is no longer guaranteed to be consistent.
238 Pools imported at an inconsistent txg may contain uncorrectable checksum errors.
239 For more details about pool recovery mode, see the
242 WARNING: This option can be extremely hazardous to the
243 health of your pool and should only be used as a last resort.
245 Specify the txg to use for rollback.
249 about pool recovery mode, see the
252 WARNING: This option can be extremely hazardous to the
253 health of your pool and should only be used as a last resort.
260 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns Ar device
262 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns …
265 .Ar pool Ns | Ns Ar id
268 Imports a specific pool.
269 A pool can be identified by its name or the numeric identifier.
272 is specified, the pool is imported using the name
274 Otherwise, it is imported with the same name as its exported name.
276 If a device is removed from a system without running
278 first, the device appears as potentially active.
279 It cannot be determined if this was a failed export, or whether the device is
280 really in use from another host.
281 To import a pool in this state, the
285 .It Fl c Ar cachefile
286 Reads configuration from the given
288 that was created with the
293 is used instead of searching for devices.
294 .It Fl d Ar dir Ns | Ns Ar device
297 or searches for devices or files in
301 option can be specified multiple times.
302 This option is incompatible with the
306 Imports destroyed pool.
309 option is also required.
311 Forces import, even if the pool appears to be potentially active.
313 Recovery mode for a non-importable pool.
314 Attempt to return the pool to an importable state by discarding the last few
316 Not all damaged pools can be recovered by using this option.
317 If successful, the data from the discarded transactions is irretrievably lost.
318 This option is ignored if the pool is importable or already imported.
320 Indicates that this command will request encryption keys for all encrypted
321 datasets it attempts to mount as it is bringing the pool online.
322 Note that if any datasets have a
326 this command will block waiting for the keys to be entered.
328 encrypted datasets will be left unavailable until the keys are loaded.
330 Allows a pool to import when there is a missing log device.
331 Recent transactions can be lost because the log device will be discarded.
336 Determines whether a non-importable pool can be made importable again, but does
337 not actually perform the pool recovery.
338 For more details about pool recovery mode, see the
342 Comma-separated list of mount options to use when mounting datasets within the
346 for a description of dataset properties and mount options.
347 .It Fl o Ar property Ns = Ns Ar value
348 Sets the specified property on the imported pool.
351 manual page for more information on the available pool properties.
362 Scan using the default search path, the libblkid cache will not be
364 A custom search path may be specified by setting the
365 .Sy ZPOOL_IMPORT_PATH
366 environment variable.
371 Determines whether extreme measures to find a valid txg should take place.
372 This allows the pool to
373 be rolled back to a txg which is no longer guaranteed to be consistent.
374 Pools imported at an inconsistent txg may contain uncorrectable
376 For more details about pool recovery mode, see the
379 WARNING: This option can be extremely hazardous to the
380 health of your pool and should only be used as a last resort.
382 Specify the txg to use for rollback.
386 about pool recovery mode, see the
390 This option can be extremely hazardous to the
391 health of your pool and should only be used as a last resort.
398 Temporary pool names last until export.
399 Ensures that the original pool name will be used
400 in all label updates and therefore is retained upon export.
402 .Fl o Sy cachefile Ns = Ns Sy none
403 when not explicitly specified.