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