]> git.proxmox.com Git - mirror_zfs.git/blob - man/man8/zpool.8
Illumos 4976-4984 - metaslab improvements
[mirror_zfs.git] / man / man8 / zpool.8
1 '\" te
2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 2011 Nexenta Systems, Inc. All rights reserved.
4 .\" Copyright (c) 2013 by Delphix. All rights reserved.
5 .\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
6 .\" The contents of this file are subject to the terms of the Common Development
7 .\" and Distribution License (the "License"). You may not use this file except
8 .\" in compliance with the License. You can obtain a copy of the license at
9 .\" usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
10 .\"
11 .\" See the License for the specific language governing permissions and
12 .\" limitations under the License. When distributing Covered Code, include this
13 .\" CDDL HEADER in each file and include the License file at
14 .\" usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this
15 .\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your
16 .\" own identifying information:
17 .\" Portions Copyright [yyyy] [name of copyright owner]
18 .TH zpool 8 "14 December 2012" "ZFS pool 28, filesystem 5" "System Administration Commands"
19 .SH NAME
20 zpool \- configures ZFS storage pools
21 .SH SYNOPSIS
22 .LP
23 .nf
24 \fBzpool\fR [\fB-?\fR]
25 .fi
26
27 .LP
28 .nf
29 \fBzpool add\fR [\fB-fn\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIvdev\fR ...
30 .fi
31
32 .LP
33 .nf
34 \fBzpool attach\fR [\fB-f\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR
35 .fi
36
37 .LP
38 .nf
39 \fBzpool clear\fR \fIpool\fR [\fIdevice\fR]
40 .fi
41
42 .LP
43 .nf
44 \fBzpool create\fR [\fB-fnd\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-O\fR \fIfile-system-property=value\fR]
45 ... [\fB-m\fR \fImountpoint\fR] [\fB-R\fR \fIroot\fR] \fIpool\fR \fIvdev\fR ...
46 .fi
47
48 .LP
49 .nf
50 \fBzpool destroy\fR [\fB-f\fR] \fIpool\fR
51 .fi
52
53 .LP
54 .nf
55 \fBzpool detach\fR \fIpool\fR \fIdevice\fR
56 .fi
57
58 .LP
59 .nf
60 \fBzpool export\fR [\fB-f\fR] \fIpool\fR ...
61 .fi
62
63 .LP
64 .nf
65 \fBzpool get\fR [\fB-pH\fR] "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...
66 .fi
67
68 .LP
69 .nf
70 \fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...
71 .fi
72
73 .LP
74 .nf
75 \fBzpool import\fR [\fB-d\fR \fIdir\fR] [\fB-D\fR]
76 .fi
77
78 .LP
79 .nf
80 \fBzpool import\fR [\fB-o \fImntopts\fR\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
81 [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-N\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR] [\fB-X\fR\] [\fB-T\fR\]] \fB-a\fR
82 .fi
83
84 .LP
85 .nf
86 \fBzpool import\fR [\fB-o \fImntopts\fR\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
87 [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR] [\fB-X\fR] [\fB-T\fR\]] [\fB-t\fR]] \fIpool\fR |\fIid\fR [\fInewpool\fR]
88 .fi
89
90 .LP
91 .nf
92 \fBzpool iostat\fR [\fB-T\fR d | u ] [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]
93 .fi
94
95 .LP
96 .nf
97 \fBzpool labelclear\fR [\fB-f\fR] \fIdevice\fR
98 .fi
99
100 .LP
101 .nf
102 \fBzpool list\fR [\fB-T\fR d | u ] [\fB-Hv\fR] [\fB-o\fR \fIproperty\fR[,...]] [\fIpool\fR] ...
103 [\fIinterval\fR[\fIcount\fR]]
104 .fi
105
106 .LP
107 .nf
108 \fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...
109 .fi
110
111 .LP
112 .nf
113 \fBzpool online\fR \fIpool\fR \fIdevice\fR ...
114 .fi
115
116 .LP
117 .nf
118 \fBzpool reguid\fR \fIpool\fR
119 .fi
120
121 .LP
122 .nf
123 \fBzpool reopen\fR \fIpool\fR
124 .fi
125
126 .LP
127 .nf
128 \fBzpool remove\fR \fIpool\fR \fIdevice\fR ...
129 .fi
130
131 .LP
132 .nf
133 \fBzpool replace\fR [\fB-f\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIdevice\fR [\fInew_device\fR]
134 .fi
135
136 .LP
137 .nf
138 \fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...
139 .fi
140
141 .LP
142 .nf
143 \fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR
144 .fi
145
146 .LP
147 .nf
148 \fBzpool split\fR [\fB-n\fR] [\fB-R\fR \fIaltroot\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fInewpool\fR [\fIdevice\fR ...]
149 .fi
150
151 .LP
152 .nf
153 \fBzpool status\fR [\fB-xvD\fR] [\fB-T\fR d | u] [\fIpool\fR] ... [\fIinterval\fR [\fIcount\fR]]
154 .fi
155
156 .LP
157 .nf
158 \fBzpool upgrade\fR
159 .fi
160
161 .LP
162 .nf
163 \fBzpool upgrade\fR \fB-v\fR
164 .fi
165
166 .LP
167 .nf
168 \fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...
169 .fi
170
171 .SH DESCRIPTION
172 .sp
173 .LP
174 The \fBzpool\fR command configures \fBZFS\fR storage pools. A storage pool is a collection of devices that provides physical storage and data replication for \fBZFS\fR datasets.
175 .sp
176 .LP
177 All datasets within a storage pool share the same space. See \fBzfs\fR(8) for information on managing datasets.
178 .SS "Virtual Devices (\fBvdev\fRs)"
179 .sp
180 .LP
181 A "virtual device" describes a single device or a collection of devices organized according to certain performance and fault characteristics. The following virtual devices are supported:
182 .sp
183 .ne 2
184 .mk
185 .na
186 \fB\fBdisk\fR\fR
187 .ad
188 .RS 10n
189 .rt
190 A block device, typically located under \fB/dev\fR. \fBZFS\fR can use individual partitions, though the recommended mode of operation is to use whole disks. A disk can be specified by a full path, or it can be a shorthand name (the relative portion of the path under "/dev"). For example, "sda" is equivalent to "/dev/sda". A whole disk can be specified by omitting the partition designation. When given a whole disk, \fBZFS\fR automatically labels the disk, if necessary.
191 .RE
192
193 .sp
194 .ne 2
195 .mk
196 .na
197 \fB\fBfile\fR\fR
198 .ad
199 .RS 10n
200 .rt
201 A regular file. The use of files as a backing store is strongly discouraged. It is designed primarily for experimental purposes, as the fault tolerance of a file is only as good as the file system of which it is a part. A file must be specified by a full path.
202 .RE
203
204 .sp
205 .ne 2
206 .mk
207 .na
208 \fB\fBmirror\fR\fR
209 .ad
210 .RS 10n
211 .rt
212 A mirror of two or more devices. Data is replicated in an identical fashion across all components of a mirror. A mirror with \fIN\fR disks of size \fIX\fR can hold \fIX\fR bytes and can withstand (\fIN-1\fR) devices failing before data integrity is compromised.
213 .RE
214
215 .sp
216 .ne 2
217 .mk
218 .na
219 \fB\fBraidz\fR\fR
220 .ad
221 .br
222 .na
223 \fB\fBraidz1\fR\fR
224 .ad
225 .br
226 .na
227 \fB\fBraidz2\fR\fR
228 .ad
229 .br
230 .na
231 \fB\fBraidz3\fR\fR
232 .ad
233 .RS 10n
234 .rt
235 A variation on \fBRAID-5\fR that allows for better distribution of parity and eliminates the "\fBRAID-5\fR write hole" (in which data and parity become inconsistent after a power loss). Data and parity is striped across all disks within a \fBraidz\fR group.
236 .sp
237 A \fBraidz\fR group can have single-, double- , or triple parity, meaning that the \fBraidz\fR group can sustain one, two, or three failures, respectively, without losing any data. The \fBraidz1\fR \fBvdev\fR type specifies a single-parity \fBraidz\fR group; the \fBraidz2\fR \fBvdev\fR type specifies a double-parity \fBraidz\fR group; and the \fBraidz3\fR \fBvdev\fR type specifies a triple-parity \fBraidz\fR group. The \fBraidz\fR \fBvdev\fR type is an alias for \fBraidz1\fR.
238 .sp
239 A \fBraidz\fR group with \fIN\fR disks of size \fIX\fR with \fIP\fR parity disks can hold approximately (\fIN-P\fR)*\fIX\fR bytes and can withstand \fIP\fR device(s) failing before data integrity is compromised. The minimum number of devices in a \fBraidz\fR group is one more than the number of parity disks. The recommended number is between 3 and 9 to help increase performance.
240 .RE
241
242 .sp
243 .ne 2
244 .mk
245 .na
246 \fB\fBspare\fR\fR
247 .ad
248 .RS 10n
249 .rt
250 A special pseudo-\fBvdev\fR which keeps track of available hot spares for a pool. For more information, see the "Hot Spares" section.
251 .RE
252
253 .sp
254 .ne 2
255 .mk
256 .na
257 \fB\fBlog\fR\fR
258 .ad
259 .RS 10n
260 .rt
261 A separate-intent log device. If more than one log device is specified, then writes are load-balanced between devices. Log devices can be mirrored. However, \fBraidz\fR \fBvdev\fR types are not supported for the intent log. For more information, see the "Intent Log" section.
262 .RE
263
264 .sp
265 .ne 2
266 .mk
267 .na
268 \fB\fBcache\fR\fR
269 .ad
270 .RS 10n
271 .rt
272 A device used to cache storage pool data. A cache device cannot be configured as a mirror or \fBraidz\fR group. For more information, see the "Cache Devices" section.
273 .RE
274
275 .sp
276 .LP
277 Virtual devices cannot be nested, so a mirror or \fBraidz\fR virtual device can only contain files or disks. Mirrors of mirrors (or other combinations) are not allowed.
278 .sp
279 .LP
280 A pool can have any number of virtual devices at the top of the configuration (known as "root vdevs"). Data is dynamically distributed across all top-level devices to balance data among devices. As new virtual devices are added, \fBZFS\fR automatically places data on the newly available devices.
281 .sp
282 .LP
283 Virtual devices are specified one at a time on the command line, separated by whitespace. The keywords "mirror" and "raidz" are used to distinguish where a group ends and another begins. For example, the following creates two root vdevs, each a mirror of two disks:
284 .sp
285 .in +2
286 .nf
287 # \fBzpool create mypool mirror sda sdb mirror sdc sdd\fR
288 .fi
289 .in -2
290 .sp
291
292 .SS "Device Failure and Recovery"
293 .sp
294 .LP
295 \fBZFS\fR supports a rich set of mechanisms for handling device failure and data corruption. All metadata and data is checksummed, and \fBZFS\fR automatically repairs bad data from a good copy when corruption is detected.
296 .sp
297 .LP
298 In order to take advantage of these features, a pool must make use of some form of redundancy, using either mirrored or \fBraidz\fR groups. While \fBZFS\fR supports running in a non-redundant configuration, where each root vdev is simply a disk or file, this is strongly discouraged. A single case of bit corruption can render some or all of your data unavailable.
299 .sp
300 .LP
301 A pool's health status is described by one of three states: online, degraded, or faulted. An online pool has all devices operating normally. A degraded pool is one in which one or more devices have failed, but the data is still available due to a redundant configuration. A faulted pool has corrupted metadata, or one or more faulted devices, and insufficient replicas to continue functioning.
302 .sp
303 .LP
304 The health of the top-level vdev, such as mirror or \fBraidz\fR device, is potentially impacted by the state of its associated vdevs, or component devices. A top-level vdev or component device is in one of the following states:
305 .sp
306 .ne 2
307 .mk
308 .na
309 \fB\fBDEGRADED\fR\fR
310 .ad
311 .RS 12n
312 .rt
313 One or more top-level vdevs is in the degraded state because one or more component devices are offline. Sufficient replicas exist to continue functioning.
314 .sp
315 One or more component devices is in the degraded or faulted state, but sufficient replicas exist to continue functioning. The underlying conditions are as follows:
316 .RS +4
317 .TP
318 .ie t \(bu
319 .el o
320 The number of checksum errors exceeds acceptable levels and the device is degraded as an indication that something may be wrong. \fBZFS\fR continues to use the device as necessary.
321 .RE
322 .RS +4
323 .TP
324 .ie t \(bu
325 .el o
326 The number of I/O errors exceeds acceptable levels. The device could not be marked as faulted because there are insufficient replicas to continue functioning.
327 .RE
328 .RE
329
330 .sp
331 .ne 2
332 .mk
333 .na
334 \fB\fBFAULTED\fR\fR
335 .ad
336 .RS 12n
337 .rt
338 One or more top-level vdevs is in the faulted state because one or more component devices are offline. Insufficient replicas exist to continue functioning.
339 .sp
340 One or more component devices is in the faulted state, and insufficient replicas exist to continue functioning. The underlying conditions are as follows:
341 .RS +4
342 .TP
343 .ie t \(bu
344 .el o
345 The device could be opened, but the contents did not match expected values.
346 .RE
347 .RS +4
348 .TP
349 .ie t \(bu
350 .el o
351 The number of I/O errors exceeds acceptable levels and the device is faulted to prevent further use of the device.
352 .RE
353 .RE
354
355 .sp
356 .ne 2
357 .mk
358 .na
359 \fB\fBOFFLINE\fR\fR
360 .ad
361 .RS 12n
362 .rt
363 The device was explicitly taken offline by the "\fBzpool offline\fR" command.
364 .RE
365
366 .sp
367 .ne 2
368 .mk
369 .na
370 \fB\fBONLINE\fR\fR
371 .ad
372 .RS 12n
373 .rt
374 The device is online and functioning.
375 .RE
376
377 .sp
378 .ne 2
379 .mk
380 .na
381 \fB\fBREMOVED\fR\fR
382 .ad
383 .RS 12n
384 .rt
385 The device was physically removed while the system was running. Device removal detection is hardware-dependent and may not be supported on all platforms.
386 .RE
387
388 .sp
389 .ne 2
390 .mk
391 .na
392 \fB\fBUNAVAIL\fR\fR
393 .ad
394 .RS 12n
395 .rt
396 The device could not be opened. If a pool is imported when a device was unavailable, then the device will be identified by a unique identifier instead of its path since the path was never correct in the first place.
397 .RE
398
399 .sp
400 .LP
401 If a device is removed and later re-attached to the system, \fBZFS\fR attempts to put the device online automatically. Device attach detection is hardware-dependent and might not be supported on all platforms.
402 .SS "Hot Spares"
403 .sp
404 .LP
405 \fBZFS\fR allows devices to be associated with pools as "hot spares". These devices are not actively used in the pool, but when an active device fails, it is automatically replaced by a hot spare. To create a pool with hot spares, specify a "spare" \fBvdev\fR with any number of devices. For example,
406 .sp
407 .in +2
408 .nf
409 # zpool create pool mirror sda sdb spare sdc sdd
410 .fi
411 .in -2
412 .sp
413
414 .sp
415 .LP
416 Spares can be shared across multiple pools, and can be added with the "\fBzpool add\fR" command and removed with the "\fBzpool remove\fR" command. Once a spare replacement is initiated, a new "spare" \fBvdev\fR is created within the configuration that will remain there until the original device is replaced. At this point, the hot spare becomes available again.
417 .sp
418 .LP
419 If a pool has a shared spare that is currently being used, the pool can not be exported since other pools may use this shared spare, which may lead to potential data corruption.
420 .sp
421 .LP
422 An in-progress spare replacement can be cancelled by detaching the hot spare. If the original faulted device is detached, then the hot spare assumes its place in the configuration, and is removed from the spare list of all active pools.
423 .sp
424 .LP
425 Spares cannot replace log devices.
426 .SS "Intent Log"
427 .sp
428 .LP
429 The \fBZFS\fR Intent Log (\fBZIL\fR) satisfies \fBPOSIX\fR requirements for synchronous transactions. For instance, databases often require their transactions to be on stable storage devices when returning from a system call. \fBNFS\fR and other applications can also use \fBfsync\fR() to ensure data stability. By default, the intent log is allocated from blocks within the main pool. However, it might be possible to get better performance using separate intent log devices such as \fBNVRAM\fR or a dedicated disk. For example:
430 .sp
431 .in +2
432 .nf
433 \fB# zpool create pool sda sdb log sdc\fR
434 .fi
435 .in -2
436 .sp
437
438 .sp
439 .LP
440 Multiple log devices can also be specified, and they can be mirrored. See the EXAMPLES section for an example of mirroring multiple log devices.
441 .sp
442 .LP
443 Log devices can be added, replaced, attached, detached, and imported and exported as part of the larger pool. Mirrored log devices can be removed by specifying the top-level mirror for the log.
444 .SS "Cache Devices"
445 .sp
446 .LP
447 Devices can be added to a storage pool as "cache devices." These devices provide an additional layer of caching between main memory and disk. For read-heavy workloads, where the working set size is much larger than what can be cached in main memory, using cache devices allow much more of this working set to be served from low latency media. Using cache devices provides the greatest performance improvement for random read-workloads of mostly static content.
448 .sp
449 .LP
450 To create a pool with cache devices, specify a "cache" \fBvdev\fR with any number of devices. For example:
451 .sp
452 .in +2
453 .nf
454 \fB# zpool create pool sda sdb cache sdc sdd\fR
455 .fi
456 .in -2
457 .sp
458
459 .sp
460 .LP
461 Cache devices cannot be mirrored or part of a \fBraidz\fR configuration. If a read error is encountered on a cache device, that read \fBI/O\fR is reissued to the original storage pool device, which might be part of a mirrored or \fBraidz\fR configuration.
462 .sp
463 .LP
464 The content of the cache devices is considered volatile, as is the case with other system caches.
465 .SS "Properties"
466 .sp
467 .LP
468 Each pool has several properties associated with it. Some properties are read-only statistics while others are configurable and change the behavior of the pool. The following are read-only properties:
469 .sp
470 .ne 2
471 .mk
472 .na
473 \fB\fBavailable\fR\fR
474 .ad
475 .RS 20n
476 .rt
477 Amount of storage available within the pool. This property can also be referred to by its shortened column name, "avail".
478 .RE
479
480 .sp
481 .ne 2
482 .mk
483 .na
484 \fB\fBcapacity\fR\fR
485 .ad
486 .RS 20n
487 .rt
488 Percentage of pool space used. This property can also be referred to by its shortened column name, "cap".
489 .RE
490
491 .sp
492 .ne 2
493 .mk
494 .na
495 \fB\fBexpandsize\fR\fR
496 .ad
497 .RS 20n
498 .rt
499 Amount of uninitialized space within the pool or device that can be used to
500 increase the total capacity of the pool. Uninitialized space consists of
501 any space on an EFI labeled vdev which has not been brought online
502 (i.e. zpool online -e). This space occurs when a LUN is dynamically expanded.
503 .RE
504
505 .sp
506 .ne 2
507 .mk
508 .na
509 \fB\fBfragmentation\fR\fR
510 .ad
511 .RS 20n
512 .rt
513 The amount of fragmentation in the pool.
514 .RE
515
516 .sp
517 .ne 2
518 .mk
519 .na
520 \fB\fBfree\fR\fR
521 .ad
522 .RS 20n
523 .rt
524 The amount of free space available in the pool.
525 .RE
526
527 .sp
528 .ne 2
529 .mk
530 .na
531 \fB\fBfreeing\fR\fR
532 .ad
533 .RS 20n
534 .rt
535 After a file system or snapshot is destroyed, the space it was using is
536 returned to the pool asynchronously. \fB\fBfreeing\fR\fR is the amount of
537 space remaining to be reclaimed. Over time \fB\fBfreeing\fR\fR will decrease
538 while \fB\fBfree\fR\fR increases.
539 .RE
540
541 .sp
542 .ne 2
543 .mk
544 .na
545 \fB\fBhealth\fR\fR
546 .ad
547 .RS 20n
548 .rt
549 The current health of the pool. Health can be "\fBONLINE\fR", "\fBDEGRADED\fR", "\fBFAULTED\fR", " \fBOFFLINE\fR", "\fBREMOVED\fR", or "\fBUNAVAIL\fR".
550 .RE
551
552 .sp
553 .ne 2
554 .mk
555 .na
556 \fB\fBguid\fR\fR
557 .ad
558 .RS 20n
559 .rt
560 A unique identifier for the pool.
561 .RE
562
563 .sp
564 .ne 2
565 .mk
566 .na
567 \fB\fBsize\fR\fR
568 .ad
569 .RS 20n
570 .rt
571 Total size of the storage pool.
572 .RE
573
574 .sp
575 .ne 2
576 .mk
577 .na
578 \fB\fBunsupported@\fR\fIfeature_guid\fR\fR
579 .ad
580 .RS 20n
581 .rt
582 .sp
583 Information about unsupported features that are enabled on the pool. See
584 \fBzpool-features\fR(5) for details.
585 .RE
586
587 .sp
588 .ne 2
589 .mk
590 .na
591 \fB\fBused\fR\fR
592 .ad
593 .RS 20n
594 .rt
595 Amount of storage space used within the pool.
596 .RE
597
598 .sp
599 .LP
600 The space usage properties report actual physical space available to the storage pool. The physical space can be different from the total amount of space that any contained datasets can actually use. The amount of space used in a \fBraidz\fR configuration depends on the characteristics of the data being written. In addition, \fBZFS\fR reserves some space for internal accounting that the \fBzfs\fR(8) command takes into account, but the \fBzpool\fR command does not. For non-full pools of a reasonable size, these effects should be invisible. For small pools, or pools that are close to being completely full, these discrepancies may become more noticeable.
601
602 .sp
603 .LP
604 The following property can be set at creation time:
605 .sp
606 .ne 2
607 .mk
608 .na
609 \fB\fBashift\fR\fR
610 .ad
611 .sp .6
612 .RS 4n
613 Pool sector size exponent, to the power of 2 (internally referred to as "ashift"). I/O operations will be aligned to the specified size boundaries. Additionally, the minimum (disk) write size will be set to the specified size, so this represents a space vs. performance trade-off. The typical case for setting this property is when performance is important and the underlying disks use 4KiB sectors but report 512B sectors to the OS (for compatibility reasons); in that case, set \fBashift=12\fR (which is 1<<12 = 4096).
614 .LP
615 For optimal performance, the pool sector size should be greater than or equal to the sector size of the underlying disks. Since the property cannot be changed after pool creation, if in a given pool, you \fIever\fR want to use drives that \fIreport\fR 4KiB sectors, you must set \fBashift=12\fR at pool creation time.
616 .LP
617 Keep in mind is that the \fBashift\fR is \fIvdev\fR specific and is not a \fIpool\fR global. This means that when adding new vdevs to an existing pool you may need to specify the \fBashift\fR.
618 .RE
619
620 .sp
621 .LP
622 The following property can be set at creation time and import time:
623 .sp
624 .ne 2
625 .mk
626 .na
627 \fB\fBaltroot\fR\fR
628 .ad
629 .sp .6
630 .RS 4n
631 Alternate root directory. If set, this directory is prepended to any mount points within the pool. This can be used when examining an unknown pool where the mount points cannot be trusted, or in an alternate boot environment, where the typical paths are not valid. \fBaltroot\fR is not a persistent property. It is valid only while the system is up. Setting \fBaltroot\fR defaults to using \fBcachefile\fR=none, though this may be overridden using an explicit setting.
632 .RE
633
634 .sp
635 .LP
636 The following properties can be set at creation time and import time, and later changed with the \fBzpool set\fR command:
637 .sp
638 .ne 2
639 .mk
640 .na
641 \fB\fBautoexpand\fR=\fBon\fR | \fBoff\fR\fR
642 .ad
643 .sp .6
644 .RS 4n
645 Controls automatic pool expansion when the underlying LUN is grown. If set to \fBon\fR, the pool will be resized according to the size of the expanded device. If the device is part of a mirror or \fBraidz\fR then all devices within that mirror/\fBraidz\fR group must be expanded before the new space is made available to the pool. The default behavior is \fBoff\fR. This property can also be referred to by its shortened column name, \fBexpand\fR.
646 .RE
647
648 .sp
649 .ne 2
650 .mk
651 .na
652 \fB\fBautoreplace\fR=\fBon\fR | \fBoff\fR\fR
653 .ad
654 .sp .6
655 .RS 4n
656 Controls automatic device replacement. If set to "\fBoff\fR", device replacement must be initiated by the administrator by using the "\fBzpool replace\fR" command. If set to "\fBon\fR", any new device, found in the same physical location as a device that previously belonged to the pool, is automatically formatted and replaced. The default behavior is "\fBoff\fR". This property can also be referred to by its shortened column name, "replace".
657 .RE
658
659 .sp
660 .ne 2
661 .mk
662 .na
663 \fB\fBbootfs\fR=\fIpool\fR/\fIdataset\fR\fR
664 .ad
665 .sp .6
666 .RS 4n
667 Identifies the default bootable dataset for the root pool. This property is expected to be set mainly by the installation and upgrade programs.
668 .RE
669
670 .sp
671 .ne 2
672 .mk
673 .na
674 \fB\fBcachefile\fR=\fIpath\fR | \fBnone\fR\fR
675 .ad
676 .sp .6
677 .RS 4n
678 Controls the location of where the pool configuration is cached. Discovering all pools on system startup requires a cached copy of the configuration data that is stored on the root file system. All pools in this cache are automatically imported when the system boots. Some environments, such as install and clustering, need to cache this information in a different location so that pools are not automatically imported. Setting this property caches the pool configuration in a different location that can later be imported with "\fBzpool import -c\fR". Setting it to the special value "\fBnone\fR" creates a temporary pool that is never cached, and the special value \fB\&''\fR (empty string) uses the default location.
679 .sp
680 Multiple pools can share the same cache file. Because the kernel destroys and recreates this file when pools are added and removed, care should be taken when attempting to access this file. When the last pool using a \fBcachefile\fR is exported or destroyed, the file is removed.
681 .RE
682
683 .sp
684 .ne 2
685 .mk
686 .na
687 \fB\fBcomment\fR=\fB\fItext\fR\fR
688 .ad
689 .sp .6
690 .RS 4n
691 A text string consisting of printable ASCII characters that will be stored such that it is available even if the pool becomes faulted. An administrator can provide additional information about a pool using this property.
692 .RE
693
694 .sp
695 .ne 2
696 .mk
697 .na
698 \fB\fBdedupditto\fR=\fB\fInumber\fR\fR
699 .ad
700 .sp .6
701 .RS 4n
702 Threshold for the number of block ditto copies. If the reference count for a deduplicated block increases above this number, a new ditto copy of this block is automatically stored. The default setting is 0 which causes no ditto copies to be created for deduplicated blocks. The miniumum legal nonzero setting is 100.
703 .RE
704
705 .sp
706 .ne 2
707 .mk
708 .na
709 \fB\fBdelegation\fR=\fBon\fR | \fBoff\fR\fR
710 .ad
711 .sp .6
712 .RS 4n
713 Controls whether a non-privileged user is granted access based on the dataset permissions defined on the dataset. See \fBzfs\fR(8) for more information on \fBZFS\fR delegated administration.
714 .RE
715
716 .sp
717 .ne 2
718 .mk
719 .na
720 \fB\fBfailmode\fR=\fBwait\fR | \fBcontinue\fR | \fBpanic\fR\fR
721 .ad
722 .sp .6
723 .RS 4n
724 Controls the system behavior in the event of catastrophic pool failure. This condition is typically a result of a loss of connectivity to the underlying storage device(s) or a failure of all devices within the pool. The behavior of such an event is determined as follows:
725 .sp
726 .ne 2
727 .mk
728 .na
729 \fB\fBwait\fR\fR
730 .ad
731 .RS 12n
732 .rt
733 Blocks all \fBI/O\fR access until the device connectivity is recovered and the errors are cleared. This is the default behavior.
734 .RE
735
736 .sp
737 .ne 2
738 .mk
739 .na
740 \fB\fBcontinue\fR\fR
741 .ad
742 .RS 12n
743 .rt
744 Returns \fBEIO\fR to any new write \fBI/O\fR requests but allows reads to any of the remaining healthy devices. Any write requests that have yet to be committed to disk would be blocked.
745 .RE
746
747 .sp
748 .ne 2
749 .mk
750 .na
751 \fB\fBpanic\fR\fR
752 .ad
753 .RS 12n
754 .rt
755 Prints out a message to the console and generates a system crash dump.
756 .RE
757
758 .RE
759
760 .sp
761 .ne 2
762 .na
763 \fB\fBfeature@\fR\fIfeature_name\fR=\fBenabled\fR\fR
764 .ad
765 .RS 4n
766 The value of this property is the current state of \fIfeature_name\fR. The
767 only valid value when setting this property is \fBenabled\fR which moves
768 \fIfeature_name\fR to the enabled state. See \fBzpool-features\fR(5) for
769 details on feature states.
770 .RE
771
772 .sp
773 .ne 2
774 .mk
775 .na
776 \fB\fBlistsnaps\fR=on | off\fR
777 .ad
778 .sp .6
779 .RS 4n
780 Controls whether information about snapshots associated with this pool is output when "\fBzfs list\fR" is run without the \fB-t\fR option. The default value is "off".
781 .RE
782
783 .sp
784 .ne 2
785 .mk
786 .na
787 \fB\fBversion\fR=\fIversion\fR\fR
788 .ad
789 .sp .6
790 .RS 4n
791 The current on-disk version of the pool. This can be increased, but never decreased. The preferred method of updating pools is with the "\fBzpool upgrade\fR" command, though this property can be used when a specific version is needed for backwards compatibility. Once feature flags are enabled on a pool this property will no longer have a value.
792 .RE
793
794 .SS "Subcommands"
795 .sp
796 .LP
797 All subcommands that modify state are logged persistently to the pool in their original form.
798 .sp
799 .LP
800 The \fBzpool\fR command provides subcommands to create and destroy storage pools, add capacity to storage pools, and provide information about the storage pools. The following subcommands are supported:
801 .sp
802 .ne 2
803 .mk
804 .na
805 \fB\fBzpool\fR \fB-?\fR\fR
806 .ad
807 .sp .6
808 .RS 4n
809 Displays a help message.
810 .RE
811
812 .sp
813 .ne 2
814 .mk
815 .na
816 \fB\fBzpool add\fR [\fB-fn\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIvdev\fR ...\fR
817 .ad
818 .sp .6
819 .RS 4n
820 Adds the specified virtual devices to the given pool. The \fIvdev\fR specification is described in the "Virtual Devices" section. The behavior of the \fB-f\fR option, and the device checks performed are described in the "zpool create" subcommand.
821 .sp
822 .ne 2
823 .mk
824 .na
825 \fB\fB-f\fR\fR
826 .ad
827 .RS 6n
828 .rt
829 Forces use of \fBvdev\fRs, even if they appear in use or specify a conflicting replication level. Not all devices can be overridden in this manner.
830 .RE
831
832 .sp
833 .ne 2
834 .mk
835 .na
836 \fB\fB-n\fR\fR
837 .ad
838 .RS 6n
839 .rt
840 Displays the configuration that would be used without actually adding the \fBvdev\fRs. The actual pool creation can still fail due to insufficient privileges or device sharing.
841 .RE
842
843 .sp
844 .ne 2
845 .mk
846 .na
847 \fB\fB-o\fR \fIproperty=value\fR
848 .ad
849 .sp .6
850 .RS 4n
851 Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set. The only property supported at the moment is \fBashift\fR. \fBDo note\fR that some properties (among them \fBashift\fR) are \fInot\fR inherited from a previous vdev. They are vdev specific, not pool specific.
852 .RE
853
854 Do not add a disk that is currently configured as a quorum device to a zpool. After a disk is in the pool, that disk can then be configured as a quorum device.
855 .RE
856
857 .sp
858 .ne 2
859 .mk
860 .na
861 \fB\fBzpool attach\fR [\fB-f\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR\fR
862 .ad
863 .sp .6
864 .RS 4n
865 Attaches \fInew_device\fR to an existing \fBzpool\fR device. The existing device cannot be part of a \fBraidz\fR configuration. If \fIdevice\fR is not currently part of a mirrored configuration, \fIdevice\fR automatically transforms into a two-way mirror of \fIdevice\fR and \fInew_device\fR. If \fIdevice\fR is part of a two-way mirror, attaching \fInew_device\fR creates a three-way mirror, and so on. In either case, \fInew_device\fR begins to resilver immediately.
866 .sp
867 .ne 2
868 .mk
869 .na
870 \fB\fB-f\fR\fR
871 .ad
872 .RS 6n
873 .rt
874 Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
875 .RE
876
877 .sp
878 .ne 2
879 .mk
880 .na
881 \fB\fB-o\fR \fIproperty=value\fR
882 .ad
883 .sp .6
884 .RS 4n
885 Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set. The only property supported at the moment is "ashift".
886 .RE
887
888 .RE
889
890 .sp
891 .ne 2
892 .mk
893 .na
894 \fB\fBzpool clear\fR \fIpool\fR [\fIdevice\fR] ...\fR
895 .ad
896 .sp .6
897 .RS 4n
898 Clears device errors in a pool. If no arguments are specified, all device errors within the pool are cleared. If one or more devices is specified, only those errors associated with the specified device or devices are cleared.
899 .RE
900
901 .sp
902 .ne 2
903 .mk
904 .na
905 \fB\fBzpool create\fR [\fB-fnd\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-O\fR \fIfile-system-property=value\fR] ... [\fB-m\fR \fImountpoint\fR] [\fB-R\fR \fIroot\fR] \fIpool\fR \fIvdev\fR ...\fR
906 .ad
907 .sp .6
908 .RS 4n
909 Creates a new storage pool containing the virtual devices specified on the command line. The pool name must begin with a letter, and can only contain alphanumeric characters as well as underscore ("_"), dash ("-"), period ("."), colon (":"), and space (" "). The pool names "mirror", "raidz", "spare" and "log" are reserved, as are names beginning with the pattern "c[0-9]". The \fBvdev\fR specification is described in the "Virtual Devices" section.
910 .sp
911 The command verifies that each device specified is accessible and not currently in use by another subsystem. There are some uses, such as being currently mounted, or specified as the dedicated dump device, that prevents a device from ever being used by \fBZFS\fR. Other uses, such as having a preexisting \fBUFS\fR file system, can be overridden with the \fB-f\fR option.
912 .sp
913 The command also checks that the replication strategy for the pool is consistent. An attempt to combine redundant and non-redundant storage in a single pool, or to mix disks and files, results in an error unless \fB-f\fR is specified. The use of differently sized devices within a single \fBraidz\fR or mirror group is also flagged as an error unless \fB-f\fR is specified.
914 .sp
915 Unless the \fB-R\fR option is specified, the default mount point is "/\fIpool\fR". The mount point must not exist or must be empty, or else the root dataset cannot be mounted. This can be overridden with the \fB-m\fR option.
916 .sp
917 By default all supported features are enabled on the new pool unless the \fB-d\fR option is specified.
918 .sp
919 .ne 2
920 .mk
921 .na
922 \fB\fB-f\fR\fR
923 .ad
924 .sp .6
925 .RS 4n
926 Forces use of \fBvdev\fRs, even if they appear in use or specify a conflicting replication level. Not all devices can be overridden in this manner.
927 .RE
928
929 .sp
930 .ne 2
931 .mk
932 .na
933 \fB\fB-n\fR\fR
934 .ad
935 .sp .6
936 .RS 4n
937 Displays the configuration that would be used without actually creating the pool. The actual pool creation can still fail due to insufficient privileges or device sharing.
938 .RE
939
940 .sp
941 .ne 2
942 .mk
943 .na
944 \fB\fB-d\fR\fR
945 .ad
946 .sp .6
947 .RS 4n
948 Do not enable any features on the new pool. Individual features can be enabled by setting their corresponding properties to \fBenabled\fR with the \fB-o\fR option. See \fBzpool-features\fR(5) for details about feature properties.
949 .RE
950
951 .sp
952 .ne 2
953 .na
954 \fB\fB-o\fR \fIproperty=value\fR [\fB-o\fR \fIproperty=value\fR] ...\fR
955 .ad
956 .sp .6
957 .RS 4n
958 Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set.
959 .RE
960
961 .sp
962 .ne 2
963 .mk
964 .na
965 \fB\fB-O\fR \fIfile-system-property=value\fR\fR
966 .ad
967 .br
968 .na
969 \fB[\fB-O\fR \fIfile-system-property=value\fR] ...\fR
970 .ad
971 .sp .6
972 .RS 4n
973 Sets the given file system properties in the root file system of the pool. See the "Properties" section of \fBzfs\fR(8) for a list of valid properties that can be set.
974 .RE
975
976 .sp
977 .ne 2
978 .mk
979 .na
980 \fB\fB-R\fR \fIroot\fR\fR
981 .ad
982 .sp .6
983 .RS 4n
984 Equivalent to "-o cachefile=none,altroot=\fIroot\fR"
985 .RE
986
987 .sp
988 .ne 2
989 .mk
990 .na
991 \fB\fB-m\fR \fImountpoint\fR\fR
992 .ad
993 .sp .6
994 .RS 4n
995 Sets the mount point for the root dataset. The default mount point is "/\fIpool\fR" or "\fBaltroot\fR/\fIpool\fR" if \fBaltroot\fR is specified. The mount point must be an absolute path, "\fBlegacy\fR", or "\fBnone\fR". For more information on dataset mount points, see \fBzfs\fR(8).
996 .RE
997
998 .RE
999
1000 .sp
1001 .ne 2
1002 .mk
1003 .na
1004 \fB\fBzpool destroy\fR [\fB-f\fR] \fIpool\fR\fR
1005 .ad
1006 .sp .6
1007 .RS 4n
1008 Destroys the given pool, freeing up any devices for other use. This command tries to unmount any active datasets before destroying the pool.
1009 .sp
1010 .ne 2
1011 .mk
1012 .na
1013 \fB\fB-f\fR\fR
1014 .ad
1015 .RS 6n
1016 .rt
1017 Forces any active datasets contained within the pool to be unmounted.
1018 .RE
1019
1020 .RE
1021
1022 .sp
1023 .ne 2
1024 .mk
1025 .na
1026 \fB\fBzpool detach\fR \fIpool\fR \fIdevice\fR\fR
1027 .ad
1028 .sp .6
1029 .RS 4n
1030 Detaches \fIdevice\fR from a mirror. The operation is refused if there are no other valid replicas of the data. If \fIdevice\fR may be re-added to the pool later on then consider the "\fBzpool offline\fR" command instead.
1031 .RE
1032
1033 .sp
1034 .ne 2
1035 .mk
1036 .na
1037 \fB\fBzpool export\fR [\fB-f\fR] \fIpool\fR ...\fR
1038 .ad
1039 .sp .6
1040 .RS 4n
1041 Exports the given pools from the system. All devices are marked as exported, but are still considered in use by other subsystems. The devices can be moved between systems (even those of different endianness) and imported as long as a sufficient number of devices are present.
1042 .sp
1043 Before exporting the pool, all datasets within the pool are unmounted. A pool can not be exported if it has a shared spare that is currently being used.
1044 .sp
1045 For pools to be portable, you must give the \fBzpool\fR command whole disks, not just partitions, so that \fBZFS\fR can label the disks with portable \fBEFI\fR labels. Otherwise, disk drivers on platforms of different endianness will not recognize the disks.
1046 .sp
1047 .ne 2
1048 .mk
1049 .na
1050 \fB\fB-f\fR\fR
1051 .ad
1052 .RS 6n
1053 .rt
1054 Forcefully unmount all datasets, using the "\fBunmount -f\fR" command.
1055 .sp
1056 This command will forcefully export the pool even if it has a shared spare that is currently being used. This may lead to potential data corruption.
1057 .RE
1058
1059 .RE
1060
1061 .sp
1062 .ne 2
1063 .mk
1064 .na
1065 \fB\fBzpool get\fR [\fB-p\fR] "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...\fR
1066 .ad
1067 .sp .6
1068 .RS 4n
1069 Retrieves the given list of properties (or all properties if "\fBall\fR" is used) for the specified storage pool(s). These properties are displayed with the following fields:
1070 .sp
1071 .in +2
1072 .nf
1073 name Name of storage pool
1074 property Property name
1075 value Property value
1076 source Property source, either 'default' or 'local'.
1077 .fi
1078 .in -2
1079 .sp
1080
1081 See the "Properties" section for more information on the available pool properties.
1082 .sp
1083 .ne 2
1084 .mk
1085 .na
1086 \fB\fB-p\fR\fR
1087 .ad
1088 .RS 6n
1089 .rt
1090 Display numbers in parseable (exact) values.
1091 .RE
1092
1093 .sp
1094 .ne 2
1095 .mk
1096 .na
1097 \fB\fB-H\fR\fR
1098 .ad
1099 .RS 6n
1100 .rt
1101 Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
1102 .RE
1103
1104 .RE
1105
1106 .sp
1107 .ne 2
1108 .mk
1109 .na
1110 \fB\fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...\fR
1111 .ad
1112 .sp .6
1113 .RS 4n
1114 Displays the command history of the specified pools or all pools if no pool is specified.
1115 .sp
1116 .ne 2
1117 .mk
1118 .na
1119 \fB\fB-i\fR\fR
1120 .ad
1121 .RS 6n
1122 .rt
1123 Displays internally logged \fBZFS\fR events in addition to user initiated events.
1124 .RE
1125
1126 .sp
1127 .ne 2
1128 .mk
1129 .na
1130 \fB\fB-l\fR\fR
1131 .ad
1132 .RS 6n
1133 .rt
1134 Displays log records in long format, which in addition to standard format includes, the user name, the hostname, and the zone in which the operation was performed.
1135 .RE
1136
1137 .RE
1138
1139 .sp
1140 .ne 2
1141 .mk
1142 .na
1143 \fB\fBzpool import\fR [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR]\fR
1144 .ad
1145 .sp .6
1146 .RS 4n
1147 Lists pools available to import. If the \fB-d\fR option is not specified, this command searches for devices in "/dev". The \fB-d\fR 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 \fIvdev\fR layout and current health of the device for each device or file. Destroyed pools, pools that were previously destroyed with the "\fBzpool destroy\fR" command, are not listed unless the \fB-D\fR option is specified.
1148 .sp
1149 The numeric identifier is unique, and can be used instead of the pool name when multiple exported pools of the same name are available.
1150 .sp
1151 .ne 2
1152 .mk
1153 .na
1154 \fB\fB-c\fR \fIcachefile\fR\fR
1155 .ad
1156 .RS 16n
1157 .rt
1158 Reads configuration from the given \fBcachefile\fR that was created with the "\fBcachefile\fR" pool property. This \fBcachefile\fR is used instead of searching for devices.
1159 .RE
1160
1161 .sp
1162 .ne 2
1163 .mk
1164 .na
1165 \fB\fB-d\fR \fIdir\fR\fR
1166 .ad
1167 .RS 16n
1168 .rt
1169 Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times.
1170 .RE
1171
1172 .sp
1173 .ne 2
1174 .mk
1175 .na
1176 \fB\fB-D\fR\fR
1177 .ad
1178 .RS 16n
1179 .rt
1180 Lists destroyed pools only.
1181 .RE
1182
1183 .RE
1184
1185 .sp
1186 .ne 2
1187 .mk
1188 .na
1189 \fB\fBzpool import\fR [\fB-o\fR \fImntopts\fR] [ \fB-o\fR \fIproperty\fR=\fIvalue\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-N\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR]] \fB-a\fR\fR
1190 .ad
1191 .sp .6
1192 .RS 4n
1193 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 "\fBzpool destroy\fR" command, will not be imported unless the \fB-D\fR option is specified.
1194 .sp
1195 .ne 2
1196 .mk
1197 .na
1198 \fB\fB-o\fR \fImntopts\fR\fR
1199 .ad
1200 .RS 21n
1201 .rt
1202 Comma-separated list of mount options to use when mounting datasets within the pool. See \fBzfs\fR(8) for a description of dataset properties and mount options.
1203 .RE
1204
1205 .sp
1206 .ne 2
1207 .mk
1208 .na
1209 \fB\fB-o\fR \fIproperty=value\fR\fR
1210 .ad
1211 .RS 21n
1212 .rt
1213 Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1214 .RE
1215
1216 .sp
1217 .ne 2
1218 .mk
1219 .na
1220 \fB\fB-c\fR \fIcachefile\fR\fR
1221 .ad
1222 .RS 21n
1223 .rt
1224 Reads configuration from the given \fBcachefile\fR that was created with the "\fBcachefile\fR" pool property. This \fBcachefile\fR is used instead of searching for devices.
1225 .RE
1226
1227 .sp
1228 .ne 2
1229 .mk
1230 .na
1231 \fB\fB-d\fR \fIdir\fR\fR
1232 .ad
1233 .RS 21n
1234 .rt
1235 Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times. This option is incompatible with the \fB-c\fR option.
1236 .RE
1237
1238 .sp
1239 .ne 2
1240 .mk
1241 .na
1242 \fB\fB-D\fR\fR
1243 .ad
1244 .RS 21n
1245 .rt
1246 Imports destroyed pools only. The \fB-f\fR option is also required.
1247 .RE
1248
1249 .sp
1250 .ne 2
1251 .mk
1252 .na
1253 \fB\fB-f\fR\fR
1254 .ad
1255 .RS 21n
1256 .rt
1257 Forces import, even if the pool appears to be potentially active.
1258 .RE
1259
1260 .sp
1261 .ne 2
1262 .mk
1263 .na
1264 \fB\fB-F\fR\fR
1265 .ad
1266 .RS 21n
1267 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.
1268 .RE
1269
1270 .sp
1271 .ne 2
1272 .mk
1273 .na
1274 \fB\fB-a\fR\fR
1275 .ad
1276 .RS 21n
1277 .rt
1278 Searches for and imports all pools found.
1279 .RE
1280
1281 .sp
1282 .ne 2
1283 .mk
1284 .na
1285 \fB\fB-m\fR\fR
1286 .ad
1287 .RS 21n
1288 Allows a pool to import when there is a missing log device.
1289 .RE
1290
1291 .sp
1292 .ne 2
1293 .mk
1294 .na
1295 \fB\fB-R\fR \fIroot\fR\fR
1296 .ad
1297 .RS 21n
1298 .rt
1299 Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1300 .RE
1301
1302 .sp
1303 .ne 2
1304 .mk
1305 .na
1306 \fB\fB-N\fR\fR
1307 .ad
1308 .RS 21n
1309 Import the pool without mounting any file systems.
1310 .RE
1311
1312 .sp
1313 .ne 2
1314 .mk
1315 .na
1316 \fB\fB-n\fR\fR
1317 .ad
1318 .RS 21n
1319 Used with the \fB-F\fR 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 \fB-F\fR option, above.
1320 .RE
1321
1322 .sp
1323 .ne 2
1324 .mk
1325 .na
1326 \fB\fB-X\fR\fR
1327 .ad
1328 .RS 21n
1329 Used with the \fB-F\fR 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 \fB-F\fR option, above.
1330 \fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
1331 .RE
1332
1333 .sp
1334 .ne 2
1335 .mk
1336 .na
1337 \fB\fB-T\fR\fR
1338 .ad
1339 .RS 21n
1340 Specify the txg to use for rollback. Implies \fB-FX\fR. For more details about pool recovery mode, see the \fB-X\fR option, above.
1341 \fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
1342 .RE
1343
1344 .RE
1345
1346 .sp
1347 .ne 2
1348 .mk
1349 .na
1350 \fB\fBzpool import\fR [\fB-o\fR \fImntopts\fR] [ \fB-o\fR \fIproperty\fR=\fIvalue\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR]] [\fB-t\fR]] \fIpool\fR | \fIid\fR [\fInewpool\fR]\fR
1351 .ad
1352 .sp .6
1353 .RS 4n
1354 Imports a specific pool. A pool can be identified by its name or the numeric identifier. If \fInewpool\fR is specified, the pool is imported using the name \fInewpool\fR. Otherwise, it is imported with the same name as its exported name.
1355 .sp
1356 If a device is removed from a system without running "\fBzpool export\fR" 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 \fB-f\fR option is required.
1357 .sp
1358 .ne 2
1359 .mk
1360 .na
1361 \fB\fB-o\fR \fImntopts\fR\fR
1362 .ad
1363 .sp .6
1364 .RS 4n
1365 Comma-separated list of mount options to use when mounting datasets within the pool. See \fBzfs\fR(8) for a description of dataset properties and mount options.
1366 .RE
1367
1368 .sp
1369 .ne 2
1370 .mk
1371 .na
1372 \fB\fB-o\fR \fIproperty=value\fR\fR
1373 .ad
1374 .sp .6
1375 .RS 4n
1376 Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
1377 .RE
1378
1379 .sp
1380 .ne 2
1381 .mk
1382 .na
1383 \fB\fB-c\fR \fIcachefile\fR\fR
1384 .ad
1385 .sp .6
1386 .RS 4n
1387 Reads configuration from the given \fBcachefile\fR that was created with the "\fBcachefile\fR" pool property. This \fBcachefile\fR is used instead of searching for devices.
1388 .RE
1389
1390 .sp
1391 .ne 2
1392 .mk
1393 .na
1394 \fB\fB-d\fR \fIdir\fR\fR
1395 .ad
1396 .sp .6
1397 .RS 4n
1398 Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times. This option is incompatible with the \fB-c\fR option.
1399 .RE
1400
1401 .sp
1402 .ne 2
1403 .mk
1404 .na
1405 \fB\fB-D\fR\fR
1406 .ad
1407 .sp .6
1408 .RS 4n
1409 Imports destroyed pool. The \fB-f\fR option is also required.
1410 .RE
1411
1412 .sp
1413 .ne 2
1414 .mk
1415 .na
1416 \fB\fB-f\fR\fR
1417 .ad
1418 .sp .6
1419 .RS 4n
1420 Forces import, even if the pool appears to be potentially active.
1421 .RE
1422
1423 .sp
1424 .ne 2
1425 .mk
1426 .na
1427 \fB\fB-F\fR\fR
1428 .ad
1429 .sp .6
1430 .RS 4n
1431 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.
1432 .RE
1433
1434 .sp
1435 .ne 2
1436 .mk
1437 .na
1438 \fB\fB-R\fR \fIroot\fR\fR
1439 .ad
1440 .sp .6
1441 .RS 4n
1442 Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
1443 .RE
1444
1445 .sp
1446 .ne 2
1447 .mk
1448 .na
1449 \fB\fB-n\fR\fR
1450 .ad
1451 .sp .6
1452 .RS 4n
1453 Used with the \fB-F\fR 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 \fB-F\fR option, above.
1454 .RE
1455
1456 .sp
1457 .ne 2
1458 .mk
1459 .na
1460 \fB\fB-X\fR\fR
1461 .ad
1462 .sp .6
1463 .RS 4n
1464 Used with the \fB-F\fR 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 \fB-F\fR option, above.
1465 \fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
1466 .RE
1467
1468 .sp
1469 .ne 2
1470 .mk
1471 .na
1472 \fB\fB-T\fR\fR
1473 .ad
1474 .sp .6
1475 .RS 4n
1476 Specify the txg to use for rollback. Implies \fB-FX\fR. For more details about pool recovery mode, see the \fB-X\fR option, above.
1477 \fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
1478 .RE
1479
1480 .sp
1481 .ne 2
1482 .mk
1483 .na
1484 \fB\fB-t\fR\fR
1485 .ad
1486 .sp .6
1487 .RS 4n
1488 Used with "\fBnewpool\fR". Specifies that "\fBnewpool\fR" 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.
1489 .RE
1490
1491 .sp
1492 .ne 2
1493 .mk
1494 .na
1495 \fB\fB-m\fR\fR
1496 .ad
1497 .sp .6
1498 .RS 4n
1499 Allows a pool to import when there is a missing log device.
1500 .RE
1501
1502 .RE
1503
1504 .sp
1505 .ne 2
1506 .mk
1507 .na
1508 \fB\fBzpool iostat\fR [\fB-T\fR \fBd\fR | \fBu\fR] [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]\fR
1509 .ad
1510 .sp .6
1511 .RS 4n
1512 Displays \fBI/O\fR statistics for the given pools. When given an interval, the statistics are printed every \fIinterval\fR seconds until \fBCtrl-C\fR is pressed. If no \fIpools\fR are specified, statistics for every pool in the system is shown. If \fIcount\fR is specified, the command exits after \fIcount\fR reports are printed.
1513 .sp
1514 .ne 2
1515 .mk
1516 .na
1517 \fB\fB-T\fR \fBu\fR | \fBd\fR\fR
1518 .ad
1519 .RS 12n
1520 .rt
1521 Display a time stamp.
1522 .sp
1523 Specify \fBu\fR for a printed representation of the internal representation of time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See \fBdate\fR(1).
1524 .RE
1525
1526 .sp
1527 .ne 2
1528 .mk
1529 .na
1530 \fB\fB-v\fR\fR
1531 .ad
1532 .RS 12n
1533 .rt
1534 Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wide statistics.
1535 .RE
1536
1537 .RE
1538
1539 .sp
1540 .ne 2
1541 .mk
1542 .na
1543 \fB\fBzpool labelclear\fR [\fB-f\fR] \fIdevice\fR
1544 .ad
1545 .sp .6
1546 .RS 4n
1547 Removes ZFS label information from the specified device. The device must not be part of an active pool configuration.
1548 .sp
1549 .ne 2
1550 .mk
1551 .na
1552 \fB\fB-f\fR\fR
1553 .ad
1554 .RS 12n
1555 .rt
1556 Treat exported or foreign devices as inactive.
1557 .RE
1558
1559 .RE
1560
1561 .sp
1562 .ne 2
1563 .mk
1564 .na
1565 \fB\fBzpool list\fR [\fB-T\fR \fBd\fR | \fBu\fR] [\fB-Hv\fR] [\fB-o\fR \fIprops\fR[,...]] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]\fR
1566 .ad
1567 .sp .6
1568 .RS 4n
1569 Lists the given pools along with a health status and space usage. If no \fIpools\fR are specified, all pools in the system are listed. When given an \fIinterval\fR, the information is printed every \fIinterval\fR seconds until \fBCtrl-C\fR is pressed. If \fIcount\fR is specified, the command exits after \fIcount\fR reports are printed.
1570 .sp
1571 .ne 2
1572 .mk
1573 .na
1574 \fB\fB-H\fR\fR
1575 .ad
1576 .RS 12n
1577 .rt
1578 Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
1579 .RE
1580
1581 .ne 2
1582 .mk
1583 .na
1584 \fB\fB-T\fR \fBd\fR | \fBu\fR\fR
1585 .ad
1586 .RS 12n
1587 .rt
1588 Display a time stamp.
1589 .sp
1590 Specify \fBu\fR for a printed representation of the internal representation of time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See \fBdate\fR(1).
1591 .RE
1592
1593 .sp
1594 .ne 2
1595 .mk
1596 .na
1597 \fB\fB-o\fR \fIprops\fR\fR
1598 .ad
1599 .RS 12n
1600 .rt
1601 Comma-separated list of properties to display. See the "Properties" section for a list of valid properties. The default list is "name, size, used, available, fragmentation, expandsize, capacity, dedupratio, health, altroot"
1602 .RE
1603
1604 .sp
1605 .ne 2
1606 .mk
1607 .na
1608 \fB\fB-v\fR\fR
1609 .ad
1610 .RS 12n
1611 .rt
1612 Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wise statistics.
1613 .RE
1614
1615 .RE
1616
1617 .sp
1618 .ne 2
1619 .mk
1620 .na
1621 \fB\fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...\fR
1622 .ad
1623 .sp .6
1624 .RS 4n
1625 Takes the specified physical device offline. While the \fIdevice\fR is offline, no attempt is made to read or write to the device.
1626 .sp
1627 This command is not applicable to spares or cache devices.
1628 .sp
1629 .ne 2
1630 .mk
1631 .na
1632 \fB\fB-t\fR\fR
1633 .ad
1634 .RS 6n
1635 .rt
1636 Temporary. Upon reboot, the specified physical device reverts to its previous state.
1637 .RE
1638
1639 .RE
1640
1641 .sp
1642 .ne 2
1643 .mk
1644 .na
1645 \fB\fBzpool online\fR [\fB-e\fR] \fIpool\fR \fIdevice\fR...\fR
1646 .ad
1647 .sp .6
1648 .RS 4n
1649 Brings the specified physical device online.
1650 .sp
1651 This command is not applicable to spares or cache devices.
1652 .sp
1653 .ne 2
1654 .mk
1655 .na
1656 \fB\fB-e\fR\fR
1657 .ad
1658 .RS 6n
1659 .rt
1660 Expand the device to use all available space. If the device is part of a mirror or \fBraidz\fR then all devices must be expanded before the new space will become available to the pool.
1661 .RE
1662
1663 .RE
1664
1665 .sp
1666 .ne 2
1667 .mk
1668 .na
1669 \fB\fBzpool reguid\fR \fIpool\fR
1670 .ad
1671 .sp .6
1672 .RS 4n
1673 Generates a new unique identifier for the pool. You must ensure that all
1674 devices in this pool are online and healthy before performing this action.
1675 .RE
1676
1677 .sp
1678 .ne 2
1679 .na
1680 \fB\fBzpool reopen\fR \fIpool\fR
1681 .ad
1682 .sp .6
1683 .RS 4n
1684 Reopen all the vdevs associated with the pool.
1685 .RE
1686
1687 .sp
1688 .ne 2
1689 .na
1690 \fB\fBzpool remove\fR \fIpool\fR \fIdevice\fR ...\fR
1691 .ad
1692 .sp .6
1693 .RS 4n
1694 Removes the specified device from the pool. This command currently only supports removing hot spares, cache, and log devices. A mirrored log device can be removed by specifying the top-level mirror for the log. Non-log devices that are part of a mirrored configuration can be removed using the \fBzpool detach\fR command. Non-redundant and \fBraidz\fR devices cannot be removed from a pool.
1695 .RE
1696
1697 .sp
1698 .ne 2
1699 .mk
1700 .na
1701 \fB\fBzpool replace\fR [\fB-f\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIold_device\fR [\fInew_device\fR]\fR
1702 .ad
1703 .sp .6
1704 .RS 4n
1705 Replaces \fIold_device\fR with \fInew_device\fR. This is equivalent to attaching \fInew_device\fR, waiting for it to resilver, and then detaching \fIold_device\fR.
1706 .sp
1707 The size of \fInew_device\fR must be greater than or equal to the minimum size of all the devices in a mirror or \fBraidz\fR configuration.
1708 .sp
1709 \fInew_device\fR is required if the pool is not redundant. If \fInew_device\fR is not specified, it defaults to \fIold_device\fR. This form of replacement is useful after an existing disk has failed and has been physically replaced. In this case, the new disk may have the same \fB/dev\fR path as the old device, even though it is actually a different disk. \fBZFS\fR recognizes this.
1710 .sp
1711 .ne 2
1712 .mk
1713 .na
1714 \fB\fB-f\fR\fR
1715 .ad
1716 .RS 6n
1717 .rt
1718 Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
1719 .RE
1720
1721 .sp
1722 .ne 2
1723 .mk
1724 .na
1725 \fB\fB-o\fR \fIproperty=value\fR
1726 .ad
1727 .sp .6n
1728 .RS 6n
1729 Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set. The only property supported at the moment is \fBashift\fR. \fBDo note\fR that some properties (among them \fBashift\fR) are \fInot\fR inherited from a previous vdev. They are vdev specific, not pool specific.
1730 .RE
1731
1732 .RE
1733
1734 .sp
1735 .ne 2
1736 .mk
1737 .na
1738 \fB\fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...\fR
1739 .ad
1740 .sp .6
1741 .RS 4n
1742 Begins a scrub. The scrub examines all data in the specified pools to verify that it checksums correctly. For replicated (mirror or \fBraidz\fR) devices, \fBZFS\fR automatically repairs any damage discovered during the scrub. The "\fBzpool status\fR" command reports the progress of the scrub and summarizes the results of the scrub upon completion.
1743 .sp
1744 Scrubbing and resilvering are very similar operations. The difference is that resilvering only examines data that \fBZFS\fR knows to be out of date (for example, when attaching a new device to a mirror or replacing an existing device), whereas scrubbing examines all data to discover silent errors due to hardware faults or disk failure.
1745 .sp
1746 Because scrubbing and resilvering are \fBI/O\fR-intensive operations, \fBZFS\fR only allows one at a time. If a scrub is already in progress, the "\fBzpool scrub\fR" command terminates it and starts a new scrub. If a resilver is in progress, \fBZFS\fR does not allow a scrub to be started until the resilver completes.
1747 .sp
1748 .ne 2
1749 .mk
1750 .na
1751 \fB\fB-s\fR\fR
1752 .ad
1753 .RS 6n
1754 .rt
1755 Stop scrubbing.
1756 .RE
1757
1758 .RE
1759
1760 .sp
1761 .ne 2
1762 .mk
1763 .na
1764 \fB\fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR\fR
1765 .ad
1766 .sp .6
1767 .RS 4n
1768 Sets the given property on the specified pool. See the "Properties" section for more information on what properties can be set and acceptable values.
1769 .RE
1770
1771 .sp
1772 .ne 2
1773 .mk
1774 .na
1775 \fBzpool split\fR [\fB-n\fR] [\fB-R\fR \fIaltroot\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fInewpool\fR [\fIdevice\fR ...]
1776 .ad
1777 .sp .6
1778 .RS 4n
1779 Split devices off \fIpool\fR creating \fInewpool\fR. All \fBvdev\fRs in \fIpool\fR must be mirrors and the pool must not be in the process of resilvering. At the time of the split, \fInewpool\fR will be a replica of \fIpool\fR. By default, the last device in each mirror is split from \fIpool\fR to create \fInewpool\fR.
1780
1781 The optional \fIdevice\fR specification causes the specified device(s) to be included in the new pool and, should any devices remain unspecified, the last device in each mirror is used as would be by default.
1782
1783 .sp
1784 .ne 2
1785 .mk
1786 .na
1787 \fB\fB-n\fR \fR
1788 .ad
1789 .sp .6
1790 .RS 4n
1791 Do dry run, do not actually perform the split. Print out the expected configuration of \fInewpool\fR.
1792 .RE
1793
1794 .sp
1795 .ne 2
1796 .mk
1797 .na
1798 \fB\fB-R\fR \fIaltroot\fR \fR
1799 .ad
1800 .sp .6
1801 .RS 4n
1802 Set \fIaltroot\fR for \fInewpool\fR and automaticaly import it. This can be useful to avoid mountpoint collisions if \fInewpool\fR is imported on the same filesystem as \fIpool\fR.
1803 .RE
1804
1805 .sp
1806 .ne 2
1807 .mk
1808 .na
1809 \fB\fB-o\fR \fIproperty=value\fR \fR
1810 .ad
1811 .sp .6
1812 .RS 4n
1813 Sets the specified property for \fInewpool\fR. See the “Properties” section for more information on the available pool properties.
1814 .RE
1815
1816 .RE
1817
1818 .sp
1819 .ne 2
1820 .mk
1821 .na
1822 \fBzpool status\fR [\fB-xvD\fR] [\fB-T\fR d | u] [\fIpool\fR] ... [\fIinterval\fR [\fIcount\fR]]
1823 .ad
1824 .sp .6
1825 .RS 4n
1826 Displays the detailed health status for the given pools. If no \fIpool\fR is specified, then the status of each pool in the system is displayed. For more information on pool and device health, see the "Device Failure and Recovery" section.
1827 .sp
1828 If a scrub or resilver is in progress, this command reports the percentage done and the estimated time to completion. Both of these are only approximate, because the amount of data in the pool and the other workloads on the system can change.
1829 .sp
1830 .ne 2
1831 .mk
1832 .na
1833 \fB\fB-x\fR\fR
1834 .ad
1835 .RS 12n
1836 .rt
1837 Only display status for pools that are exhibiting errors or are otherwise unavailable. Warnings about pools not using the latest on-disk format will not be included.
1838 .RE
1839
1840 .sp
1841 .ne 2
1842 .mk
1843 .na
1844 \fB\fB-v\fR\fR
1845 .ad
1846 .RS 12n
1847 .rt
1848 Displays verbose data error information, printing out a complete list of all data errors since the last complete pool scrub.
1849 .RE
1850
1851 .sp
1852 .ne 2
1853 .mk
1854 .na
1855 \fB\fB-D\fR\fR
1856 .ad
1857 .RS 12n
1858 .rt
1859 Display a histogram of deduplication statistics, showing the allocated (physically present on disk) and
1860 referenced (logically referenced in the pool) block counts and sizes by reference count.
1861 .RE
1862
1863 .sp
1864 .ne 2
1865 .mk
1866 .na
1867 \fB\fB-T\fR \fBd\fR | \fBu\fR\fR
1868 .ad
1869 .RS 12n
1870 .rt
1871 Display a time stamp.
1872 .sp
1873 Specify \fBu\fR for a printed representation of the internal representation of time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See \fBdate\fR(1).
1874 .RE
1875
1876 .sp
1877 .ne 2
1878 .mk
1879 .na
1880 \fB\fBzpool upgrade\fR\fR
1881 .ad
1882 .sp .6
1883 .RS 4n
1884 Displays pools which do not have all supported features enabled and pools formatted using a legacy ZFS version number. These pools can continue to be used, but some features may not be available. Use "\fBzpool upgrade -a\fR" to enable all features on all pools.
1885 .RE
1886
1887 .sp
1888 .ne 2
1889 .mk
1890 .na
1891 \fB\fBzpool upgrade\fR \fB-v\fR\fR
1892 .ad
1893 .sp .6
1894 .RS 4n
1895 Displays legacy \fBZFS\fR versions supported by the current software. See \fBzfs-features\fR(5) for a description of feature flags features supported by the current software.
1896 .RE
1897
1898 .sp
1899 .ne 2
1900 .mk
1901 .na
1902 \fB\fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...\fR
1903 .ad
1904 .sp .6
1905 .RS 4n
1906 Enables all supported features on the given pool. Once this is done, the pool will no longer be accessible on systems that do not support feature flags. See \fBzfs-features\fR(5) for details on compatability with systems that support feature flags, but do not support all features enabled on the pool.
1907 .sp
1908 .ne 2
1909 .mk
1910 .na
1911 \fB\fB-a\fR\fR
1912 .ad
1913 .RS 14n
1914 .rt
1915 Enables all supported features on all pools.
1916 .RE
1917
1918 .sp
1919 .ne 2
1920 .mk
1921 .na
1922 \fB\fB-V\fR \fIversion\fR\fR
1923 .ad
1924 .RS 14n
1925 .rt
1926 Upgrade to the specified legacy version. If the \fB-V\fR flag is specified, no features will be enabled on the pool. This option can only be used to increase the version number up to the last supported legacy version number.
1927 .RE
1928
1929 .RE
1930
1931 .SH EXAMPLES
1932 .LP
1933 \fBExample 1 \fRCreating a RAID-Z Storage Pool
1934 .sp
1935 .LP
1936 The following command creates a pool with a single \fBraidz\fR root \fIvdev\fR that consists of six disks.
1937
1938 .sp
1939 .in +2
1940 .nf
1941 # \fBzpool create tank raidz sda sdb sdc sdd sde sdf\fR
1942 .fi
1943 .in -2
1944 .sp
1945
1946 .LP
1947 \fBExample 2 \fRCreating a Mirrored Storage Pool
1948 .sp
1949 .LP
1950 The following command creates a pool with two mirrors, where each mirror contains two disks.
1951
1952 .sp
1953 .in +2
1954 .nf
1955 # \fBzpool create tank mirror sda sdb mirror sdc sdd\fR
1956 .fi
1957 .in -2
1958 .sp
1959
1960 .LP
1961 \fBExample 3 \fRCreating a ZFS Storage Pool by Using Partitions
1962 .sp
1963 .LP
1964 The following command creates an unmirrored pool using two disk partitions.
1965
1966 .sp
1967 .in +2
1968 .nf
1969 # \fBzpool create tank sda1 sdb2\fR
1970 .fi
1971 .in -2
1972 .sp
1973
1974 .LP
1975 \fBExample 4 \fRCreating a ZFS Storage Pool by Using Files
1976 .sp
1977 .LP
1978 The following command creates an unmirrored pool using files. While not recommended, a pool based on files can be useful for experimental purposes.
1979
1980 .sp
1981 .in +2
1982 .nf
1983 # \fBzpool create tank /path/to/file/a /path/to/file/b\fR
1984 .fi
1985 .in -2
1986 .sp
1987
1988 .LP
1989 \fBExample 5 \fRAdding a Mirror to a ZFS Storage Pool
1990 .sp
1991 .LP
1992 The following command adds two mirrored disks to the pool \fItank\fR, assuming the pool is already made up of two-way mirrors. The additional space is immediately available to any datasets within the pool.
1993
1994 .sp
1995 .in +2
1996 .nf
1997 # \fBzpool add tank mirror sda sdb\fR
1998 .fi
1999 .in -2
2000 .sp
2001
2002 .LP
2003 \fBExample 6 \fRListing Available ZFS Storage Pools
2004 .sp
2005 .LP
2006 The following command lists all available pools on the system. In this case, the pool \fIzion\fR is faulted due to a missing device.
2007
2008 .sp
2009 .LP
2010 The results from this command are similar to the following:
2011
2012 .sp
2013 .in +2
2014 .nf
2015 # \fBzpool list\fR
2016 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
2017 rpool 19.9G 8.43G 11.4G 33% - 42% 1.00x ONLINE -
2018 tank 61.5G 20.0G 41.5G 48% - 32% 1.00x ONLINE -
2019 zion - - - - - - - FAULTED -
2020 .fi
2021 .in -2
2022 .sp
2023
2024 .LP
2025 \fBExample 7 \fRDestroying a ZFS Storage Pool
2026 .sp
2027 .LP
2028 The following command destroys the pool \fItank\fR and any datasets contained within.
2029
2030 .sp
2031 .in +2
2032 .nf
2033 # \fBzpool destroy -f tank\fR
2034 .fi
2035 .in -2
2036 .sp
2037
2038 .LP
2039 \fBExample 8 \fRExporting a ZFS Storage Pool
2040 .sp
2041 .LP
2042 The following command exports the devices in pool \fItank\fR so that they can be relocated or later imported.
2043
2044 .sp
2045 .in +2
2046 .nf
2047 # \fBzpool export tank\fR
2048 .fi
2049 .in -2
2050 .sp
2051
2052 .LP
2053 \fBExample 9 \fRImporting a ZFS Storage Pool
2054 .sp
2055 .LP
2056 The following command displays available pools, and then imports the pool \fItank\fR for use on the system.
2057
2058 .sp
2059 .LP
2060 The results from this command are similar to the following:
2061
2062 .sp
2063 .in +2
2064 .nf
2065 # \fBzpool import\fR
2066 pool: tank
2067 id: 15451357997522795478
2068 state: ONLINE
2069 action: The pool can be imported using its name or numeric identifier.
2070 config:
2071
2072 tank ONLINE
2073 mirror ONLINE
2074 sda ONLINE
2075 sdb ONLINE
2076
2077 # \fBzpool import tank\fR
2078 .fi
2079 .in -2
2080 .sp
2081
2082 .LP
2083 \fBExample 10 \fRUpgrading All ZFS Storage Pools to the Current Version
2084 .sp
2085 .LP
2086 The following command upgrades all ZFS Storage pools to the current version of the software.
2087
2088 .sp
2089 .in +2
2090 .nf
2091 # \fBzpool upgrade -a\fR
2092 This system is currently running ZFS pool version 28.
2093 .fi
2094 .in -2
2095 .sp
2096
2097 .LP
2098 \fBExample 11 \fRManaging Hot Spares
2099 .sp
2100 .LP
2101 The following command creates a new pool with an available hot spare:
2102
2103 .sp
2104 .in +2
2105 .nf
2106 # \fBzpool create tank mirror sda sdb spare sdc\fR
2107 .fi
2108 .in -2
2109 .sp
2110
2111 .sp
2112 .LP
2113 If one of the disks were to fail, the pool would be reduced to the degraded state. The failed device can be replaced using the following command:
2114
2115 .sp
2116 .in +2
2117 .nf
2118 # \fBzpool replace tank sda sdd\fR
2119 .fi
2120 .in -2
2121 .sp
2122
2123 .sp
2124 .LP
2125 Once the data has been resilvered, the spare is automatically removed and is made available for use should another device fails. The hot spare can be permanently removed from the pool using the following command:
2126
2127 .sp
2128 .in +2
2129 .nf
2130 # \fBzpool remove tank sdc\fR
2131 .fi
2132 .in -2
2133 .sp
2134
2135 .LP
2136 \fBExample 12 \fRCreating a ZFS Pool with Mirrored Separate Intent Logs
2137 .sp
2138 .LP
2139 The following command creates a ZFS storage pool consisting of two, two-way mirrors and mirrored log devices:
2140
2141 .sp
2142 .in +2
2143 .nf
2144 # \fBzpool create pool mirror sda sdb mirror sdc sdd log mirror \e
2145 sde sdf\fR
2146 .fi
2147 .in -2
2148 .sp
2149
2150 .LP
2151 \fBExample 13 \fRAdding Cache Devices to a ZFS Pool
2152 .sp
2153 .LP
2154 The following command adds two disks for use as cache devices to a ZFS storage pool:
2155
2156 .sp
2157 .in +2
2158 .nf
2159 # \fBzpool add pool cache sdc sdd\fR
2160 .fi
2161 .in -2
2162 .sp
2163
2164 .sp
2165 .LP
2166 Once added, the cache devices gradually fill with content from main memory. Depending on the size of your cache devices, it could take over an hour for them to fill. Capacity and reads can be monitored using the \fBiostat\fR option as follows:
2167
2168 .sp
2169 .in +2
2170 .nf
2171 # \fBzpool iostat -v pool 5\fR
2172 .fi
2173 .in -2
2174 .sp
2175
2176 .LP
2177 \fBExample 14 \fRRemoving a Mirrored Log Device
2178 .sp
2179 .LP
2180 The following command removes the mirrored log device \fBmirror-2\fR.
2181
2182 .sp
2183 .LP
2184 Given this configuration:
2185
2186 .sp
2187 .in +2
2188 .nf
2189 pool: tank
2190 state: ONLINE
2191 scrub: none requested
2192 config:
2193
2194 NAME STATE READ WRITE CKSUM
2195 tank ONLINE 0 0 0
2196 mirror-0 ONLINE 0 0 0
2197 sda ONLINE 0 0 0
2198 sdb ONLINE 0 0 0
2199 mirror-1 ONLINE 0 0 0
2200 sdc ONLINE 0 0 0
2201 sdd ONLINE 0 0 0
2202 logs
2203 mirror-2 ONLINE 0 0 0
2204 sde ONLINE 0 0 0
2205 sdf ONLINE 0 0 0
2206 .fi
2207 .in -2
2208 .sp
2209
2210 .sp
2211 .LP
2212 The command to remove the mirrored log \fBmirror-2\fR is:
2213
2214 .sp
2215 .in +2
2216 .nf
2217 # \fBzpool remove tank mirror-2\fR
2218 .fi
2219 .in -2
2220 .sp
2221
2222 .LP
2223 \fBExample 15 \fRDisplaying expanded space on a device
2224 .sp
2225 .LP
2226 The following command displays the detailed information for the \fIdata\fR
2227 pool. This pool is comprised of a single \fIraidz\fR vdev where one of its
2228 devices increased its capacity by 10GB. In this example, the pool will not
2229 be able to utilized this extra capacity until all the devices under the
2230 \fIraidz\fR vdev have been expanded.
2231
2232 .sp
2233 .in +2
2234 .nf
2235 # \fBzpool list -v data\fR
2236 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT
2237 data 23.9G 14.6G 9.30G 48% - 61% 1.00x ONLINE -
2238 raidz1 23.9G 14.6G 9.30G 48% -
2239 c1t1d0 - - - - -
2240 c1t2d0 - - - - 10G
2241 c1t3d0 - - - - -
2242 .fi
2243 .in -2
2244
2245 .SH EXIT STATUS
2246 .sp
2247 .LP
2248 The following exit values are returned:
2249 .sp
2250 .ne 2
2251 .mk
2252 .na
2253 \fB\fB0\fR\fR
2254 .ad
2255 .RS 5n
2256 .rt
2257 Successful completion.
2258 .RE
2259
2260 .sp
2261 .ne 2
2262 .mk
2263 .na
2264 \fB\fB1\fR\fR
2265 .ad
2266 .RS 5n
2267 .rt
2268 An error occurred.
2269 .RE
2270
2271 .sp
2272 .ne 2
2273 .mk
2274 .na
2275 \fB\fB2\fR\fR
2276 .ad
2277 .RS 5n
2278 .rt
2279 Invalid command line options were specified.
2280 .RE
2281
2282 .SH SEE ALSO
2283 .sp
2284 .LP
2285 \fBzfs\fR(8), \fBzpool-features\fR(5)