1ad135b5dSChristopher Siden.\" 2*c8323d43SYuri Pankov.\" CDDL HEADER START 3*c8323d43SYuri Pankov.\" 4*c8323d43SYuri Pankov.\" The contents of this file are subject to the terms of the 5*c8323d43SYuri Pankov.\" Common Development and Distribution License (the "License"). 6*c8323d43SYuri Pankov.\" You may not use this file except in compliance with the License. 7*c8323d43SYuri Pankov.\" 8*c8323d43SYuri Pankov.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*c8323d43SYuri Pankov.\" or http://www.opensolaris.org/os/licensing. 10*c8323d43SYuri Pankov.\" See the License for the specific language governing permissions 11*c8323d43SYuri Pankov.\" and limitations under the License. 12*c8323d43SYuri Pankov.\" 13*c8323d43SYuri Pankov.\" When distributing Covered Code, include this CDDL HEADER in each 14*c8323d43SYuri Pankov.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*c8323d43SYuri Pankov.\" If applicable, add the following below this CDDL HEADER, with the 16*c8323d43SYuri Pankov.\" fields enclosed by brackets "[]" replaced with your own identifying 17*c8323d43SYuri Pankov.\" information: Portions Copyright [yyyy] [name of copyright owner] 18*c8323d43SYuri Pankov.\" 19*c8323d43SYuri Pankov.\" CDDL HEADER END 20*c8323d43SYuri Pankov.\" 21*c8323d43SYuri Pankov.\" 22*c8323d43SYuri Pankov.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved. 23*c8323d43SYuri Pankov.\" Copyright (c) 2013 by Delphix. All rights reserved. 24*c8323d43SYuri Pankov.\" Copyright 2016 Nexenta Systems, Inc. 25*c8323d43SYuri Pankov.\" 26*c8323d43SYuri Pankov.Dd February 15, 2016 27*c8323d43SYuri Pankov.Dt ZPOOL 1M 28*c8323d43SYuri Pankov.Os 29*c8323d43SYuri Pankov.Sh NAME 30*c8323d43SYuri Pankov.Nm zpool 31*c8323d43SYuri Pankov.Nd configure ZFS storage pools 32*c8323d43SYuri Pankov.Sh SYNOPSIS 33*c8323d43SYuri Pankov.Nm 34*c8323d43SYuri Pankov.Fl \? 35*c8323d43SYuri Pankov.Nm 36*c8323d43SYuri Pankov.Cm add 37*c8323d43SYuri Pankov.Op Fl fn 38*c8323d43SYuri Pankov.Ar pool vdev Ns ... 39*c8323d43SYuri Pankov.Nm 40*c8323d43SYuri Pankov.Cm attach 41*c8323d43SYuri Pankov.Op Fl f 42*c8323d43SYuri Pankov.Ar pool device new_device 43*c8323d43SYuri Pankov.Nm 44*c8323d43SYuri Pankov.Cm clear 45*c8323d43SYuri Pankov.Ar pool 46*c8323d43SYuri Pankov.Op Ar device 47*c8323d43SYuri Pankov.Nm 48*c8323d43SYuri Pankov.Cm create 49*c8323d43SYuri Pankov.Op Fl dfn 50*c8323d43SYuri Pankov.Op Fl m Ar mountpoint 51*c8323d43SYuri Pankov.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... 52*c8323d43SYuri Pankov.Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ... 53*c8323d43SYuri Pankov.Op Fl R Ar root 54*c8323d43SYuri Pankov.Ar pool vdev Ns ... 55*c8323d43SYuri Pankov.Nm 56*c8323d43SYuri Pankov.Cm destroy 57*c8323d43SYuri Pankov.Op Fl f 58*c8323d43SYuri Pankov.Ar pool 59*c8323d43SYuri Pankov.Nm 60*c8323d43SYuri Pankov.Cm detach 61*c8323d43SYuri Pankov.Ar pool device 62*c8323d43SYuri Pankov.Nm 63*c8323d43SYuri Pankov.Cm export 64*c8323d43SYuri Pankov.Op Fl f 65*c8323d43SYuri Pankov.Ar pool Ns ... 66*c8323d43SYuri Pankov.Nm 67*c8323d43SYuri Pankov.Cm get 68*c8323d43SYuri Pankov.Op Fl Hp 69*c8323d43SYuri Pankov.Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... 70*c8323d43SYuri Pankov.Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ... 71*c8323d43SYuri Pankov.Ar pool Ns ... 72*c8323d43SYuri Pankov.Nm 73*c8323d43SYuri Pankov.Cm history 74*c8323d43SYuri Pankov.Op Fl il 75*c8323d43SYuri Pankov.Oo Ar pool Oc Ns ... 76*c8323d43SYuri Pankov.Nm 77*c8323d43SYuri Pankov.Cm import 78*c8323d43SYuri Pankov.Op Fl D 79*c8323d43SYuri Pankov.Op Fl d Ar dir 80*c8323d43SYuri Pankov.Nm 81*c8323d43SYuri Pankov.Cm import 82*c8323d43SYuri Pankov.Fl a 83*c8323d43SYuri Pankov.Op Fl DfmN 84*c8323d43SYuri Pankov.Op Fl F Op Fl n 85*c8323d43SYuri Pankov.Op Fl c Ar cachefile Ns | Ns Fl d Ar dir 86*c8323d43SYuri Pankov.Op Fl o Ar mntopts 87*c8323d43SYuri Pankov.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... 88*c8323d43SYuri Pankov.Op Fl R Ar root 89*c8323d43SYuri Pankov.Nm 90*c8323d43SYuri Pankov.Cm import 91*c8323d43SYuri Pankov.Op Fl Dfm 92*c8323d43SYuri Pankov.Op Fl F Op Fl n 93*c8323d43SYuri Pankov.Op Fl c Ar cachefile Ns | Ns Fl d Ar dir 94*c8323d43SYuri Pankov.Op Fl o Ar mntopts 95*c8323d43SYuri Pankov.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... 96*c8323d43SYuri Pankov.Op Fl R Ar root 97*c8323d43SYuri Pankov.Ar pool Ns | Ns Ar id 98*c8323d43SYuri Pankov.Op Ar newpool 99*c8323d43SYuri Pankov.Nm 100*c8323d43SYuri Pankov.Cm iostat 101*c8323d43SYuri Pankov.Op Fl v 102*c8323d43SYuri Pankov.Op Fl T Sy u Ns | Ns Sy d 103*c8323d43SYuri Pankov.Oo Ar pool Oc Ns ... 104*c8323d43SYuri Pankov.Op Ar interval Op Ar count 105*c8323d43SYuri Pankov.Nm 106*c8323d43SYuri Pankov.Cm list 107*c8323d43SYuri Pankov.Op Fl Hpv 108*c8323d43SYuri Pankov.Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... 109*c8323d43SYuri Pankov.Op Fl T Sy u Ns | Ns Sy d 110*c8323d43SYuri Pankov.Oo Ar pool Oc Ns ... 111*c8323d43SYuri Pankov.Op Ar interval Op Ar count 112*c8323d43SYuri Pankov.Nm 113*c8323d43SYuri Pankov.Cm offline 114*c8323d43SYuri Pankov.Op Fl t 115*c8323d43SYuri Pankov.Ar pool Ar device Ns ... 116*c8323d43SYuri Pankov.Nm 117*c8323d43SYuri Pankov.Cm online 118*c8323d43SYuri Pankov.Op Fl e 119*c8323d43SYuri Pankov.Ar pool Ar device Ns ... 120*c8323d43SYuri Pankov.Nm 121*c8323d43SYuri Pankov.Cm reguid 122*c8323d43SYuri Pankov.Ar pool 123*c8323d43SYuri Pankov.Nm 124*c8323d43SYuri Pankov.Cm reopen 125*c8323d43SYuri Pankov.Ar pool 126*c8323d43SYuri Pankov.Nm 127*c8323d43SYuri Pankov.Cm remove 128*c8323d43SYuri Pankov.Ar pool Ar device Ns ... 129*c8323d43SYuri Pankov.Nm 130*c8323d43SYuri Pankov.Cm replace 131*c8323d43SYuri Pankov.Op Fl f 132*c8323d43SYuri Pankov.Ar pool Ar device Op Ar new_device 133*c8323d43SYuri Pankov.Nm 134*c8323d43SYuri Pankov.Cm scrub 135*c8323d43SYuri Pankov.Op Fl s 136*c8323d43SYuri Pankov.Ar pool Ns ... 137*c8323d43SYuri Pankov.Nm 138*c8323d43SYuri Pankov.Cm set 139*c8323d43SYuri Pankov.Ar property Ns = Ns Ar value 140*c8323d43SYuri Pankov.Ar pool 141*c8323d43SYuri Pankov.Nm 142*c8323d43SYuri Pankov.Cm status 143*c8323d43SYuri Pankov.Op Fl Dvx 144*c8323d43SYuri Pankov.Op Fl T Sy u Ns | Ns Sy d 145*c8323d43SYuri Pankov.Oo Ar pool Oc Ns ... 146*c8323d43SYuri Pankov.Op Ar interval Op Ar count 147*c8323d43SYuri Pankov.Nm 148*c8323d43SYuri Pankov.Cm upgrade 149*c8323d43SYuri Pankov.Nm 150*c8323d43SYuri Pankov.Cm upgrade 151*c8323d43SYuri Pankov.Fl v 152*c8323d43SYuri Pankov.Nm 153*c8323d43SYuri Pankov.Cm upgrade 154*c8323d43SYuri Pankov.Op Fl V Ar version 155*c8323d43SYuri Pankov.Fl a Ns | Ns Ar pool Ns ... 156*c8323d43SYuri Pankov.Sh DESCRIPTION 157*c8323d43SYuri PankovThe 158*c8323d43SYuri Pankov.Nm 159*c8323d43SYuri Pankovcommand configures ZFS storage pools. A storage pool is a collection of devices 160*c8323d43SYuri Pankovthat provides physical storage and data replication for ZFS datasets. All 161*c8323d43SYuri Pankovdatasets within a storage pool share the same space. See 162*c8323d43SYuri Pankov.Xr zfs 1M 163*c8323d43SYuri Pankovfor information on managing datasets. 164*c8323d43SYuri Pankov.Ss Virtual Devices (vdevs) 165c10c16deSRichard LoweA "virtual device" describes a single device or a collection of devices 166c10c16deSRichard Loweorganized according to certain performance and fault characteristics. The 167c10c16deSRichard Lowefollowing virtual devices are supported: 168*c8323d43SYuri Pankov.Bl -tag -width Ds 169*c8323d43SYuri Pankov.It Sy disk 170*c8323d43SYuri PankovA block device, typically located under 171*c8323d43SYuri Pankov.Pa /dev/dsk . 172*c8323d43SYuri PankovZFS can use individual slices or partitions, though the recommended mode of 173*c8323d43SYuri Pankovoperation is to use whole disks. A disk can be specified by a full path, or it 174*c8323d43SYuri Pankovcan be a shorthand name 175*c8323d43SYuri Pankov.Po the relative portion of the path under 176*c8323d43SYuri Pankov.Pa /dev/dsk 177*c8323d43SYuri Pankov.Pc . 178*c8323d43SYuri PankovA whole disk can be specified by omitting the slice or partition designation. 179*c8323d43SYuri PankovFor example, 180*c8323d43SYuri Pankov.Pa c0t0d0 181*c8323d43SYuri Pankovis equivalent to 182*c8323d43SYuri Pankov.Pa /dev/dsk/c0t0d0s2 . 183*c8323d43SYuri PankovWhen given a whole disk, ZFS automatically labels the disk, if necessary. 184*c8323d43SYuri Pankov.It Sy file 185c10c16deSRichard LoweA regular file. The use of files as a backing store is strongly discouraged. It 186c10c16deSRichard Loweis designed primarily for experimental purposes, as the fault tolerance of a 187c10c16deSRichard Lowefile is only as good as the file system of which it is a part. A file must be 188c10c16deSRichard Lowespecified by a full path. 189*c8323d43SYuri Pankov.It Sy mirror 190c10c16deSRichard LoweA mirror of two or more devices. Data is replicated in an identical fashion 191*c8323d43SYuri Pankovacross all components of a mirror. A mirror with N disks of size X can hold X 192*c8323d43SYuri Pankovbytes and can withstand (N-1) devices failing before data integrity is 193*c8323d43SYuri Pankovcompromised. 194*c8323d43SYuri Pankov.It Sy raidz , raidz1 , raidz2 , raidz3 195*c8323d43SYuri PankovA variation on RAID-5 that allows for better distribution of parity and 196*c8323d43SYuri Pankoveliminates the RAID-5 197*c8323d43SYuri Pankov.Qq write hole 198*c8323d43SYuri Pankov.Pq in which data and parity become inconsistent after a power loss . 199*c8323d43SYuri PankovData and parity is striped across all disks within a raidz group. 200*c8323d43SYuri Pankov.Pp 201*c8323d43SYuri PankovA raidz group can have single-, double-, or triple-parity, meaning that the 202*c8323d43SYuri Pankovraidz group can sustain one, two, or three failures, respectively, without 203*c8323d43SYuri Pankovlosing any data. The 204*c8323d43SYuri Pankov.Sy raidz1 205*c8323d43SYuri Pankovvdev type specifies a single-parity raidz group; the 206*c8323d43SYuri Pankov.Sy raidz2 207*c8323d43SYuri Pankovvdev type specifies a double-parity raidz group; and the 208*c8323d43SYuri Pankov.Sy raidz3 209*c8323d43SYuri Pankovvdev type specifies a triple-parity raidz group. The 210*c8323d43SYuri Pankov.Sy raidz 211*c8323d43SYuri Pankovvdev type is an alias for 212*c8323d43SYuri Pankov.Sy raidz1 . 213*c8323d43SYuri Pankov.Pp 214*c8323d43SYuri PankovA raidz group with N disks of size X with P parity disks can hold approximately 215*c8323d43SYuri Pankov(N-P)*X bytes and can withstand P device(s) failing before data integrity is 216*c8323d43SYuri Pankovcompromised. The minimum number of devices in a raidz group is one more than 217*c8323d43SYuri Pankovthe number of parity disks. The recommended number is between 3 and 9 to help 218*c8323d43SYuri Pankovincrease performance. 219*c8323d43SYuri Pankov.It Sy spare 220*c8323d43SYuri PankovA special pseudo-vdev which keeps track of available hot spares for a pool. For 221*c8323d43SYuri Pankovmore information, see the 222*c8323d43SYuri Pankov.Sx Hot Spares 223*c8323d43SYuri Pankovsection. 224*c8323d43SYuri Pankov.It Sy log 225*c8323d43SYuri PankovA separate intent log device. If more than one log device is specified, then 226c10c16deSRichard Lowewrites are load-balanced between devices. Log devices can be mirrored. However, 227*c8323d43SYuri Pankovraidz vdev types are not supported for the intent log. For more information, 228*c8323d43SYuri Pankovsee the 229*c8323d43SYuri Pankov.Sx Intent Log 230*c8323d43SYuri Pankovsection. 231*c8323d43SYuri Pankov.It Sy cache 232c10c16deSRichard LoweA device used to cache storage pool data. A cache device cannot be cannot be 233*c8323d43SYuri Pankovconfigured as a mirror or raidz group. For more information, see the 234*c8323d43SYuri Pankov.Sx Cache Devices 235*c8323d43SYuri Pankovsection. 236*c8323d43SYuri Pankov.El 237*c8323d43SYuri Pankov.Pp 238*c8323d43SYuri PankovVirtual devices cannot be nested, so a mirror or raidz virtual device can only 239*c8323d43SYuri Pankovcontain files or disks. Mirrors of mirrors 240*c8323d43SYuri Pankov.Pq or other combinations 241*c8323d43SYuri Pankovare not allowed. 242*c8323d43SYuri Pankov.Pp 243c10c16deSRichard LoweA pool can have any number of virtual devices at the top of the configuration 244*c8323d43SYuri Pankov.Po known as 245*c8323d43SYuri Pankov.Qq root vdevs 246*c8323d43SYuri Pankov.Pc . 247*c8323d43SYuri PankovData is dynamically distributed across all top-level devices to balance data 248*c8323d43SYuri Pankovamong devices. As new virtual devices are added, ZFS automatically places data 249*c8323d43SYuri Pankovon the newly available devices. 250*c8323d43SYuri Pankov.Pp 251c10c16deSRichard LoweVirtual devices are specified one at a time on the command line, separated by 252*c8323d43SYuri Pankovwhitespace. The keywords 253*c8323d43SYuri Pankov.Sy mirror 254*c8323d43SYuri Pankovand 255*c8323d43SYuri Pankov.Sy raidz 256*c8323d43SYuri Pankovare used to distinguish where a group ends and another begins. For example, 257*c8323d43SYuri Pankovthe following creates two root vdevs, each a mirror of two disks: 258*c8323d43SYuri Pankov.Bd -literal 259*c8323d43SYuri Pankov# zpool create mypool mirror c0t0d0 c0t1d0 mirror c1t0d0 c1t1d0 260*c8323d43SYuri Pankov.Ed 261*c8323d43SYuri Pankov.Ss Device Failure and Recovery 262*c8323d43SYuri PankovZFS supports a rich set of mechanisms for handling device failure and data 263*c8323d43SYuri Pankovcorruption. All metadata and data is checksummed, and ZFS automatically repairs 264*c8323d43SYuri Pankovbad data from a good copy when corruption is detected. 265*c8323d43SYuri Pankov.Pp 266c10c16deSRichard LoweIn order to take advantage of these features, a pool must make use of some form 267*c8323d43SYuri Pankovof redundancy, using either mirrored or raidz groups. While ZFS supports 268*c8323d43SYuri Pankovrunning in a non-redundant configuration, where each root vdev is simply a disk 269*c8323d43SYuri Pankovor file, this is strongly discouraged. A single case of bit corruption can 270*c8323d43SYuri Pankovrender some or all of your data unavailable. 271*c8323d43SYuri Pankov.Pp 272c10c16deSRichard LoweA pool's health status is described by one of three states: online, degraded, 273c10c16deSRichard Loweor faulted. An online pool has all devices operating normally. A degraded pool 274c10c16deSRichard Loweis one in which one or more devices have failed, but the data is still 275c10c16deSRichard Loweavailable due to a redundant configuration. A faulted pool has corrupted 276c10c16deSRichard Lowemetadata, or one or more faulted devices, and insufficient replicas to continue 277c10c16deSRichard Lowefunctioning. 278*c8323d43SYuri Pankov.Pp 279*c8323d43SYuri PankovThe health of the top-level vdev, such as mirror or raidz device, is 280c10c16deSRichard Lowepotentially impacted by the state of its associated vdevs, or component 281c10c16deSRichard Lowedevices. A top-level vdev or component device is in one of the following 282c10c16deSRichard Lowestates: 283*c8323d43SYuri Pankov.Bl -tag -width "DEGRADED" 284*c8323d43SYuri Pankov.It Sy DEGRADED 285c10c16deSRichard LoweOne or more top-level vdevs is in the degraded state because one or more 286c10c16deSRichard Lowecomponent devices are offline. Sufficient replicas exist to continue 287c10c16deSRichard Lowefunctioning. 288*c8323d43SYuri Pankov.Pp 289c10c16deSRichard LoweOne or more component devices is in the degraded or faulted state, but 290c10c16deSRichard Lowesufficient replicas exist to continue functioning. The underlying conditions 291c10c16deSRichard Loweare as follows: 292*c8323d43SYuri Pankov.Bl -bullet 293*c8323d43SYuri Pankov.It 294c10c16deSRichard LoweThe number of checksum errors exceeds acceptable levels and the device is 295*c8323d43SYuri Pankovdegraded as an indication that something may be wrong. ZFS continues to use the 296*c8323d43SYuri Pankovdevice as necessary. 297*c8323d43SYuri Pankov.It 298c10c16deSRichard LoweThe number of I/O errors exceeds acceptable levels. The device could not be 299c10c16deSRichard Lowemarked as faulted because there are insufficient replicas to continue 300c10c16deSRichard Lowefunctioning. 301*c8323d43SYuri Pankov.El 302*c8323d43SYuri Pankov.It Sy FAULTED 303c10c16deSRichard LoweOne or more top-level vdevs is in the faulted state because one or more 304c10c16deSRichard Lowecomponent devices are offline. Insufficient replicas exist to continue 305c10c16deSRichard Lowefunctioning. 306*c8323d43SYuri Pankov.Pp 307c10c16deSRichard LoweOne or more component devices is in the faulted state, and insufficient 308c10c16deSRichard Lowereplicas exist to continue functioning. The underlying conditions are as 309c10c16deSRichard Lowefollows: 310*c8323d43SYuri Pankov.Bl -bullet 311*c8323d43SYuri Pankov.It 312c10c16deSRichard LoweThe device could be opened, but the contents did not match expected values. 313*c8323d43SYuri Pankov.It 314c10c16deSRichard LoweThe number of I/O errors exceeds acceptable levels and the device is faulted to 315c10c16deSRichard Loweprevent further use of the device. 316*c8323d43SYuri Pankov.El 317*c8323d43SYuri Pankov.It Sy OFFLINE 318*c8323d43SYuri PankovThe device was explicitly taken offline by the 319*c8323d43SYuri Pankov.Nm zpool Cm offline 320*c8323d43SYuri Pankovcommand. 321*c8323d43SYuri Pankov.It Sy ONLINE 322c10c16deSRichard LoweThe device is online and functioning. 323*c8323d43SYuri Pankov.It Sy REMOVED 324c10c16deSRichard LoweThe device was physically removed while the system was running. Device removal 325c10c16deSRichard Lowedetection is hardware-dependent and may not be supported on all platforms. 326*c8323d43SYuri Pankov.It Sy UNAVAIL 327c10c16deSRichard LoweThe device could not be opened. If a pool is imported when a device was 328c10c16deSRichard Loweunavailable, then the device will be identified by a unique identifier instead 329c10c16deSRichard Loweof its path since the path was never correct in the first place. 330*c8323d43SYuri Pankov.El 331*c8323d43SYuri Pankov.Pp 332*c8323d43SYuri PankovIf a device is removed and later re-attached to the system, ZFS attempts 333c10c16deSRichard Loweto put the device online automatically. Device attach detection is 334c10c16deSRichard Lowehardware-dependent and might not be supported on all platforms. 335*c8323d43SYuri Pankov.Ss Hot Spares 336*c8323d43SYuri PankovZFS allows devices to be associated with pools as 337*c8323d43SYuri Pankov.Qq hot spares . 338*c8323d43SYuri PankovThese devices are not actively used in the pool, but when an active device 339*c8323d43SYuri Pankovfails, it is automatically replaced by a hot spare. To create a pool with hot 340*c8323d43SYuri Pankovspares, specify a 341*c8323d43SYuri Pankov.Sy spare 342*c8323d43SYuri Pankovvdev with any number of devices. For example, 343*c8323d43SYuri Pankov.Bd -literal 344c10c16deSRichard Lowe# zpool create pool mirror c0d0 c1d0 spare c2d0 c3d0 345*c8323d43SYuri Pankov.Ed 346*c8323d43SYuri Pankov.Pp 347*c8323d43SYuri PankovSpares can be shared across multiple pools, and can be added with the 348*c8323d43SYuri Pankov.Nm zpool Cm add 349*c8323d43SYuri Pankovcommand and removed with the 350*c8323d43SYuri Pankov.Nm zpool Cm remove 351*c8323d43SYuri Pankovcommand. Once a spare replacement is initiated, a new 352*c8323d43SYuri Pankov.Sy spare 353*c8323d43SYuri Pankovvdev is created within the configuration that will remain there until the 354*c8323d43SYuri Pankovoriginal device is replaced. At this point, the hot spare becomes available 355*c8323d43SYuri Pankovagain if another device fails. 356*c8323d43SYuri Pankov.Pp 357c10c16deSRichard LoweIf a pool has a shared spare that is currently being used, the pool can not be 358c10c16deSRichard Loweexported since other pools may use this shared spare, which may lead to 359c10c16deSRichard Lowepotential data corruption. 360*c8323d43SYuri Pankov.Pp 361c10c16deSRichard LoweAn in-progress spare replacement can be cancelled by detaching the hot spare. 362c10c16deSRichard LoweIf the original faulted device is detached, then the hot spare assumes its 363c10c16deSRichard Loweplace in the configuration, and is removed from the spare list of all active 364c10c16deSRichard Lowepools. 365*c8323d43SYuri Pankov.Pp 366c10c16deSRichard LoweSpares cannot replace log devices. 367*c8323d43SYuri Pankov.Ss Intent Log 368*c8323d43SYuri PankovThe ZFS Intent Log (ZIL) satisfies POSIX requirements for synchronous 369*c8323d43SYuri Pankovtransactions. For instance, databases often require their transactions to be on 370*c8323d43SYuri Pankovstable storage devices when returning from a system call. NFS and other 371*c8323d43SYuri Pankovapplications can also use 372*c8323d43SYuri Pankov.Xr fsync 3C 373*c8323d43SYuri Pankovto ensure data stability. By default, the intent log is allocated from blocks 374*c8323d43SYuri Pankovwithin the main pool. However, it might be possible to get better performance 375*c8323d43SYuri Pankovusing separate intent log devices such as NVRAM or a dedicated disk. For 376*c8323d43SYuri Pankovexample: 377*c8323d43SYuri Pankov.Bd -literal 378*c8323d43SYuri Pankov# zpool create pool c0d0 c1d0 log c2d0 379*c8323d43SYuri Pankov.Ed 380*c8323d43SYuri Pankov.Pp 381c10c16deSRichard LoweMultiple log devices can also be specified, and they can be mirrored. See the 382*c8323d43SYuri Pankov.Sx EXAMPLES 383*c8323d43SYuri Pankovsection for an example of mirroring multiple log devices. 384*c8323d43SYuri Pankov.Pp 385c10c16deSRichard LoweLog devices can be added, replaced, attached, detached, and imported and 386c10c16deSRichard Loweexported as part of the larger pool. Mirrored log devices can be removed by 387c10c16deSRichard Lowespecifying the top-level mirror for the log. 388*c8323d43SYuri Pankov.Ss Cache Devices 389*c8323d43SYuri PankovDevices can be added to a storage pool as 390*c8323d43SYuri Pankov.Qq cache devices . 391*c8323d43SYuri PankovThese devices provide an additional layer of caching between main memory and 392*c8323d43SYuri Pankovdisk. For read-heavy workloads, where the working set size is much larger than 393*c8323d43SYuri Pankovwhat can be cached in main memory, using cache devices allow much more of this 394*c8323d43SYuri Pankovworking set to be served from low latency media. Using cache devices provides 395*c8323d43SYuri Pankovthe greatest performance improvement for random read-workloads of mostly static 396c10c16deSRichard Lowecontent. 397*c8323d43SYuri Pankov.Pp 398*c8323d43SYuri PankovTo create a pool with cache devices, specify a 399*c8323d43SYuri Pankov.Sy cache 400*c8323d43SYuri Pankovvdev with any number of devices. For example: 401*c8323d43SYuri Pankov.Bd -literal 402*c8323d43SYuri Pankov# zpool create pool c0d0 c1d0 cache c2d0 c3d0 403*c8323d43SYuri Pankov.Ed 404*c8323d43SYuri Pankov.Pp 405*c8323d43SYuri PankovCache devices cannot be mirrored or part of a raidz configuration. If a read 406*c8323d43SYuri Pankoverror is encountered on a cache device, that read I/O is reissued to the 407*c8323d43SYuri Pankovoriginal storage pool device, which might be part of a mirrored or raidz 408*c8323d43SYuri Pankovconfiguration. 409*c8323d43SYuri Pankov.Pp 410c10c16deSRichard LoweThe content of the cache devices is considered volatile, as is the case with 411c10c16deSRichard Loweother system caches. 412*c8323d43SYuri Pankov.Ss Properties 413c10c16deSRichard LoweEach pool has several properties associated with it. Some properties are 414c10c16deSRichard Loweread-only statistics while others are configurable and change the behavior of 415*c8323d43SYuri Pankovthe pool. 416*c8323d43SYuri Pankov.Pp 417*c8323d43SYuri PankovThe following are read-only properties: 418*c8323d43SYuri Pankov.Bl -tag -width Ds 419*c8323d43SYuri Pankov.It Sy available 420c10c16deSRichard LoweAmount of storage available within the pool. This property can also be referred 421*c8323d43SYuri Pankovto by its shortened column name, 422*c8323d43SYuri Pankov.Sy avail . 423*c8323d43SYuri Pankov.It Sy capacity 424c10c16deSRichard LowePercentage of pool space used. This property can also be referred to by its 425*c8323d43SYuri Pankovshortened column name, 426*c8323d43SYuri Pankov.Sy cap . 427*c8323d43SYuri Pankov.It Sy expandsize 4284263d13fSGeorge WilsonAmount of uninitialized space within the pool or device that can be used to 4294263d13fSGeorge Wilsonincrease the total capacity of the pool. Uninitialized space consists of 4304263d13fSGeorge Wilsonany space on an EFI labeled vdev which has not been brought online 431*c8323d43SYuri Pankov.Po e.g, using 432*c8323d43SYuri Pankov.Nm zpool Cm online Fl e 433*c8323d43SYuri Pankov.Pc . 434*c8323d43SYuri PankovThis space occurs when a LUN is dynamically expanded. 435*c8323d43SYuri Pankov.It Sy fragmentation 4362e4c9986SGeorge WilsonThe amount of fragmentation in the pool. 437*c8323d43SYuri Pankov.It Sy free 438ad135b5dSChristopher SidenThe amount of free space available in the pool. 439*c8323d43SYuri Pankov.It Sy freeing 440ad135b5dSChristopher SidenAfter a file system or snapshot is destroyed, the space it was using is 441*c8323d43SYuri Pankovreturned to the pool asynchronously. 442*c8323d43SYuri Pankov.Sy freeing 443*c8323d43SYuri Pankovis the amount of space remaining to be reclaimed. Over time 444*c8323d43SYuri Pankov.Sy freeing 445*c8323d43SYuri Pankovwill decrease while 446*c8323d43SYuri Pankov.Sy free 447*c8323d43SYuri Pankovincreases. 448*c8323d43SYuri Pankov.It Sy health 449*c8323d43SYuri PankovThe current health of the pool. Health can be one of 450*c8323d43SYuri Pankov.Sy ONLINE , DEGRADED , FAULTED , OFFLINE, REMOVED , UNAVAIL . 451*c8323d43SYuri Pankov.It Sy guid 452c10c16deSRichard LoweA unique identifier for the pool. 453*c8323d43SYuri Pankov.It Sy size 454c10c16deSRichard LoweTotal size of the storage pool. 455*c8323d43SYuri Pankov.It Sy unsupported@ Ns Em feature_guid 456ad135b5dSChristopher SidenInformation about unsupported features that are enabled on the pool. See 457*c8323d43SYuri Pankov.Xr zpool-features 5 458*c8323d43SYuri Pankovfor details. 459*c8323d43SYuri Pankov.It Sy used 460c10c16deSRichard LoweAmount of storage space used within the pool. 461*c8323d43SYuri Pankov.El 462*c8323d43SYuri Pankov.Pp 463ad135b5dSChristopher SidenThe space usage properties report actual physical space available to the 464c10c16deSRichard Lowestorage pool. The physical space can be different from the total amount of 465c10c16deSRichard Lowespace that any contained datasets can actually use. The amount of space used in 466*c8323d43SYuri Pankova raidz configuration depends on the characteristics of the data being 467*c8323d43SYuri Pankovwritten. In addition, ZFS reserves some space for internal accounting 468*c8323d43SYuri Pankovthat the 469*c8323d43SYuri Pankov.Xr zfs 1M 470*c8323d43SYuri Pankovcommand takes into account, but the 471*c8323d43SYuri Pankov.Nm 472*c8323d43SYuri Pankovcommand does not. For non-full pools of a reasonable size, these effects should 473*c8323d43SYuri Pankovbe invisible. For small pools, or pools that are close to being completely 474*c8323d43SYuri Pankovfull, these discrepancies may become more noticeable. 475*c8323d43SYuri Pankov.Pp 476c10c16deSRichard LoweThe following property can be set at creation time and import time: 477*c8323d43SYuri Pankov.Bl -tag -width Ds 478*c8323d43SYuri Pankov.It Sy altroot 479c10c16deSRichard LoweAlternate root directory. If set, this directory is prepended to any mount 480c10c16deSRichard Lowepoints within the pool. This can be used when examining an unknown pool where 481c10c16deSRichard Lowethe mount points cannot be trusted, or in an alternate boot environment, where 482*c8323d43SYuri Pankovthe typical paths are not valid. 483*c8323d43SYuri Pankov.Sy altroot 484*c8323d43SYuri Pankovis not a persistent property. It is valid only while the system is up. Setting 485*c8323d43SYuri Pankov.Sy altroot 486*c8323d43SYuri Pankovdefaults to using 487*c8323d43SYuri Pankov.Sy cachefile Ns = Ns Sy none , 488*c8323d43SYuri Pankovthough this may be overridden using an explicit setting. 489*c8323d43SYuri Pankov.El 490*c8323d43SYuri Pankov.Pp 491409f1c06SAdam StevkoThe following property can be set only at import time: 492*c8323d43SYuri Pankov.Bl -tag -width Ds 493*c8323d43SYuri Pankov.It Sy readonly Ns = Ns Sy on Ns | Ns Sy off 494*c8323d43SYuri PankovIf set to 495*c8323d43SYuri Pankov.Sy on , 496*c8323d43SYuri Pankovthe pool will be imported in read-only mode. This property can also be referred 497*c8323d43SYuri Pankovto by its shortened column name, 498*c8323d43SYuri Pankov.Sy rdonly . 499*c8323d43SYuri Pankov.El 500*c8323d43SYuri Pankov.Pp 501c10c16deSRichard LoweThe following properties can be set at creation time and import time, and later 502*c8323d43SYuri Pankovchanged with the 503*c8323d43SYuri Pankov.Nm zpool Cm set 504*c8323d43SYuri Pankovcommand: 505*c8323d43SYuri Pankov.Bl -tag -width Ds 506*c8323d43SYuri Pankov.It Sy autoexpand Ns = Ns Sy on Ns | Ns Sy off 507c10c16deSRichard LoweControls automatic pool expansion when the underlying LUN is grown. If set to 508*c8323d43SYuri Pankov.Sy on , 509*c8323d43SYuri Pankovthe pool will be resized according to the size of the expanded device. If the 510*c8323d43SYuri Pankovdevice is part of a mirror or raidz then all devices within that mirror/raidz 511*c8323d43SYuri Pankovgroup must be expanded before the new space is made available to the pool. The 512*c8323d43SYuri Pankovdefault behavior is 513*c8323d43SYuri Pankov.Sy off . 514*c8323d43SYuri PankovThis property can also be referred to by its shortened column name, 515*c8323d43SYuri Pankov.Sy expand . 516*c8323d43SYuri Pankov.It Sy autoreplace Ns = Ns Sy on Ns | Ns Sy off 517*c8323d43SYuri PankovControls automatic device replacement. If set to 518*c8323d43SYuri Pankov.Sy off , 519*c8323d43SYuri Pankovdevice replacement must be initiated by the administrator by using the 520*c8323d43SYuri Pankov.Nm zpool Cm replace 521*c8323d43SYuri Pankovcommand. If set to 522*c8323d43SYuri Pankov.Sy on , 523*c8323d43SYuri Pankovany new device, found in the same physical location as a device that previously 524*c8323d43SYuri Pankovbelonged to the pool, is automatically formatted and replaced. The default 525*c8323d43SYuri Pankovbehavior is 526*c8323d43SYuri Pankov.Sy off . 527*c8323d43SYuri PankovThis property can also be referred to by its shortened column name, 528*c8323d43SYuri Pankov.Sy replace . 529*c8323d43SYuri Pankov.It Sy bootfs Ns = Ns Ar pool Ns / Ns Ar dataset 530c10c16deSRichard LoweIdentifies the default bootable dataset for the root pool. This property is 531c10c16deSRichard Loweexpected to be set mainly by the installation and upgrade programs. 532*c8323d43SYuri Pankov.It Sy cachefile Ns = Ns Ar path Ns | Ns Sy none 533c10c16deSRichard LoweControls the location of where the pool configuration is cached. Discovering 534c10c16deSRichard Loweall pools on system startup requires a cached copy of the configuration data 535c10c16deSRichard Lowethat is stored on the root file system. All pools in this cache are 536c10c16deSRichard Loweautomatically imported when the system boots. Some environments, such as 537c10c16deSRichard Loweinstall and clustering, need to cache this information in a different location 538c10c16deSRichard Loweso that pools are not automatically imported. Setting this property caches the 539c10c16deSRichard Lowepool configuration in a different location that can later be imported with 540*c8323d43SYuri Pankov.Nm zpool Cm import Fl c . 541*c8323d43SYuri PankovSetting it to the special value 542*c8323d43SYuri Pankov.Sy none 543*c8323d43SYuri Pankovcreates a temporary pool that is never cached, and the special value 544*c8323d43SYuri Pankov.Qq 545*c8323d43SYuri Pankov.Pq empty string 546*c8323d43SYuri Pankovuses the default location. 547*c8323d43SYuri Pankov.Pp 548c10c16deSRichard LoweMultiple pools can share the same cache file. Because the kernel destroys and 549c10c16deSRichard Lowerecreates this file when pools are added and removed, care should be taken when 550*c8323d43SYuri Pankovattempting to access this file. When the last pool using a 551*c8323d43SYuri Pankov.Sy cachefile 552*c8323d43SYuri Pankovis exported or destroyed, the file is removed. 553*c8323d43SYuri Pankov.It Sy comment Ns = Ns Ar text 554ad135b5dSChristopher SidenA text string consisting of printable ASCII characters that will be stored 555ad135b5dSChristopher Sidensuch that it is available even if the pool becomes faulted. An administrator 556ad135b5dSChristopher Sidencan provide additional information about a pool using this property. 557*c8323d43SYuri Pankov.It Sy dedupditto Ns = Ns Ar number 558e902ed8eSTim ChaseThreshold for the number of block ditto copies. If the reference count for a 559e902ed8eSTim Chasededuplicated block increases above this number, a new ditto copy of this block 560*c8323d43SYuri Pankovis automatically stored. The default setting is 561*c8323d43SYuri Pankov.Sy 0 562*c8323d43SYuri Pankovwhich causes no ditto copies to be created for deduplicated blocks. The miniumum 563*c8323d43SYuri Pankovlegal nonzero setting is 564*c8323d43SYuri Pankov.Sy 100 . 565*c8323d43SYuri Pankov.It Sy delegation Ns = Ns Sy on Ns | Ns Sy off 566c10c16deSRichard LoweControls whether a non-privileged user is granted access based on the dataset 567*c8323d43SYuri Pankovpermissions defined on the dataset. See 568*c8323d43SYuri Pankov.Xr zfs 1M 569*c8323d43SYuri Pankovfor more information on ZFS delegated administration. 570*c8323d43SYuri Pankov.It Sy failmode Ns = Ns Sy wait Ns | Ns Sy continue Ns | Ns Sy panic 571c10c16deSRichard LoweControls the system behavior in the event of catastrophic pool failure. This 572c10c16deSRichard Lowecondition is typically a result of a loss of connectivity to the underlying 573c10c16deSRichard Lowestorage device(s) or a failure of all devices within the pool. The behavior of 574c10c16deSRichard Lowesuch an event is determined as follows: 575*c8323d43SYuri Pankov.Bl -tag -width "continue" 576*c8323d43SYuri Pankov.It Sy wait 577*c8323d43SYuri PankovBlocks all I/O access until the device connectivity is recovered and the errors 578*c8323d43SYuri Pankovare cleared. This is the default behavior. 579*c8323d43SYuri Pankov.It Sy continue 580*c8323d43SYuri PankovReturns 581*c8323d43SYuri Pankov.Er EIO 582*c8323d43SYuri Pankovto any new write I/O requests but allows reads to any of the remaining healthy 583*c8323d43SYuri Pankovdevices. Any write requests that have yet to be committed to disk would be 584*c8323d43SYuri Pankovblocked. 585*c8323d43SYuri Pankov.It Sy panic 586c10c16deSRichard LowePrints out a message to the console and generates a system crash dump. 587*c8323d43SYuri Pankov.El 588*c8323d43SYuri Pankov.It Sy feature@ Ns Ar feature_name Ns = Ns Sy enabled 589*c8323d43SYuri PankovThe value of this property is the current state of 590*c8323d43SYuri Pankov.Ar feature_name . 591*c8323d43SYuri PankovThe only valid value when setting this property is 592*c8323d43SYuri Pankov.Sy enabled 593*c8323d43SYuri Pankovwhich moves 594*c8323d43SYuri Pankov.Ar feature_name 595*c8323d43SYuri Pankovto the enabled state. See 596*c8323d43SYuri Pankov.Xr zpool-features 5 597*c8323d43SYuri Pankovfor details on feature states. 598*c8323d43SYuri Pankov.It Sy listsnaps Ns = Ns Sy on Ns | Ns Sy off 599c10c16deSRichard LoweControls whether information about snapshots associated with this pool is 600*c8323d43SYuri Pankovoutput when 601*c8323d43SYuri Pankov.Nm zfs Cm list 602*c8323d43SYuri Pankovis run without the 603*c8323d43SYuri Pankov.Fl t 604*c8323d43SYuri Pankovoption. The default value is 605*c8323d43SYuri Pankov.Sy off . 606*c8323d43SYuri Pankov.It Sy version Ns = Ns Ar version 607c10c16deSRichard LoweThe current on-disk version of the pool. This can be increased, but never 608*c8323d43SYuri Pankovdecreased. The preferred method of updating pools is with the 609*c8323d43SYuri Pankov.Nm zpool Cm upgrade 610*c8323d43SYuri Pankovcommand, though this property can be used when a specific version is needed for 611*c8323d43SYuri Pankovbackwards compatibility. Once feature flags is enabled on a pool this property 612*c8323d43SYuri Pankovwill no longer have a value. 613*c8323d43SYuri Pankov.El 614*c8323d43SYuri Pankov.Ss Subcommands 615c10c16deSRichard LoweAll subcommands that modify state are logged persistently to the pool in their 616c10c16deSRichard Loweoriginal form. 617*c8323d43SYuri Pankov.Pp 618*c8323d43SYuri PankovThe 619*c8323d43SYuri Pankov.Nm 620*c8323d43SYuri Pankovcommand provides subcommands to create and destroy storage pools, add capacity 621*c8323d43SYuri Pankovto storage pools, and provide information about the storage pools. The 622*c8323d43SYuri Pankovfollowing subcommands are supported: 623*c8323d43SYuri Pankov.Bl -tag -width Ds 624*c8323d43SYuri Pankov.It Xo 625*c8323d43SYuri Pankov.Nm 626*c8323d43SYuri Pankov.Fl \? 627*c8323d43SYuri Pankov.Xc 628c10c16deSRichard LoweDisplays a help message. 629*c8323d43SYuri Pankov.It Xo 630*c8323d43SYuri Pankov.Nm 631*c8323d43SYuri Pankov.Cm add 632*c8323d43SYuri Pankov.Op Fl fn 633*c8323d43SYuri Pankov.Ar pool vdev Ns ... 634*c8323d43SYuri Pankov.Xc 635*c8323d43SYuri PankovAdds the specified virtual devices to the given pool. The 636*c8323d43SYuri Pankov.Ar vdev 637*c8323d43SYuri Pankovspecification is described in the 638*c8323d43SYuri Pankov.Sx Virtual Devices 639*c8323d43SYuri Pankovsection. The behavior of the 640*c8323d43SYuri Pankov.Fl f 641*c8323d43SYuri Pankovoption, and the device checks performed are described in the 642*c8323d43SYuri Pankov.Nm zpool Cm create 643*c8323d43SYuri Pankovsubcommand. 644*c8323d43SYuri Pankov.Bl -tag -width Ds 645*c8323d43SYuri Pankov.It Fl f 646*c8323d43SYuri PankovForces use of 647*c8323d43SYuri Pankov.Ar vdev Ns s , 648*c8323d43SYuri Pankoveven if they appear in use or specify a conflicting replication level. Not all 649c10c16deSRichard Lowedevices can be overridden in this manner. 650*c8323d43SYuri Pankov.It Fl n 651*c8323d43SYuri PankovDisplays the configuration that would be used without actually adding the 652*c8323d43SYuri Pankov.Ar vdev Ns s . 653*c8323d43SYuri PankovThe actual pool creation can still fail due to insufficient privileges or 654*c8323d43SYuri Pankovdevice sharing. 655*c8323d43SYuri Pankov.El 656*c8323d43SYuri Pankov.It Xo 657*c8323d43SYuri Pankov.Nm 658*c8323d43SYuri Pankov.Cm attach 659*c8323d43SYuri Pankov.Op Fl f 660*c8323d43SYuri Pankov.Ar pool device new_device 661*c8323d43SYuri Pankov.Xc 662*c8323d43SYuri PankovAttaches 663*c8323d43SYuri Pankov.Ar new_device 664*c8323d43SYuri Pankovto the existing 665*c8323d43SYuri Pankov.Ar device . 666*c8323d43SYuri PankovThe existing device cannot be part of a raidz configuration. If 667*c8323d43SYuri Pankov.Ar device 668*c8323d43SYuri Pankovis not currently part of a mirrored configuration, 669*c8323d43SYuri Pankov.Ar device 670*c8323d43SYuri Pankovautomatically transforms into a two-way mirror of 671*c8323d43SYuri Pankov.Ar device 672*c8323d43SYuri Pankovand 673*c8323d43SYuri Pankov.Ar new_device . 674*c8323d43SYuri PankovIf 675*c8323d43SYuri Pankov.Ar device 676*c8323d43SYuri Pankovis part of a two-way mirror, attaching 677*c8323d43SYuri Pankov.Ar new_device 678*c8323d43SYuri Pankovcreates a three-way mirror, and so on. In either case, 679*c8323d43SYuri Pankov.Ar new_device 680*c8323d43SYuri Pankovbegins to resilver immediately. 681*c8323d43SYuri Pankov.Bl -tag -width Ds 682*c8323d43SYuri Pankov.It Fl f 683*c8323d43SYuri PankovForces use of 684*c8323d43SYuri Pankov.Ar new_device , 685*c8323d43SYuri Pankoveven if its appears to be in use. Not all devices can be overridden in this 686*c8323d43SYuri Pankovmanner. 687*c8323d43SYuri Pankov.El 688*c8323d43SYuri Pankov.It Xo 689*c8323d43SYuri Pankov.Nm 690*c8323d43SYuri Pankov.Cm clear 691*c8323d43SYuri Pankov.Ar pool 692*c8323d43SYuri Pankov.Op Ar device 693*c8323d43SYuri Pankov.Xc 694c10c16deSRichard LoweClears device errors in a pool. If no arguments are specified, all device 695c10c16deSRichard Loweerrors within the pool are cleared. If one or more devices is specified, only 696c10c16deSRichard Lowethose errors associated with the specified device or devices are cleared. 697*c8323d43SYuri Pankov.It Xo 698*c8323d43SYuri Pankov.Nm 699*c8323d43SYuri Pankov.Cm create 700*c8323d43SYuri Pankov.Op Fl dfn 701*c8323d43SYuri Pankov.Op Fl m Ar mountpoint 702*c8323d43SYuri Pankov.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... 703*c8323d43SYuri Pankov.Oo Fl O Ar file-system-property Ns = Ns Ar value Oc Ns ... 704*c8323d43SYuri Pankov.Op Fl R Ar root 705*c8323d43SYuri Pankov.Ar pool vdev Ns ... 706*c8323d43SYuri Pankov.Xc 707c10c16deSRichard LoweCreates a new storage pool containing the virtual devices specified on the 708c10c16deSRichard Lowecommand line. The pool name must begin with a letter, and can only contain 709*c8323d43SYuri Pankovalphanumeric characters as well as underscore 710*c8323d43SYuri Pankov.Pq Qq Sy _ , 711*c8323d43SYuri Pankovdash 712*c8323d43SYuri Pankov.Pq Qq Sy - , 713*c8323d43SYuri Pankovand period 714*c8323d43SYuri Pankov.Pq Qq Sy \&. . 715*c8323d43SYuri PankovThe pool names 716*c8323d43SYuri Pankov.Sy mirror , 717*c8323d43SYuri Pankov.Sy raidz , 718*c8323d43SYuri Pankov.Sy spare 719*c8323d43SYuri Pankovand 720*c8323d43SYuri Pankov.Sy log 721*c8323d43SYuri Pankovare reserved, as are names beginning with the pattern 722*c8323d43SYuri Pankov.Sy c[0-9] . 723*c8323d43SYuri PankovThe 724*c8323d43SYuri Pankov.Ar vdev 725*c8323d43SYuri Pankovspecification is described in the 726*c8323d43SYuri Pankov.Sx Virtual Devices 727*c8323d43SYuri Pankovsection. 728*c8323d43SYuri Pankov.Pp 729c10c16deSRichard LoweThe command verifies that each device specified is accessible and not currently 730c10c16deSRichard Lowein use by another subsystem. There are some uses, such as being currently 731c10c16deSRichard Lowemounted, or specified as the dedicated dump device, that prevents a device from 732*c8323d43SYuri Pankovever being used by ZFS . Other uses, such as having a preexisting UFS file 733*c8323d43SYuri Pankovsystem, can be overridden with the 734*c8323d43SYuri Pankov.Fl f 735*c8323d43SYuri Pankovoption. 736*c8323d43SYuri Pankov.Pp 737c10c16deSRichard LoweThe command also checks that the replication strategy for the pool is 738c10c16deSRichard Loweconsistent. An attempt to combine redundant and non-redundant storage in a 739*c8323d43SYuri Pankovsingle pool, or to mix disks and files, results in an error unless 740*c8323d43SYuri Pankov.Fl f 741*c8323d43SYuri Pankovis specified. The use of differently sized devices within a single raidz or 742*c8323d43SYuri Pankovmirror group is also flagged as an error unless 743*c8323d43SYuri Pankov.Fl f 744*c8323d43SYuri Pankovis specified. 745*c8323d43SYuri Pankov.Pp 746*c8323d43SYuri PankovUnless the 747*c8323d43SYuri Pankov.Fl R 748*c8323d43SYuri Pankovoption is specified, the default mount point is 749*c8323d43SYuri Pankov.Pa / Ns Ar pool . 750*c8323d43SYuri PankovThe mount point must not exist or must be empty, or else the root dataset 751*c8323d43SYuri Pankovcannot be mounted. This can be overridden with the 752*c8323d43SYuri Pankov.Fl m 753c10c16deSRichard Loweoption. 754*c8323d43SYuri Pankov.Pp 755ad135b5dSChristopher SidenBy default all supported features are enabled on the new pool unless the 756*c8323d43SYuri Pankov.Fl d 757*c8323d43SYuri Pankovoption is specified. 758*c8323d43SYuri Pankov.Bl -tag -width Ds 759*c8323d43SYuri Pankov.It Fl d 760*c8323d43SYuri PankovDo not enable any features on the new pool. Individual features can be enabled 761*c8323d43SYuri Pankovby setting their corresponding properties to 762*c8323d43SYuri Pankov.Sy enabled 763*c8323d43SYuri Pankovwith the 764*c8323d43SYuri Pankov.Fl o 765*c8323d43SYuri Pankovoption. See 766*c8323d43SYuri Pankov.Xr zpool-features 5 767*c8323d43SYuri Pankovfor details about feature properties. 768*c8323d43SYuri Pankov.It Fl f 769*c8323d43SYuri PankovForces use of 770*c8323d43SYuri Pankov.Ar vdev Ns s , 771*c8323d43SYuri Pankoveven if they appear in use or specify a conflicting replication level. Not all 772*c8323d43SYuri Pankovdevices can be overridden in this manner. 773*c8323d43SYuri Pankov.It Fl m Ar mountpoint 774*c8323d43SYuri PankovSets the mount point for the root dataset. The default mount point is 775*c8323d43SYuri Pankov.Pa /pool 776*c8323d43SYuri Pankovor 777*c8323d43SYuri Pankov.Pa altroot/pool 778*c8323d43SYuri Pankovif 779*c8323d43SYuri Pankov.Ar altroot 780*c8323d43SYuri Pankovis specified. The mount point must be an absolute path, 781*c8323d43SYuri Pankov.Sy legacy , 782*c8323d43SYuri Pankovor 783*c8323d43SYuri Pankov.Sy none . 784*c8323d43SYuri PankovFor more information on dataset mount points, see 785*c8323d43SYuri Pankov.Xr zfs 1M . 786*c8323d43SYuri Pankov.It Fl n 787c10c16deSRichard LoweDisplays the configuration that would be used without actually creating the 788c10c16deSRichard Lowepool. The actual pool creation can still fail due to insufficient privileges or 789c10c16deSRichard Lowedevice sharing. 790*c8323d43SYuri Pankov.It Fl o Ar property Ns = Ns Ar value 791*c8323d43SYuri PankovSets the given pool properties. See the 792*c8323d43SYuri Pankov.Sx Properties 793*c8323d43SYuri Pankovsection for a list of valid properties that can be set. 794*c8323d43SYuri Pankov.It Fl O Ar file-system-property Ns = Ns Ar value 795c10c16deSRichard LoweSets the given file system properties in the root file system of the pool. See 796*c8323d43SYuri Pankovthe 797*c8323d43SYuri Pankov.Sx Properties 798*c8323d43SYuri Pankovsection of 799*c8323d43SYuri Pankov.Xr zfs 1M 800*c8323d43SYuri Pankovfor a list of valid properties that can be set. 801*c8323d43SYuri Pankov.It Fl R Ar root 802*c8323d43SYuri PankovEquivalent to 803*c8323d43SYuri Pankov.Fl o Sy cachefile Ns = Ns Sy none Fl o Sy altroot Ns = Ns Ar root 804*c8323d43SYuri Pankov.El 805*c8323d43SYuri Pankov.It Xo 806*c8323d43SYuri Pankov.Nm 807*c8323d43SYuri Pankov.Cm destroy 808*c8323d43SYuri Pankov.Op Fl f 809*c8323d43SYuri Pankov.Ar pool 810*c8323d43SYuri Pankov.Xc 811c10c16deSRichard LoweDestroys the given pool, freeing up any devices for other use. This command 812c10c16deSRichard Lowetries to unmount any active datasets before destroying the pool. 813*c8323d43SYuri Pankov.Bl -tag -width Ds 814*c8323d43SYuri Pankov.It Fl f 815c10c16deSRichard LoweForces any active datasets contained within the pool to be unmounted. 816*c8323d43SYuri Pankov.El 817*c8323d43SYuri Pankov.It Xo 818*c8323d43SYuri Pankov.Nm 819*c8323d43SYuri Pankov.Cm detach 820*c8323d43SYuri Pankov.Ar pool device 821*c8323d43SYuri Pankov.Xc 822*c8323d43SYuri PankovDetaches 823*c8323d43SYuri Pankov.Ar device 824*c8323d43SYuri Pankovfrom a mirror. The operation is refused if there are no other valid replicas of 825*c8323d43SYuri Pankovthe data. 826*c8323d43SYuri Pankov.It Xo 827*c8323d43SYuri Pankov.Nm 828*c8323d43SYuri Pankov.Cm export 829*c8323d43SYuri Pankov.Op Fl f 830*c8323d43SYuri Pankov.Ar pool Ns ... 831*c8323d43SYuri Pankov.Xc 832c10c16deSRichard LoweExports the given pools from the system. All devices are marked as exported, 833c10c16deSRichard Lowebut are still considered in use by other subsystems. The devices can be moved 834*c8323d43SYuri Pankovbetween systems 835*c8323d43SYuri Pankov.Pq even those of different endianness 836*c8323d43SYuri Pankovand imported as long as a sufficient number of devices are present. 837*c8323d43SYuri Pankov.Pp 838c10c16deSRichard LoweBefore exporting the pool, all datasets within the pool are unmounted. A pool 839c10c16deSRichard Lowecan not be exported if it has a shared spare that is currently being used. 840*c8323d43SYuri Pankov.Pp 841*c8323d43SYuri PankovFor pools to be portable, you must give the 842*c8323d43SYuri Pankov.Nm 843*c8323d43SYuri Pankovcommand whole disks, not just slices, so that ZFS can label the disks with 844*c8323d43SYuri Pankovportable EFI labels. Otherwise, disk drivers on platforms of different 845*c8323d43SYuri Pankovendianness will not recognize the disks. 846*c8323d43SYuri Pankov.Bl -tag -width Ds 847*c8323d43SYuri Pankov.It Fl f 848*c8323d43SYuri PankovForcefully unmount all datasets, using the 849*c8323d43SYuri Pankov.Nm unmount Fl f 850*c8323d43SYuri Pankovcommand. 851*c8323d43SYuri Pankov.Pp 852c10c16deSRichard LoweThis command will forcefully export the pool even if it has a shared spare that 853c10c16deSRichard Loweis currently being used. This may lead to potential data corruption. 854*c8323d43SYuri Pankov.El 855*c8323d43SYuri Pankov.It Xo 856*c8323d43SYuri Pankov.Nm 857*c8323d43SYuri Pankov.Cm get 858*c8323d43SYuri Pankov.Op Fl Hp 859*c8323d43SYuri Pankov.Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... 860*c8323d43SYuri Pankov.Sy all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns ... 861*c8323d43SYuri Pankov.Ar pool Ns ... 862*c8323d43SYuri Pankov.Xc 863*c8323d43SYuri PankovRetrieves the given list of properties 864*c8323d43SYuri Pankov.Po 865*c8323d43SYuri Pankovor all properties if 866*c8323d43SYuri Pankov.Sy all 867*c8323d43SYuri Pankovis used 868*c8323d43SYuri Pankov.Pc 869*c8323d43SYuri Pankovfor the specified storage pool(s). These properties are displayed with 870c10c16deSRichard Lowethe following fields: 871*c8323d43SYuri Pankov.Bd -literal 872c10c16deSRichard Lowe name Name of storage pool 873c10c16deSRichard Lowe property Property name 874c10c16deSRichard Lowe value Property value 875c10c16deSRichard Lowe source Property source, either 'default' or 'local'. 876*c8323d43SYuri Pankov.Ed 877*c8323d43SYuri Pankov.Pp 878*c8323d43SYuri PankovSee the 879*c8323d43SYuri Pankov.Sx Properties 880*c8323d43SYuri Pankovsection for more information on the available pool properties. 881*c8323d43SYuri Pankov.Bl -tag -width Ds 882*c8323d43SYuri Pankov.It Fl H 883c58b3526SAdam StevkoScripted mode. Do not display headers, and separate fields by a single tab 884c58b3526SAdam Stevkoinstead of arbitrary space. 885*c8323d43SYuri Pankov.It Fl o Ar field 886*c8323d43SYuri PankovA comma-separated list of columns to display. 887*c8323d43SYuri Pankov.Sy name Ns , Ns Sy property Ns , Ns Sy value Ns , Ns Sy source 888c58b3526SAdam Stevkois the default value. 889*c8323d43SYuri Pankov.It Fl p 890*c8323d43SYuri PankovDisplay numbers in parsable (exact) values. 891*c8323d43SYuri Pankov.El 892*c8323d43SYuri Pankov.It Xo 893*c8323d43SYuri Pankov.Nm 894*c8323d43SYuri Pankov.Cm history 895*c8323d43SYuri Pankov.Op Fl il 896*c8323d43SYuri Pankov.Oo Ar pool Oc Ns ... 897*c8323d43SYuri Pankov.Xc 898*c8323d43SYuri PankovDisplays the command history of the specified pool(s) or all pools if no pool is 899c10c16deSRichard Lowespecified. 900*c8323d43SYuri Pankov.Bl -tag -width Ds 901*c8323d43SYuri Pankov.It Fl i 902*c8323d43SYuri PankovDisplays internally logged ZFS events in addition to user initiated events. 903*c8323d43SYuri Pankov.It Fl l 904c10c16deSRichard LoweDisplays log records in long format, which in addition to standard format 905c10c16deSRichard Loweincludes, the user name, the hostname, and the zone in which the operation was 906c10c16deSRichard Loweperformed. 907*c8323d43SYuri Pankov.El 908*c8323d43SYuri Pankov.It Xo 909*c8323d43SYuri Pankov.Nm 910*c8323d43SYuri Pankov.Cm import 911*c8323d43SYuri Pankov.Op Fl D 912*c8323d43SYuri Pankov.Op Fl d Ar dir 913*c8323d43SYuri Pankov.Xc 914*c8323d43SYuri PankovLists pools available to import. If the 915*c8323d43SYuri Pankov.Fl d 916*c8323d43SYuri Pankovoption is not specified, this command searches for devices in 917*c8323d43SYuri Pankov.Pa /dev/dsk . 918*c8323d43SYuri PankovThe 919*c8323d43SYuri Pankov.Fl d 920*c8323d43SYuri Pankovoption can be specified multiple times, and all directories are searched. If the 921*c8323d43SYuri Pankovdevice appears to be part of an exported pool, this command displays a summary 922*c8323d43SYuri Pankovof the pool with the name of the pool, a numeric identifier, as well as the vdev 923c10c16deSRichard Lowelayout and current health of the device for each device or file. Destroyed 924*c8323d43SYuri Pankovpools, pools that were previously destroyed with the 925*c8323d43SYuri Pankov.Nm zpool Cm destroy 926*c8323d43SYuri Pankovcommand, are not listed unless the 927*c8323d43SYuri Pankov.Fl D 928*c8323d43SYuri Pankovoption is specified. 929*c8323d43SYuri Pankov.Pp 930c10c16deSRichard LoweThe numeric identifier is unique, and can be used instead of the pool name when 931c10c16deSRichard Lowemultiple exported pools of the same name are available. 932*c8323d43SYuri Pankov.Bl -tag -width Ds 933*c8323d43SYuri Pankov.It Fl c Ar cachefile 934*c8323d43SYuri PankovReads configuration from the given 935*c8323d43SYuri Pankov.Ar cachefile 936*c8323d43SYuri Pankovthat was created with the 937*c8323d43SYuri Pankov.Sy cachefile 938*c8323d43SYuri Pankovpool property. This 939*c8323d43SYuri Pankov.Ar cachefile 940*c8323d43SYuri Pankovis used instead of searching for devices. 941*c8323d43SYuri Pankov.It Fl d Ar dir 942*c8323d43SYuri PankovSearches for devices or files in 943*c8323d43SYuri Pankov.Ar dir . 944*c8323d43SYuri PankovThe 945*c8323d43SYuri Pankov.Fl d 946*c8323d43SYuri Pankovoption can be specified multiple times. 947*c8323d43SYuri Pankov.It Fl D 948c10c16deSRichard LoweLists destroyed pools only. 949*c8323d43SYuri Pankov.El 950*c8323d43SYuri Pankov.It Xo 951*c8323d43SYuri Pankov.Nm 952*c8323d43SYuri Pankov.Cm import 953*c8323d43SYuri Pankov.Fl a 954*c8323d43SYuri Pankov.Op Fl DfmN 955*c8323d43SYuri Pankov.Op Fl F Op Fl n 956*c8323d43SYuri Pankov.Op Fl c Ar cachefile Ns | Ns Fl d Ar dir 957*c8323d43SYuri Pankov.Op Fl o Ar mntopts 958*c8323d43SYuri Pankov.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... 959*c8323d43SYuri Pankov.Op Fl R Ar root 960*c8323d43SYuri Pankov.Xc 961c10c16deSRichard LoweImports all pools found in the search directories. Identical to the previous 962*c8323d43SYuri Pankovcommand, except that all pools with a sufficient number of devices available are 963*c8323d43SYuri Pankovimported. Destroyed pools, pools that were previously destroyed with the 964*c8323d43SYuri Pankov.Nm zpool Cm destroy 965*c8323d43SYuri Pankovcommand, will not be imported unless the 966*c8323d43SYuri Pankov.Fl D 967*c8323d43SYuri Pankovoption is specified. 968*c8323d43SYuri Pankov.Bl -tag -width Ds 969*c8323d43SYuri Pankov.It Fl a 970c10c16deSRichard LoweSearches for and imports all pools found. 971*c8323d43SYuri Pankov.It Fl c Ar cachefile 972*c8323d43SYuri PankovReads configuration from the given 973*c8323d43SYuri Pankov.Ar cachefile 974*c8323d43SYuri Pankovthat was created with the 975*c8323d43SYuri Pankov.Sy cachefile 976*c8323d43SYuri Pankovpool property. This 977*c8323d43SYuri Pankov.Ar cachefile 978*c8323d43SYuri Pankovis used instead of searching for devices. 979*c8323d43SYuri Pankov.It Fl d Ar dir 980*c8323d43SYuri PankovSearches for devices or files in 981*c8323d43SYuri Pankov.Ar dir . 982*c8323d43SYuri PankovThe 983*c8323d43SYuri Pankov.Fl d 984*c8323d43SYuri Pankovoption can be specified multiple times. This option is incompatible with the 985*c8323d43SYuri Pankov.Fl c 986*c8323d43SYuri Pankovoption. 987*c8323d43SYuri Pankov.It Fl D 988*c8323d43SYuri PankovImports destroyed pools only. The 989*c8323d43SYuri Pankov.Fl f 990*c8323d43SYuri Pankovoption is also required. 991*c8323d43SYuri Pankov.It Fl f 992*c8323d43SYuri PankovForces import, even if the pool appears to be potentially active. 993*c8323d43SYuri Pankov.It Fl F 994*c8323d43SYuri PankovRecovery mode for a non-importable pool. Attempt to return the pool to an 995*c8323d43SYuri Pankovimportable state by discarding the last few transactions. Not all damaged pools 996*c8323d43SYuri Pankovcan be recovered by using this option. If successful, the data from the 997*c8323d43SYuri Pankovdiscarded transactions is irretrievably lost. This option is ignored if the pool 998*c8323d43SYuri Pankovis importable or already imported. 999*c8323d43SYuri Pankov.It Fl m 1000409f1c06SAdam StevkoAllows a pool to import when there is a missing log device. Recent transactions 1001409f1c06SAdam Stevkocan be lost because the log device will be discarded. 1002*c8323d43SYuri Pankov.It Fl n 1003*c8323d43SYuri PankovUsed with the 1004*c8323d43SYuri Pankov.Fl F 1005*c8323d43SYuri Pankovrecovery option. Determines whether a non-importable pool can be made importable 1006*c8323d43SYuri Pankovagain, but does not actually perform the pool recovery. For more details about 1007*c8323d43SYuri Pankovpool recovery mode, see the 1008*c8323d43SYuri Pankov.Fl F 1009*c8323d43SYuri Pankovoption, above. 1010*c8323d43SYuri Pankov.It Fl N 1011409f1c06SAdam StevkoImport the pool without mounting any file systems. 1012*c8323d43SYuri Pankov.It Fl o Ar mntopts 1013*c8323d43SYuri PankovComma-separated list of mount options to use when mounting datasets within the 1014*c8323d43SYuri Pankovpool. See 1015*c8323d43SYuri Pankov.Xr zfs 1M 1016*c8323d43SYuri Pankovfor a description of dataset properties and mount options. 1017*c8323d43SYuri Pankov.It Fl o Ar property Ns = Ns Ar value 1018*c8323d43SYuri PankovSets the specified property on the imported pool. See the 1019*c8323d43SYuri Pankov.Sx Properties 1020*c8323d43SYuri Pankovsection for more information on the available pool properties. 1021*c8323d43SYuri Pankov.It Fl R Ar root 1022*c8323d43SYuri PankovSets the 1023*c8323d43SYuri Pankov.Sy cachefile 1024*c8323d43SYuri Pankovproperty to 1025*c8323d43SYuri Pankov.Sy none 1026*c8323d43SYuri Pankovand the 1027*c8323d43SYuri Pankov.Sy altroot 1028*c8323d43SYuri Pankovproperty to 1029*c8323d43SYuri Pankov.Ar root . 1030*c8323d43SYuri Pankov.El 1031*c8323d43SYuri Pankov.It Xo 1032*c8323d43SYuri Pankov.Nm 1033*c8323d43SYuri Pankov.Cm import 1034*c8323d43SYuri Pankov.Op Fl Dfm 1035*c8323d43SYuri Pankov.Op Fl F Op Fl n 1036*c8323d43SYuri Pankov.Op Fl c Ar cachefile Ns | Ns Fl d Ar dir 1037*c8323d43SYuri Pankov.Op Fl o Ar mntopts 1038*c8323d43SYuri Pankov.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... 1039*c8323d43SYuri Pankov.Op Fl R Ar root 1040*c8323d43SYuri Pankov.Ar pool Ns | Ns Ar id 1041*c8323d43SYuri Pankov.Op Ar newpool 1042*c8323d43SYuri Pankov.Xc 1043c10c16deSRichard LoweImports a specific pool. A pool can be identified by its name or the numeric 1044*c8323d43SYuri Pankovidentifier. If 1045*c8323d43SYuri Pankov.Ar newpool 1046*c8323d43SYuri Pankovis specified, the pool is imported using the name 1047*c8323d43SYuri Pankov.Ar newpool . 1048*c8323d43SYuri PankovOtherwise, it is imported with the same name as its exported name. 1049*c8323d43SYuri Pankov.Pp 1050*c8323d43SYuri PankovIf a device is removed from a system without running 1051*c8323d43SYuri Pankov.Nm zpool Cm export 1052c10c16deSRichard Lowefirst, the device appears as potentially active. It cannot be determined if 1053c10c16deSRichard Lowethis was a failed export, or whether the device is really in use from another 1054*c8323d43SYuri Pankovhost. To import a pool in this state, the 1055*c8323d43SYuri Pankov.Fl f 1056*c8323d43SYuri Pankovoption is required. 1057*c8323d43SYuri Pankov.Bl -tag -width Ds 1058*c8323d43SYuri Pankov.It Fl c Ar cachefile 1059*c8323d43SYuri PankovReads configuration from the given 1060*c8323d43SYuri Pankov.Ar cachefile 1061*c8323d43SYuri Pankovthat was created with the 1062*c8323d43SYuri Pankov.Sy cachefile 1063*c8323d43SYuri Pankovpool property. This 1064*c8323d43SYuri Pankov.Ar cachefile 1065*c8323d43SYuri Pankovis used instead of searching for devices. 1066*c8323d43SYuri Pankov.It Fl d Ar dir 1067*c8323d43SYuri PankovSearches for devices or files in 1068*c8323d43SYuri Pankov.Ar dir . 1069*c8323d43SYuri PankovThe 1070*c8323d43SYuri Pankov.Fl d 1071*c8323d43SYuri Pankovoption can be specified multiple times. This option is incompatible with the 1072*c8323d43SYuri Pankov.Fl c 1073*c8323d43SYuri Pankovoption. 1074*c8323d43SYuri Pankov.It Fl D 1075*c8323d43SYuri PankovImports destroyed pool. The 1076*c8323d43SYuri Pankov.Fl f 1077*c8323d43SYuri Pankovoption is also required. 1078*c8323d43SYuri Pankov.It Fl f 1079c10c16deSRichard LoweForces import, even if the pool appears to be potentially active. 1080*c8323d43SYuri Pankov.It Fl F 1081*c8323d43SYuri PankovRecovery mode for a non-importable pool. Attempt to return the pool to an 1082*c8323d43SYuri Pankovimportable state by discarding the last few transactions. Not all damaged pools 1083*c8323d43SYuri Pankovcan be recovered by using this option. If successful, the data from the 1084*c8323d43SYuri Pankovdiscarded transactions is irretrievably lost. This option is ignored if the pool 1085*c8323d43SYuri Pankovis importable or already imported. 1086*c8323d43SYuri Pankov.It Fl m 1087409f1c06SAdam StevkoAllows a pool to import when there is a missing log device. Recent transactions 1088409f1c06SAdam Stevkocan be lost because the log device will be discarded. 1089*c8323d43SYuri Pankov.It Fl n 1090*c8323d43SYuri PankovUsed with the 1091*c8323d43SYuri Pankov.Fl F 1092*c8323d43SYuri Pankovrecovery option. Determines whether a non-importable pool can be made importable 1093*c8323d43SYuri Pankovagain, but does not actually perform the pool recovery. For more details about 1094*c8323d43SYuri Pankovpool recovery mode, see the 1095*c8323d43SYuri Pankov.Fl F 1096*c8323d43SYuri Pankovoption, above. 1097*c8323d43SYuri Pankov.It Fl o Ar mntopts 1098*c8323d43SYuri PankovComma-separated list of mount options to use when mounting datasets within the 1099*c8323d43SYuri Pankovpool. See 1100*c8323d43SYuri Pankov.Xr zfs 1M 1101*c8323d43SYuri Pankovfor a description of dataset properties and mount options. 1102*c8323d43SYuri Pankov.It Fl o Ar property Ns = Ns Ar value 1103*c8323d43SYuri PankovSets the specified property on the imported pool. See the 1104*c8323d43SYuri Pankov.Sx Properties 1105*c8323d43SYuri Pankovsection for more information on the available pool properties. 1106*c8323d43SYuri Pankov.It Fl R Ar root 1107*c8323d43SYuri PankovSets the 1108*c8323d43SYuri Pankov.Sy cachefile 1109*c8323d43SYuri Pankovproperty to 1110*c8323d43SYuri Pankov.Sy none 1111*c8323d43SYuri Pankovand the 1112*c8323d43SYuri Pankov.Sy altroot 1113*c8323d43SYuri Pankovproperty to 1114*c8323d43SYuri Pankov.Ar root . 1115*c8323d43SYuri Pankov.El 1116*c8323d43SYuri Pankov.It Xo 1117*c8323d43SYuri Pankov.Nm 1118*c8323d43SYuri Pankov.Cm iostat 1119*c8323d43SYuri Pankov.Op Fl v 1120*c8323d43SYuri Pankov.Op Fl T Sy u Ns | Ns Sy d 1121*c8323d43SYuri Pankov.Oo Ar pool Oc Ns ... 1122*c8323d43SYuri Pankov.Op Ar interval Op Ar count 1123*c8323d43SYuri Pankov.Xc 1124*c8323d43SYuri PankovDisplays I/O statistics for the given pools. When given an 1125*c8323d43SYuri Pankov.Ar interval , 1126*c8323d43SYuri Pankovthe statistics are printed every 1127*c8323d43SYuri Pankov.Ar interval 1128*c8323d43SYuri Pankovseconds until ^C is pressed. If no 1129*c8323d43SYuri Pankov.Ar pool Ns s 1130*c8323d43SYuri Pankovare specified, statistics for every pool in the system is shown. If 1131*c8323d43SYuri Pankov.Ar count 1132*c8323d43SYuri Pankovis specified, the command exits after 1133*c8323d43SYuri Pankov.Ar count 1134*c8323d43SYuri Pankovreports are printed. 1135*c8323d43SYuri Pankov.Bl -tag -width Ds 1136*c8323d43SYuri Pankov.It Fl T Sy u Ns | Ns Sy d 1137*c8323d43SYuri PankovDisplay a time stamp. Specify 1138*c8323d43SYuri Pankov.Sy u 1139*c8323d43SYuri Pankovfor a printed representation of the internal representation of time. See 1140*c8323d43SYuri Pankov.Xr time 2 . 1141*c8323d43SYuri PankovSpecify 1142*c8323d43SYuri Pankov.Sy d 1143*c8323d43SYuri Pankovfor standard date format. See 1144*c8323d43SYuri Pankov.Xr date 1 . 1145*c8323d43SYuri Pankov.It Fl v 1146*c8323d43SYuri PankovVerbose statistics. Reports usage statistics for individual vdevs within the 1147*c8323d43SYuri Pankovpool, in addition to the pool-wide statistics. 1148*c8323d43SYuri Pankov.El 1149*c8323d43SYuri Pankov.It Xo 1150*c8323d43SYuri Pankov.Nm 1151*c8323d43SYuri Pankov.Cm list 1152*c8323d43SYuri Pankov.Op Fl Hpv 1153*c8323d43SYuri Pankov.Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... 1154*c8323d43SYuri Pankov.Op Fl T Sy u Ns | Ns Sy d 1155*c8323d43SYuri Pankov.Oo Ar pool Oc Ns ... 1156*c8323d43SYuri Pankov.Op Ar interval Op Ar count 1157*c8323d43SYuri Pankov.Xc 1158*c8323d43SYuri PankovLists the given pools along with a health status and space usage. If no 1159*c8323d43SYuri Pankov.Ar pool Ns s 1160*c8323d43SYuri Pankovare specified, all pools in the system are listed. When given an 1161*c8323d43SYuri Pankov.Ar interval , 1162*c8323d43SYuri Pankovthe information is printed every 1163*c8323d43SYuri Pankov.Ar interval 1164*c8323d43SYuri Pankovseconds until ^C is pressed. If 1165*c8323d43SYuri Pankov.Ar count 1166*c8323d43SYuri Pankovis specified, the command exits after 1167*c8323d43SYuri Pankov.Ar count 1168*c8323d43SYuri Pankovreports are printed. 1169*c8323d43SYuri Pankov.Bl -tag -width Ds 1170*c8323d43SYuri Pankov.It Fl H 1171c10c16deSRichard LoweScripted mode. Do not display headers, and separate fields by a single tab 1172c10c16deSRichard Loweinstead of arbitrary space. 1173*c8323d43SYuri Pankov.It Fl o Ar property 1174*c8323d43SYuri PankovComma-separated list of properties to display. See the 1175*c8323d43SYuri Pankov.Sx Properties 1176*c8323d43SYuri Pankovsection for a list of valid properties. The default list is 1177*c8323d43SYuri Pankov.Sy name , size , used , available , fragmentation , expandsize , capacity , 1178*c8323d43SYuri Pankov.Sy dedupratio , health , altroot . 1179*c8323d43SYuri Pankov.It Fl p 1180*c8323d43SYuri PankovDisplay numbers in parsable 1181*c8323d43SYuri Pankov.Pq exact 1182*c8323d43SYuri Pankovvalues. 1183*c8323d43SYuri Pankov.It Fl T Sy u Ns | Ns Sy d 1184*c8323d43SYuri PankovDisplay a time stamp. Specify 1185*c8323d43SYuri Pankov.Fl u 1186*c8323d43SYuri Pankovfor a printed representation of the internal representation of time. See 1187*c8323d43SYuri Pankov.Xr time 2 . 1188*c8323d43SYuri PankovSpecify 1189*c8323d43SYuri Pankov.Fl d 1190*c8323d43SYuri Pankovfor standard date format. See 1191*c8323d43SYuri Pankov.Xr date 1 . 1192*c8323d43SYuri Pankov.It Fl v 1193*c8323d43SYuri PankovVerbose statistics. Reports usage statistics for individual vdevs within the 1194*c8323d43SYuri Pankovpool, in addition to the pool-wise statistics. 1195*c8323d43SYuri Pankov.El 1196*c8323d43SYuri Pankov.It Xo 1197*c8323d43SYuri Pankov.Nm 1198*c8323d43SYuri Pankov.Cm offline 1199*c8323d43SYuri Pankov.Op Fl t 1200*c8323d43SYuri Pankov.Ar pool Ar device Ns ... 1201*c8323d43SYuri Pankov.Xc 1202*c8323d43SYuri PankovTakes the specified physical device offline. While the 1203*c8323d43SYuri Pankov.Ar device 1204*c8323d43SYuri Pankovis offline, no attempt is made to read or write to the device. This command is 1205*c8323d43SYuri Pankovnot applicable to spares. 1206*c8323d43SYuri Pankov.Bl -tag -width Ds 1207*c8323d43SYuri Pankov.It Fl t 1208c10c16deSRichard LoweTemporary. Upon reboot, the specified physical device reverts to its previous 1209c10c16deSRichard Lowestate. 1210*c8323d43SYuri Pankov.El 1211*c8323d43SYuri Pankov.It Xo 1212*c8323d43SYuri Pankov.Nm 1213*c8323d43SYuri Pankov.Cm online 1214*c8323d43SYuri Pankov.Op Fl e 1215*c8323d43SYuri Pankov.Ar pool Ar device Ns ... 1216*c8323d43SYuri Pankov.Xc 1217*c8323d43SYuri PankovBrings the specified physical device online. This command is not applicable to 1218*c8323d43SYuri Pankovspares. 1219*c8323d43SYuri Pankov.Bl -tag -width Ds 1220*c8323d43SYuri Pankov.It Fl e 1221c10c16deSRichard LoweExpand the device to use all available space. If the device is part of a mirror 1222*c8323d43SYuri Pankovor raidz then all devices must be expanded before the new space will become 1223*c8323d43SYuri Pankovavailable to the pool. 1224*c8323d43SYuri Pankov.El 1225*c8323d43SYuri Pankov.It Xo 1226*c8323d43SYuri Pankov.Nm 1227*c8323d43SYuri Pankov.Cm reguid 1228*c8323d43SYuri Pankov.Ar pool 1229*c8323d43SYuri Pankov.Xc 1230*c8323d43SYuri PankovGenerates a new unique identifier for the pool. You must ensure that all devices 1231*c8323d43SYuri Pankovin this pool are online and healthy before performing this action. 1232*c8323d43SYuri Pankov.It Xo 1233*c8323d43SYuri Pankov.Nm 1234*c8323d43SYuri Pankov.Cm reopen 1235*c8323d43SYuri Pankov.Ar pool 1236*c8323d43SYuri Pankov.Xc 123731d7e8faSGeorge WilsonReopen all the vdevs associated with the pool. 1238*c8323d43SYuri Pankov.It Xo 1239*c8323d43SYuri Pankov.Nm 1240*c8323d43SYuri Pankov.Cm remove 1241*c8323d43SYuri Pankov.Ar pool Ar device Ns ... 1242*c8323d43SYuri Pankov.Xc 1243*c8323d43SYuri PankovRemoves the specified device from the pool. This command currently only supports 1244*c8323d43SYuri Pankovremoving hot spares, cache, and log devices. A mirrored log device can be 1245*c8323d43SYuri Pankovremoved by specifying the top-level mirror for the log. Non-log devices that are 1246*c8323d43SYuri Pankovpart of a mirrored configuration can be removed using the 1247*c8323d43SYuri Pankov.Nm zpool Cm detach 1248*c8323d43SYuri Pankovcommand. Non-redundant and raidz devices cannot be removed from a pool. 1249*c8323d43SYuri Pankov.It Xo 1250*c8323d43SYuri Pankov.Nm 1251*c8323d43SYuri Pankov.Cm replace 1252*c8323d43SYuri Pankov.Op Fl f 1253*c8323d43SYuri Pankov.Ar pool Ar device Op Ar new_device 1254*c8323d43SYuri Pankov.Xc 1255*c8323d43SYuri PankovReplaces 1256*c8323d43SYuri Pankov.Ar old_device 1257*c8323d43SYuri Pankovwith 1258*c8323d43SYuri Pankov.Ar new_device . 1259*c8323d43SYuri PankovThis is equivalent to attaching 1260*c8323d43SYuri Pankov.Ar new_device , 1261*c8323d43SYuri Pankovwaiting for it to resilver, and then detaching 1262*c8323d43SYuri Pankov.Ar old_device . 1263*c8323d43SYuri Pankov.Pp 1264*c8323d43SYuri PankovThe size of 1265*c8323d43SYuri Pankov.Ar new_device 1266*c8323d43SYuri Pankovmust be greater than or equal to the minimum size of all the devices in a mirror 1267*c8323d43SYuri Pankovor raidz configuration. 1268*c8323d43SYuri Pankov.Pp 1269*c8323d43SYuri Pankov.Ar new_device 1270*c8323d43SYuri Pankovis required if the pool is not redundant. If 1271*c8323d43SYuri Pankov.Ar new_device 1272*c8323d43SYuri Pankovis not specified, it defaults to 1273*c8323d43SYuri Pankov.Ar old_device . 1274*c8323d43SYuri PankovThis form of replacement is useful after an existing disk has failed and has 1275*c8323d43SYuri Pankovbeen physically replaced. In this case, the new disk may have the same 1276*c8323d43SYuri Pankov.Pa /dev/dsk 1277*c8323d43SYuri Pankovpath as the old device, even though it is actually a different disk. ZFS 1278*c8323d43SYuri Pankovrecognizes this. 1279*c8323d43SYuri Pankov.Bl -tag -width Ds 1280*c8323d43SYuri Pankov.It Fl f 1281*c8323d43SYuri PankovForces use of 1282*c8323d43SYuri Pankov.Ar new_device , 1283*c8323d43SYuri Pankoveven if its appears to be in use. Not all devices can be overridden in this 1284*c8323d43SYuri Pankovmanner. 1285*c8323d43SYuri Pankov.El 1286*c8323d43SYuri Pankov.It Xo 1287*c8323d43SYuri Pankov.Nm 1288*c8323d43SYuri Pankov.Cm scrub 1289*c8323d43SYuri Pankov.Op Fl s 1290*c8323d43SYuri Pankov.Ar pool Ns ... 1291*c8323d43SYuri Pankov.Xc 1292c10c16deSRichard LoweBegins a scrub. The scrub examines all data in the specified pools to verify 1293*c8323d43SYuri Pankovthat it checksums correctly. For replicated 1294*c8323d43SYuri Pankov.Pq mirror or raidz 1295*c8323d43SYuri Pankovdevices, ZFS automatically repairs any damage discovered during the scrub. The 1296*c8323d43SYuri Pankov.Nm zpool Cm status 1297*c8323d43SYuri Pankovcommand reports the progress of the scrub and summarizes the results of the 1298*c8323d43SYuri Pankovscrub upon completion. 1299*c8323d43SYuri Pankov.Pp 1300c10c16deSRichard LoweScrubbing and resilvering are very similar operations. The difference is that 1301*c8323d43SYuri Pankovresilvering only examines data that ZFS knows to be out of date 1302*c8323d43SYuri Pankov.Po 1303*c8323d43SYuri Pankovfor example, when attaching a new device to a mirror or replacing an existing 1304*c8323d43SYuri Pankovdevice 1305*c8323d43SYuri Pankov.Pc , 1306*c8323d43SYuri Pankovwhereas scrubbing examines all data to discover silent errors due to hardware 1307*c8323d43SYuri Pankovfaults or disk failure. 1308*c8323d43SYuri Pankov.Pp 1309*c8323d43SYuri PankovBecause scrubbing and resilvering are I/O-intensive operations, ZFS only allows 1310*c8323d43SYuri Pankovone at a time. If a scrub is already in progress, the 1311*c8323d43SYuri Pankov.Nm zpool Cm scrub 1312*c8323d43SYuri Pankovcommand terminates it and starts a new scrub. If a resilver is in progress, ZFS 1313*c8323d43SYuri Pankovdoes not allow a scrub to be started until the resilver completes. 1314*c8323d43SYuri Pankov.Bl -tag -width Ds 1315*c8323d43SYuri Pankov.It Fl s 1316c10c16deSRichard LoweStop scrubbing. 1317*c8323d43SYuri Pankov.El 1318*c8323d43SYuri Pankov.It Xo 1319*c8323d43SYuri Pankov.Nm 1320*c8323d43SYuri Pankov.Cm set 1321*c8323d43SYuri Pankov.Ar property Ns = Ns Ar value 1322*c8323d43SYuri Pankov.Ar pool 1323*c8323d43SYuri Pankov.Xc 1324*c8323d43SYuri PankovSets the given property on the specified pool. See the 1325*c8323d43SYuri Pankov.Sx Properties 1326*c8323d43SYuri Pankovsection for more information on what properties can be set and acceptable 1327*c8323d43SYuri Pankovvalues. 1328*c8323d43SYuri Pankov.It Xo 1329*c8323d43SYuri Pankov.Nm 1330*c8323d43SYuri Pankov.Cm status 1331*c8323d43SYuri Pankov.Op Fl Dvx 1332*c8323d43SYuri Pankov.Op Fl T Sy u Ns | Ns Sy d 1333*c8323d43SYuri Pankov.Oo Ar pool Oc Ns ... 1334*c8323d43SYuri Pankov.Op Ar interval Op Ar count 1335*c8323d43SYuri Pankov.Xc 1336*c8323d43SYuri PankovDisplays the detailed health status for the given pools. If no 1337*c8323d43SYuri Pankov.Ar pool 1338*c8323d43SYuri Pankovis specified, then the status of each pool in the system is displayed. For more 1339*c8323d43SYuri Pankovinformation on pool and device health, see the 1340*c8323d43SYuri Pankov.Sx Device Failure and Recovery 1341c10c16deSRichard Lowesection. 1342*c8323d43SYuri Pankov.Pp 1343c10c16deSRichard LoweIf a scrub or resilver is in progress, this command reports the percentage done 1344c10c16deSRichard Loweand the estimated time to completion. Both of these are only approximate, 1345*c8323d43SYuri Pankovbecause the amount of data in the pool and the other workloads on the system can 1346*c8323d43SYuri Pankovchange. 1347*c8323d43SYuri Pankov.Bl -tag -width Ds 1348*c8323d43SYuri Pankov.It Fl D 1349*c8323d43SYuri PankovDisplay a histogram of deduplication statistics, showing the allocated 1350*c8323d43SYuri Pankov.Pq physically present on disk 1351*c8323d43SYuri Pankovand referenced 1352*c8323d43SYuri Pankov.Pq logically referenced in the pool 1353*c8323d43SYuri Pankovblock counts and sizes by reference count. 1354*c8323d43SYuri Pankov.It Fl T Sy u Ns | Ns Sy d 1355*c8323d43SYuri PankovDisplay a time stamp. Specify 1356*c8323d43SYuri Pankov.Fl u 1357*c8323d43SYuri Pankovfor a printed representation of the internal representation of time. See 1358*c8323d43SYuri Pankov.Xr time 2 . 1359*c8323d43SYuri PankovSpecify 1360*c8323d43SYuri Pankov.Fl d 1361*c8323d43SYuri Pankovfor standard date format. See 1362*c8323d43SYuri Pankov.Xr date 1 . 1363*c8323d43SYuri Pankov.It Fl v 1364c10c16deSRichard LoweDisplays verbose data error information, printing out a complete list of all 1365c10c16deSRichard Lowedata errors since the last complete pool scrub. 1366*c8323d43SYuri Pankov.It Fl x 1367*c8323d43SYuri PankovOnly display status for pools that are exhibiting errors or are otherwise 1368*c8323d43SYuri Pankovunavailable. Warnings about pools not using the latest on-disk format will not 1369*c8323d43SYuri Pankovbe included. 1370*c8323d43SYuri Pankov.El 1371*c8323d43SYuri Pankov.It Xo 1372*c8323d43SYuri Pankov.Nm 1373*c8323d43SYuri Pankov.Cm upgrade 1374*c8323d43SYuri Pankov.Xc 137557221772SChristopher SidenDisplays pools which do not have all supported features enabled and pools 137657221772SChristopher Sidenformatted using a legacy ZFS version number. These pools can continue to be 1377*c8323d43SYuri Pankovused, but some features may not be available. Use 1378*c8323d43SYuri Pankov.Nm zpool Cm upgrade Fl a 137957221772SChristopher Sidento enable all features on all pools. 1380*c8323d43SYuri Pankov.It Xo 1381*c8323d43SYuri Pankov.Nm 1382*c8323d43SYuri Pankov.Cm upgrade 1383*c8323d43SYuri Pankov.Fl v 1384*c8323d43SYuri Pankov.Xc 1385*c8323d43SYuri PankovDisplays legacy ZFS versions supported by the current software. See 1386*c8323d43SYuri Pankov.Xr zpool-features 5 1387*c8323d43SYuri Pankovfor a description of feature flags features supported by the current software. 1388*c8323d43SYuri Pankov.It Xo 1389*c8323d43SYuri Pankov.Nm 1390*c8323d43SYuri Pankov.Cm upgrade 1391*c8323d43SYuri Pankov.Op Fl V Ar version 1392*c8323d43SYuri Pankov.Fl a Ns | Ns Ar pool Ns ... 1393*c8323d43SYuri Pankov.Xc 1394*c8323d43SYuri PankovEnables all supported features on the given pool. Once this is done, the pool 1395*c8323d43SYuri Pankovwill no longer be accessible on systems that do not support feature flags. See 1396*c8323d43SYuri Pankov.Xr zpool-features 5 1397*c8323d43SYuri Pankovfor details on compatibility with systems that support feature flags, but do not 1398*c8323d43SYuri Pankovsupport all features enabled on the pool. 1399*c8323d43SYuri Pankov.Bl -tag -width Ds 1400*c8323d43SYuri Pankov.It Fl a 140157221772SChristopher SidenEnables all supported features on all pools. 1402*c8323d43SYuri Pankov.It Fl V Ar version 1403*c8323d43SYuri PankovUpgrade to the specified legacy version. If the 1404*c8323d43SYuri Pankov.Fl V 1405*c8323d43SYuri Pankovflag is specified, no features will be enabled on the pool. This option can only 1406*c8323d43SYuri Pankovbe used to increase the version number up to the last supported legacy version 1407*c8323d43SYuri Pankovnumber. 1408*c8323d43SYuri Pankov.El 1409*c8323d43SYuri Pankov.El 1410*c8323d43SYuri Pankov.Sh EXIT STATUS 1411*c8323d43SYuri PankovThe following exit values are returned: 1412*c8323d43SYuri Pankov.Bl -tag -width Ds 1413*c8323d43SYuri Pankov.It Sy 0 1414*c8323d43SYuri PankovSuccessful completion. 1415*c8323d43SYuri Pankov.It Sy 1 1416*c8323d43SYuri PankovAn error occurred. 1417*c8323d43SYuri Pankov.It Sy 2 1418*c8323d43SYuri PankovInvalid command line options were specified. 1419*c8323d43SYuri Pankov.El 1420*c8323d43SYuri Pankov.Sh EXAMPLES 1421*c8323d43SYuri Pankov.Bl -tag -width Ds 1422*c8323d43SYuri Pankov.It Sy Example 1 No Creating a RAID-Z Storage Pool 1423*c8323d43SYuri PankovThe following command creates a pool with a single raidz root vdev that 1424*c8323d43SYuri Pankovconsists of six disks. 1425*c8323d43SYuri Pankov.Bd -literal 1426*c8323d43SYuri Pankov# zpool create tank raidz c0t0d0 c0t1d0 c0t2d0 c0t3d0 c0t4d0 c0t5d0 1427*c8323d43SYuri Pankov.Ed 1428*c8323d43SYuri Pankov.It Sy Example 2 No Creating a Mirrored Storage Pool 1429c10c16deSRichard LoweThe following command creates a pool with two mirrors, where each mirror 1430c10c16deSRichard Lowecontains two disks. 1431*c8323d43SYuri Pankov.Bd -literal 1432*c8323d43SYuri Pankov# zpool create tank mirror c0t0d0 c0t1d0 mirror c0t2d0 c0t3d0 1433*c8323d43SYuri Pankov.Ed 1434*c8323d43SYuri Pankov.It Sy Example 3 No Creating a ZFS Storage Pool by Using Slices 1435c10c16deSRichard LoweThe following command creates an unmirrored pool using two disk slices. 1436*c8323d43SYuri Pankov.Bd -literal 1437*c8323d43SYuri Pankov# zpool create tank /dev/dsk/c0t0d0s1 c0t1d0s4 1438*c8323d43SYuri Pankov.Ed 1439*c8323d43SYuri Pankov.It Sy Example 4 No Creating a ZFS Storage Pool by Using Files 1440c10c16deSRichard LoweThe following command creates an unmirrored pool using files. While not 1441c10c16deSRichard Lowerecommended, a pool based on files can be useful for experimental purposes. 1442*c8323d43SYuri Pankov.Bd -literal 1443*c8323d43SYuri Pankov# zpool create tank /path/to/file/a /path/to/file/b 1444*c8323d43SYuri Pankov.Ed 1445*c8323d43SYuri Pankov.It Sy Example 5 No Adding a Mirror to a ZFS Storage Pool 1446*c8323d43SYuri PankovThe following command adds two mirrored disks to the pool 1447*c8323d43SYuri Pankov.Em tank , 1448c10c16deSRichard Loweassuming the pool is already made up of two-way mirrors. The additional space 1449c10c16deSRichard Loweis immediately available to any datasets within the pool. 1450*c8323d43SYuri Pankov.Bd -literal 1451*c8323d43SYuri Pankov# zpool add tank mirror c1t0d0 c1t1d0 1452*c8323d43SYuri Pankov.Ed 1453*c8323d43SYuri Pankov.It Sy Example 6 No Listing Available ZFS Storage Pools 1454c10c16deSRichard LoweThe following command lists all available pools on the system. In this case, 1455*c8323d43SYuri Pankovthe pool 1456*c8323d43SYuri Pankov.Em zion 1457*c8323d43SYuri Pankovis faulted due to a missing device. The results from this command are similar 1458*c8323d43SYuri Pankovto the following: 1459*c8323d43SYuri Pankov.Bd -literal 1460*c8323d43SYuri Pankov# zpool list 14612e4c9986SGeorge WilsonNAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT 14622e4c9986SGeorge Wilsonrpool 19.9G 8.43G 11.4G 33% - 42% 1.00x ONLINE - 14632e4c9986SGeorge Wilsontank 61.5G 20.0G 41.5G 48% - 32% 1.00x ONLINE - 14642e4c9986SGeorge Wilsonzion - - - - - - - FAULTED - 1465*c8323d43SYuri Pankov.Ed 1466*c8323d43SYuri Pankov.It Sy Example 7 No Destroying a ZFS Storage Pool 1467*c8323d43SYuri PankovThe following command destroys the pool 1468*c8323d43SYuri Pankov.Em tank 1469*c8323d43SYuri Pankovand any datasets contained within. 1470*c8323d43SYuri Pankov.Bd -literal 1471*c8323d43SYuri Pankov# zpool destroy -f tank 1472*c8323d43SYuri Pankov.Ed 1473*c8323d43SYuri Pankov.It Sy Example 8 No Exporting a ZFS Storage Pool 1474*c8323d43SYuri PankovThe following command exports the devices in pool 1475*c8323d43SYuri Pankov.Em tank 1476*c8323d43SYuri Pankovso that they can be relocated or later imported. 1477*c8323d43SYuri Pankov.Bd -literal 1478*c8323d43SYuri Pankov# zpool export tank 1479*c8323d43SYuri Pankov.Ed 1480*c8323d43SYuri Pankov.It Sy Example 9 No Importing a ZFS Storage Pool 1481c10c16deSRichard LoweThe following command displays available pools, and then imports the pool 1482*c8323d43SYuri Pankov.Em tank 1483*c8323d43SYuri Pankovfor use on the system. The results from this command are similar to the 1484*c8323d43SYuri Pankovfollowing: 1485*c8323d43SYuri Pankov.Bd -literal 1486*c8323d43SYuri Pankov# zpool import 1487c10c16deSRichard Lowe pool: tank 1488c10c16deSRichard Lowe id: 15451357997522795478 1489c10c16deSRichard Lowe state: ONLINE 1490c10c16deSRichard Loweaction: The pool can be imported using its name or numeric identifier. 1491c10c16deSRichard Loweconfig: 1492c10c16deSRichard Lowe 1493c10c16deSRichard Lowe tank ONLINE 1494c10c16deSRichard Lowe mirror ONLINE 1495c10c16deSRichard Lowe c1t2d0 ONLINE 1496c10c16deSRichard Lowe c1t3d0 ONLINE 1497c10c16deSRichard Lowe 1498*c8323d43SYuri Pankov# zpool import tank 1499*c8323d43SYuri Pankov.Ed 1500*c8323d43SYuri Pankov.It Sy Example 10 No Upgrading All ZFS Storage Pools to the Current Version 1501c10c16deSRichard LoweThe following command upgrades all ZFS Storage pools to the current version of 1502c10c16deSRichard Lowethe software. 1503*c8323d43SYuri Pankov.Bd -literal 1504*c8323d43SYuri Pankov# zpool upgrade -a 1505c10c16deSRichard LoweThis system is currently running ZFS version 2. 1506*c8323d43SYuri Pankov.Ed 1507*c8323d43SYuri Pankov.It Sy Example 11 No Managing Hot Spares 1508c10c16deSRichard LoweThe following command creates a new pool with an available hot spare: 1509*c8323d43SYuri Pankov.Bd -literal 1510*c8323d43SYuri Pankov# zpool create tank mirror c0t0d0 c0t1d0 spare c0t2d0 1511*c8323d43SYuri Pankov.Ed 1512*c8323d43SYuri Pankov.Pp 1513c10c16deSRichard LoweIf one of the disks were to fail, the pool would be reduced to the degraded 1514c10c16deSRichard Lowestate. The failed device can be replaced using the following command: 1515*c8323d43SYuri Pankov.Bd -literal 1516*c8323d43SYuri Pankov# zpool replace tank c0t0d0 c0t3d0 1517*c8323d43SYuri Pankov.Ed 1518*c8323d43SYuri Pankov.Pp 1519c10c16deSRichard LoweOnce the data has been resilvered, the spare is automatically removed and is 1520c10c16deSRichard Lowemade available should another device fails. The hot spare can be permanently 1521c10c16deSRichard Loweremoved from the pool using the following command: 1522*c8323d43SYuri Pankov.Bd -literal 1523*c8323d43SYuri Pankov# zpool remove tank c0t2d0 1524*c8323d43SYuri Pankov.Ed 1525*c8323d43SYuri Pankov.It Sy Example 12 No Creating a ZFS Pool with Mirrored Separate Intent Logs 1526c10c16deSRichard LoweThe following command creates a ZFS storage pool consisting of two, two-way 1527c10c16deSRichard Lowemirrors and mirrored log devices: 1528*c8323d43SYuri Pankov.Bd -literal 1529*c8323d43SYuri Pankov# zpool create pool mirror c0d0 c1d0 mirror c2d0 c3d0 log mirror \e 1530*c8323d43SYuri Pankov c4d0 c5d0 1531*c8323d43SYuri Pankov.Ed 1532*c8323d43SYuri Pankov.It Sy Example 13 No Adding Cache Devices to a ZFS Pool 1533c10c16deSRichard LoweThe following command adds two disks for use as cache devices to a ZFS storage 1534c10c16deSRichard Lowepool: 1535*c8323d43SYuri Pankov.Bd -literal 1536*c8323d43SYuri Pankov# zpool add pool cache c2d0 c3d0 1537*c8323d43SYuri Pankov.Ed 1538*c8323d43SYuri Pankov.Pp 1539c10c16deSRichard LoweOnce added, the cache devices gradually fill with content from main memory. 1540c10c16deSRichard LoweDepending on the size of your cache devices, it could take over an hour for 1541*c8323d43SYuri Pankovthem to fill. Capacity and reads can be monitored using the 1542*c8323d43SYuri Pankov.Cm iostat 1543*c8323d43SYuri Pankovoption as follows: 1544*c8323d43SYuri Pankov.Bd -literal 1545*c8323d43SYuri Pankov# zpool iostat -v pool 5 1546*c8323d43SYuri Pankov.Ed 1547*c8323d43SYuri Pankov.It Sy Example 14 No Removing a Mirrored Log Device 1548*c8323d43SYuri PankovThe following command removes the mirrored log device 1549*c8323d43SYuri Pankov.Sy mirror-2 . 1550c10c16deSRichard LoweGiven this configuration: 1551*c8323d43SYuri Pankov.Bd -literal 1552c10c16deSRichard Lowe pool: tank 1553c10c16deSRichard Lowe state: ONLINE 1554c10c16deSRichard Lowe scrub: none requested 1555c10c16deSRichard Loweconfig: 1556c10c16deSRichard Lowe 1557c10c16deSRichard Lowe NAME STATE READ WRITE CKSUM 1558c10c16deSRichard Lowe tank ONLINE 0 0 0 1559c10c16deSRichard Lowe mirror-0 ONLINE 0 0 0 1560c10c16deSRichard Lowe c6t0d0 ONLINE 0 0 0 1561c10c16deSRichard Lowe c6t1d0 ONLINE 0 0 0 1562c10c16deSRichard Lowe mirror-1 ONLINE 0 0 0 1563c10c16deSRichard Lowe c6t2d0 ONLINE 0 0 0 1564c10c16deSRichard Lowe c6t3d0 ONLINE 0 0 0 1565c10c16deSRichard Lowe logs 1566c10c16deSRichard Lowe mirror-2 ONLINE 0 0 0 1567c10c16deSRichard Lowe c4t0d0 ONLINE 0 0 0 1568c10c16deSRichard Lowe c4t1d0 ONLINE 0 0 0 1569*c8323d43SYuri Pankov.Ed 1570*c8323d43SYuri Pankov.Pp 1571*c8323d43SYuri PankovThe command to remove the mirrored log 1572*c8323d43SYuri Pankov.Sy mirror-2 1573*c8323d43SYuri Pankovis: 1574*c8323d43SYuri Pankov.Bd -literal 1575*c8323d43SYuri Pankov# zpool remove tank mirror-2 1576*c8323d43SYuri Pankov.Ed 1577*c8323d43SYuri Pankov.It Sy Example 15 No Displaying expanded space on a device 1578*c8323d43SYuri PankovThe following command dipslays the detailed information for the pool 1579*c8323d43SYuri Pankov.Em data . 1580*c8323d43SYuri PankovThis pool is comprised of a single raidz vdev where one of its devices 1581*c8323d43SYuri Pankovincreased its capacity by 10GB. In this example, the pool will not be able to 1582*c8323d43SYuri Pankovutilize this extra capacity until all the devices under the raidz vdev have 1583*c8323d43SYuri Pankovbeen expanded. 1584*c8323d43SYuri Pankov.Bd -literal 1585*c8323d43SYuri Pankov# zpool list -v data 15862e4c9986SGeorge WilsonNAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT 15872e4c9986SGeorge Wilsondata 23.9G 14.6G 9.30G 48% - 61% 1.00x ONLINE - 15882e4c9986SGeorge Wilson raidz1 23.9G 14.6G 9.30G 48% - 15892e4c9986SGeorge Wilson c1t1d0 - - - - - 15902e4c9986SGeorge Wilson c1t2d0 - - - - 10G 15912e4c9986SGeorge Wilson c1t3d0 - - - - - 1592*c8323d43SYuri Pankov.Ed 1593*c8323d43SYuri Pankov.El 1594*c8323d43SYuri Pankov.Sh INTERFACE STABILITY 1595*c8323d43SYuri Pankov.Sy Evolving 1596*c8323d43SYuri Pankov.Sh SEE ALSO 1597*c8323d43SYuri Pankov.Xr zfs 1M , 1598*c8323d43SYuri Pankov.Xr attributes 5 , 1599*c8323d43SYuri Pankov.Xr zpool-features 5 1600