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 https://opensource.org/licenses/CDDL-1.0.
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.
77 options are not specified, this command searches for devices using libblkid
82 option can be specified multiple times, and all directories are searched.
83 If the device appears to be part of an exported pool, this command displays a
84 summary of the pool with the name of the pool, a numeric identifier, as well as
85 the vdev layout and current health of the device for each device or file.
86 Destroyed pools, pools that were previously destroyed with the
88 command, are not listed unless the
92 The numeric identifier is unique, and can be used instead of the pool name when
93 multiple exported pools of the same name are available.
96 Reads configuration from the given
98 that was created with the
103 is used instead of searching for devices.
104 .It Fl d Ar dir Ns | Ns Ar device
107 or searches for devices or files in
111 option can be specified multiple times.
113 Lists destroyed pools only.
121 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns Ar device
123 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns …
127 Imports all pools found in the search directories.
128 Identical to the previous command, except that all pools with a sufficient
129 number of devices available are imported.
130 Destroyed pools, pools that were previously destroyed with the
132 command, will not be imported unless the
137 Searches for and imports all pools found.
138 .It Fl c Ar cachefile
139 Reads configuration from the given
141 that was created with the
146 is used instead of searching for devices.
147 .It Fl d Ar dir Ns | Ns Ar device
150 or searches for devices or files in
154 option can be specified multiple times.
155 This option is incompatible with the
159 Imports destroyed pools only.
162 option is also required.
164 Forces import, even if the pool appears to be potentially active.
166 Recovery mode for a non-importable pool.
167 Attempt to return the pool to an importable state by discarding the last few
169 Not all damaged pools can be recovered by using this option.
170 If successful, the data from the discarded transactions is irretrievably lost.
171 This option is ignored if the pool is importable or already imported.
173 Indicates that this command will request encryption keys for all encrypted
174 datasets it attempts to mount as it is bringing the pool online.
175 Note that if any datasets have a
179 this command will block waiting for the keys to be entered.
181 encrypted datasets will be left unavailable until the keys are loaded.
183 Allows a pool to import when there is a missing log device.
184 Recent transactions can be lost because the log device will be discarded.
189 Determines whether a non-importable pool can be made importable again, but does
190 not actually perform the pool recovery.
191 For more details about pool recovery mode, see the
195 Import the pool without mounting any file systems.
197 Comma-separated list of mount options to use when mounting datasets within the
201 for a description of dataset properties and mount options.
202 .It Fl o Ar property Ns = Ns Ar value
203 Sets the specified property on the imported pool.
206 manual page for more information on the available pool properties.
216 .It Fl -rewind-to-checkpoint
217 Rewinds pool to the checkpointed state.
218 Once the pool is imported with this flag there is no way to undo the rewind.
219 All changes and data that were written after the checkpoint are lost!
220 The only exception is when the
222 mounting option is enabled.
223 In this case, the checkpointed state of the pool is opened and an
224 administrator can see how the pool would look like if they were
227 Scan using the default search path, the libblkid cache will not be
229 A custom search path may be specified by setting the
230 .Sy ZPOOL_IMPORT_PATH
231 environment variable.
236 Determines whether extreme measures to find a valid txg should take place.
237 This allows the pool to
238 be rolled back to a txg which is no longer guaranteed to be consistent.
239 Pools imported at an inconsistent txg may contain uncorrectable checksum errors.
240 For more details about pool recovery mode, see the
243 WARNING: This option can be extremely hazardous to the
244 health of your pool and should only be used as a last resort.
246 Specify the txg to use for rollback.
250 about pool recovery mode, see the
253 WARNING: This option can be extremely hazardous to the
254 health of your pool and should only be used as a last resort.
261 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns Ar device
263 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns …
266 .Ar pool Ns | Ns Ar id
269 Imports a specific pool.
270 A pool can be identified by its name or the numeric identifier.
273 is specified, the pool is imported using the name
275 Otherwise, it is imported with the same name as its exported name.
277 If a device is removed from a system without running
279 first, the device appears as potentially active.
280 It cannot be determined if this was a failed export, or whether the device is
281 really in use from another host.
282 To import a pool in this state, the
286 .It Fl c Ar cachefile
287 Reads configuration from the given
289 that was created with the
294 is used instead of searching for devices.
295 .It Fl d Ar dir Ns | Ns Ar device
298 or searches for devices or files in
302 option can be specified multiple times.
303 This option is incompatible with the
307 Imports destroyed pool.
310 option is also required.
312 Forces import, even if the pool appears to be potentially active.
314 Recovery mode for a non-importable pool.
315 Attempt to return the pool to an importable state by discarding the last few
317 Not all damaged pools can be recovered by using this option.
318 If successful, the data from the discarded transactions is irretrievably lost.
319 This option is ignored if the pool is importable or already imported.
321 Indicates that this command will request encryption keys for all encrypted
322 datasets it attempts to mount as it is bringing the pool online.
323 Note that if any datasets have a
327 this command will block waiting for the keys to be entered.
329 encrypted datasets will be left unavailable until the keys are loaded.
331 Allows a pool to import when there is a missing log device.
332 Recent transactions can be lost because the log device will be discarded.
337 Determines whether a non-importable pool can be made importable again, but does
338 not actually perform the pool recovery.
339 For more details about pool recovery mode, see the
343 Comma-separated list of mount options to use when mounting datasets within the
347 for a description of dataset properties and mount options.
348 .It Fl o Ar property Ns = Ns Ar value
349 Sets the specified property on the imported pool.
352 manual page for more information on the available pool properties.
363 Scan using the default search path, the libblkid cache will not be
365 A custom search path may be specified by setting the
366 .Sy ZPOOL_IMPORT_PATH
367 environment variable.
372 Determines whether extreme measures to find a valid txg should take place.
373 This allows the pool to
374 be rolled back to a txg which is no longer guaranteed to be consistent.
375 Pools imported at an inconsistent txg may contain uncorrectable
377 For more details about pool recovery mode, see the
380 WARNING: This option can be extremely hazardous to the
381 health of your pool and should only be used as a last resort.
383 Specify the txg to use for rollback.
387 about pool recovery mode, see the
391 This option can be extremely hazardous to the
392 health of your pool and should only be used as a last resort.
399 Temporary pool names last until export.
400 Ensures that the original pool name will be used
401 in all label updates and therefore is retained upon export.
403 .Fl o Sy cachefile Ns = Ns Sy none
404 when not explicitly specified.
409 .\" These are, respectively, examples 9 from zpool.8
410 .\" Make sure to update them bidirectionally
411 .Ss Example 9 : No Importing a ZFS Storage Pool
412 The following command displays available pools, and then imports the pool
414 for use on the system.
415 The results from this command are similar to the following:
416 .Bd -literal -compact -offset Ds
417 .No # Nm zpool Cm import
419 id: 15451357997522795478
421 action: The pool can be imported using its name or numeric identifier.
429 .No # Nm zpool Cm import Ar tank