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