Add "compatibility" property for zpool feature sets
[zfs.git] / man / man8 / zpool-import.8
blobac349574309e5c6739affd0c45151215d0eac0d6
1 .\"
2 .\" CDDL HEADER START
3 .\"
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.
7 .\"
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.
12 .\"
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]
18 .\"
19 .\" CDDL HEADER END
20 .\"
21 .\"
22 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
23 .\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
24 .\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
25 .\" Copyright (c) 2017 Datto Inc.
26 .\" Copyright (c) 2018 George Melikov. All Rights Reserved.
27 .\" Copyright 2017 Nexenta Systems, Inc.
28 .\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
29 .\"
30 .Dd August 9, 2019
31 .Dt ZPOOL-IMPORT 8
32 .Os
33 .Sh NAME
34 .Nm zpool-import
35 .Nd Lists ZFS storage pools available to import or import the specified pools
36 .Sh SYNOPSIS
37 .Nm zpool
38 .Cm import
39 .Op Fl D
40 .Op Fl d Ar dir Ns | Ns device
41 .Nm zpool
42 .Cm import
43 .Fl a
44 .Op Fl DflmN
45 .Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
46 .Op Fl -rewind-to-checkpoint
47 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns device
48 .Op Fl o Ar mntopts
49 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
50 .Op Fl R Ar root
51 .Nm zpool
52 .Cm import
53 .Op Fl Dflm
54 .Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
55 .Op Fl -rewind-to-checkpoint
56 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns device
57 .Op Fl o Ar mntopts
58 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
59 .Op Fl R Ar root
60 .Op Fl s
61 .Ar pool Ns | Ns Ar id
62 .Op Ar newpool Oo Fl t Oc
63 .Sh DESCRIPTION
64 .Bl -tag -width Ds
65 .It Xo
66 .Nm zpool
67 .Cm import
68 .Op Fl D
69 .Op Fl d Ar dir Ns | Ns device
70 .Xc
71 Lists pools available to import.
72 If the
73 .Fl d or
74 .Fl c
75 options are not specified, this command searches for devices using libblkid
76 on Linux and geom on FreeBSD.
77 The
78 .Fl d
79 option can be specified multiple times, and all directories are searched.
80 If the device appears to be part of an exported pool, this command displays a
81 summary of the pool with the name of the pool, a numeric identifier, as well as
82 the vdev layout and current health of the device for each device or file.
83 Destroyed pools, pools that were previously destroyed with the
84 .Nm zpool Cm destroy
85 command, are not listed unless the
86 .Fl D
87 option is specified.
88 .Pp
89 The numeric identifier is unique, and can be used instead of the pool name when
90 multiple exported pools of the same name are available.
91 .Bl -tag -width Ds
92 .It Fl c Ar cachefile
93 Reads configuration from the given
94 .Ar cachefile
95 that was created with the
96 .Sy cachefile
97 pool property.
98 This
99 .Ar cachefile
100 is used instead of searching for devices.
101 .It Fl d Ar dir Ns | Ns Ar device
102 Uses
103 .Ar device
104 or searches for devices or files in
105 .Ar dir .
107 .Fl d
108 option can be specified multiple times.
109 .It Fl D
110 Lists destroyed pools only.
112 .It Xo
113 .Nm zpool
114 .Cm import
115 .Fl a
116 .Op Fl DflmN
117 .Op Fl F Oo Fl n Oc Oo Fl T Oc Oo Fl X Oc
118 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns device
119 .Op Fl o Ar mntopts
120 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
121 .Op Fl R Ar root
122 .Op Fl s
124 Imports all pools found in the search directories.
125 Identical to the previous command, except that all pools with a sufficient
126 number of devices available are imported.
127 Destroyed pools, pools that were previously destroyed with the
128 .Nm zpool Cm destroy
129 command, will not be imported unless the
130 .Fl D
131 option is specified.
132 .Bl -tag -width Ds
133 .It Fl a
134 Searches for and imports all pools found.
135 .It Fl c Ar cachefile
136 Reads configuration from the given
137 .Ar cachefile
138 that was created with the
139 .Sy cachefile
140 pool property.
141 This
142 .Ar cachefile
143 is used instead of searching for devices.
144 .It Fl d Ar dir Ns | Ns Ar device
145 Uses
146 .Ar device
147 or searches for devices or files in
148 .Ar dir .
150 .Fl d
151 option can be specified multiple times.
152 This option is incompatible with the
153 .Fl c
154 option.
155 .It Fl D
156 Imports destroyed pools only.
158 .Fl f
159 option is also required.
160 .It Fl f
161 Forces import, even if the pool appears to be potentially active.
162 .It Fl F
163 Recovery mode for a non-importable pool.
164 Attempt to return the pool to an importable state by discarding the last few
165 transactions.
166 Not all damaged pools can be recovered by using this option.
167 If successful, the data from the discarded transactions is irretrievably lost.
168 This option is ignored if the pool is importable or already imported.
169 .It Fl l
170 Indicates that this command will request encryption keys for all encrypted
171 datasets it attempts to mount as it is bringing the pool online. Note that if
172 any datasets have a
173 .Sy keylocation
175 .Sy prompt
176 this command will block waiting for the keys to be entered. Without this flag
177 encrypted datasets will be left unavailable until the keys are loaded.
178 .It Fl m
179 Allows a pool to import when there is a missing log device.
180 Recent transactions can be lost because the log device will be discarded.
181 .It Fl n
182 Used with the
183 .Fl F
184 recovery option.
185 Determines whether a non-importable pool can be made importable again, but does
186 not actually perform the pool recovery.
187 For more details about pool recovery mode, see the
188 .Fl F
189 option, above.
190 .It Fl N
191 Import the pool without mounting any file systems.
192 .It Fl o Ar mntopts
193 Comma-separated list of mount options to use when mounting datasets within the
194 pool.
196 .Xr zfs 8
197 for a description of dataset properties and mount options.
198 .It Fl o Ar property Ns = Ns Ar value
199 Sets the specified property on the imported pool.
200 See the
201 .Xr zpoolprops
202 manual page for more information on the available pool properties.
203 .It Fl R Ar root
204 Sets the
205 .Sy cachefile
206 property to
207 .Sy none
208 and the
209 .Sy altroot
210 property to
211 .Ar root .
212 .It Fl -rewind-to-checkpoint
213 Rewinds pool to the checkpointed state.
214 Once the pool is imported with this flag there is no way to undo the rewind.
215 All changes and data that were written after the checkpoint are lost!
216 The only exception is when the
217 .Sy readonly
218 mounting option is enabled.
219 In this case, the checkpointed state of the pool is opened and an
220 administrator can see how the pool would look like if they were
221 to fully rewind.
222 .It Fl s
223 Scan using the default search path, the libblkid cache will not be
224 consulted. A custom search path may be specified by setting the
225 ZPOOL_IMPORT_PATH environment variable.
226 .It Fl X
227 Used with the
228 .Fl F
229 recovery option. Determines whether extreme
230 measures to find a valid txg should take place. This allows the pool to
231 be rolled back to a txg which is no longer guaranteed to be consistent.
232 Pools imported at an inconsistent txg may contain uncorrectable
233 checksum errors. For more details about pool recovery mode, see the
234 .Fl F
235 option, above. WARNING: This option can be extremely hazardous to the
236 health of your pool and should only be used as a last resort.
237 .It Fl T
238 Specify the txg to use for rollback. Implies
239 .Fl FX .
240 For more details
241 about pool recovery mode, see the
242 .Fl X
243 option, above. WARNING: This option can be extremely hazardous to the
244 health of your pool and should only be used as a last resort.
246 .It Xo
247 .Nm zpool
248 .Cm import
249 .Op Fl Dflm
250 .Op Fl F Oo Fl n Oc Oo Fl t Oc Oo Fl T Oc Oo Fl X Oc
251 .Op Fl c Ar cachefile Ns | Ns Fl d Ar dir Ns | Ns device
252 .Op Fl o Ar mntopts
253 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
254 .Op Fl R Ar root
255 .Op Fl s
256 .Ar pool Ns | Ns Ar id
257 .Op Ar newpool
259 Imports a specific pool.
260 A pool can be identified by its name or the numeric identifier.
262 .Ar newpool
263 is specified, the pool is imported using the name
264 .Ar newpool .
265 Otherwise, it is imported with the same name as its exported name.
267 If a device is removed from a system without running
268 .Nm zpool Cm export
269 first, the device appears as potentially active.
270 It cannot be determined if this was a failed export, or whether the device is
271 really in use from another host.
272 To import a pool in this state, the
273 .Fl f
274 option is required.
275 .Bl -tag -width Ds
276 .It Fl c Ar cachefile
277 Reads configuration from the given
278 .Ar cachefile
279 that was created with the
280 .Sy cachefile
281 pool property.
282 This
283 .Ar cachefile
284 is used instead of searching for devices.
285 .It Fl d Ar dir Ns | Ns Ar device
286 Uses
287 .Ar device
288 or searches for devices or files in
289 .Ar dir .
291 .Fl d
292 option can be specified multiple times.
293 This option is incompatible with the
294 .Fl c
295 option.
296 .It Fl D
297 Imports destroyed pool.
299 .Fl f
300 option is also required.
301 .It Fl f
302 Forces import, even if the pool appears to be potentially active.
303 .It Fl F
304 Recovery mode for a non-importable pool.
305 Attempt to return the pool to an importable state by discarding the last few
306 transactions.
307 Not all damaged pools can be recovered by using this option.
308 If successful, the data from the discarded transactions is irretrievably lost.
309 This option is ignored if the pool is importable or already imported.
310 .It Fl l
311 Indicates that this command will request encryption keys for all encrypted
312 datasets it attempts to mount as it is bringing the pool online. Note that if
313 any datasets have a
314 .Sy keylocation
316 .Sy prompt
317 this command will block waiting for the keys to be entered. Without this flag
318 encrypted datasets will be left unavailable until the keys are loaded.
319 .It Fl m
320 Allows a pool to import when there is a missing log device.
321 Recent transactions can be lost because the log device will be discarded.
322 .It Fl n
323 Used with the
324 .Fl F
325 recovery option.
326 Determines whether a non-importable pool can be made importable again, but does
327 not actually perform the pool recovery.
328 For more details about pool recovery mode, see the
329 .Fl F
330 option, above.
331 .It Fl o Ar mntopts
332 Comma-separated list of mount options to use when mounting datasets within the
333 pool.
335 .Xr zfs 8
336 for a description of dataset properties and mount options.
337 .It Fl o Ar property Ns = Ns Ar value
338 Sets the specified property on the imported pool.
339 See the
340 .Xr zpoolprops
341 manual page for more information on the available pool properties.
342 .It Fl R Ar root
343 Sets the
344 .Sy cachefile
345 property to
346 .Sy none
347 and the
348 .Sy altroot
349 property to
350 .Ar root .
351 .It Fl s
352 Scan using the default search path, the libblkid cache will not be
353 consulted. A custom search path may be specified by setting the
354 ZPOOL_IMPORT_PATH environment variable.
355 .It Fl X
356 Used with the
357 .Fl F
358 recovery option. Determines whether extreme
359 measures to find a valid txg should take place. This allows the pool to
360 be rolled back to a txg which is no longer guaranteed to be consistent.
361 Pools imported at an inconsistent txg may contain uncorrectable
362 checksum errors. For more details about pool recovery mode, see the
363 .Fl F
364 option, above. WARNING: This option can be extremely hazardous to the
365 health of your pool and should only be used as a last resort.
366 .It Fl T
367 Specify the txg to use for rollback. Implies
368 .Fl FX .
369 For more details
370 about pool recovery mode, see the
371 .Fl X
372 option, above. WARNING: This option can be extremely hazardous to the
373 health of your pool and should only be used as a last resort.
374 .It Fl t
375 Used with
376 .Sy newpool .
377 Specifies that
378 .Sy newpool
379 is temporary. Temporary pool names last until export. Ensures that
380 the original pool name will be used in all label updates and therefore
381 is retained upon export.
382 Will also set -o cachefile=none when not explicitly specified.
385 .Sh SEE ALSO
386 .Xr zpool-export 8 ,
387 .Xr zpool-list 8 ,
388 .Xr zpool-status 8