ZPOOL(1M) Maintenance Commands ZPOOL(1M) NNAAMMEE zzppooooll - configure ZFS storage pools SSYYNNOOPPSSIISS zzppooooll --?? zzppooooll aadddd [--ffnn] _p_o_o_l _v_d_e_v... zzppooooll aattttaacchh [--ff] _p_o_o_l _d_e_v_i_c_e _n_e_w___d_e_v_i_c_e zzppooooll cclleeaarr _p_o_o_l [_d_e_v_i_c_e] zzppooooll ccrreeaattee [--ddffnn] [--mm _m_o_u_n_t_p_o_i_n_t] [--oo _p_r_o_p_e_r_t_y=_v_a_l_u_e]... [--OO _f_i_l_e_-_s_y_s_t_e_m_-_p_r_o_p_e_r_t_y=_v_a_l_u_e]... [--RR _r_o_o_t] _p_o_o_l _v_d_e_v... zzppooooll ddeessttrrooyy [--ff] _p_o_o_l zzppooooll ddeettaacchh _p_o_o_l _d_e_v_i_c_e zzppooooll eexxppoorrtt [--ff] _p_o_o_l... zzppooooll ggeett [--HHpp] [--oo _f_i_e_l_d[,_f_i_e_l_d]...] aallll|_p_r_o_p_e_r_t_y[,_p_r_o_p_e_r_t_y]... _p_o_o_l... zzppooooll hhiissttoorryy [--iill] [_p_o_o_l]... zzppooooll iimmppoorrtt [--DD] [--dd _d_i_r] zzppooooll iimmppoorrtt --aa [--DDffmmNN] [--FF [--nn]] [--cc _c_a_c_h_e_f_i_l_e|--dd _d_i_r] [--oo _m_n_t_o_p_t_s] [--oo _p_r_o_p_e_r_t_y=_v_a_l_u_e]... [--RR _r_o_o_t] zzppooooll iimmppoorrtt [--DDffmm] [--FF [--nn]] [--cc _c_a_c_h_e_f_i_l_e|--dd _d_i_r] [--oo _m_n_t_o_p_t_s] [--oo _p_r_o_p_e_r_t_y=_v_a_l_u_e]... [--RR _r_o_o_t] _p_o_o_l|_i_d [_n_e_w_p_o_o_l] zzppooooll iioossttaatt [--vv] [--TT uu|dd] [_p_o_o_l]... [_i_n_t_e_r_v_a_l [_c_o_u_n_t]] zzppooooll lliisstt [--HHppvv] [--oo _p_r_o_p_e_r_t_y[,_p_r_o_p_e_r_t_y]...] [--TT uu|dd] [_p_o_o_l]... [_i_n_t_e_r_v_a_l [_c_o_u_n_t]] zzppooooll oofffflliinnee [--tt] _p_o_o_l _d_e_v_i_c_e... zzppooooll oonnlliinnee [--ee] _p_o_o_l _d_e_v_i_c_e... zzppooooll rreegguuiidd _p_o_o_l zzppooooll rreeooppeenn _p_o_o_l zzppooooll rreemmoovvee _p_o_o_l _d_e_v_i_c_e... zzppooooll rreeppllaaccee [--ff] _p_o_o_l _d_e_v_i_c_e [_n_e_w___d_e_v_i_c_e] zzppooooll ssccrruubb [--ss] _p_o_o_l... zzppooooll sseett _p_r_o_p_e_r_t_y=_v_a_l_u_e _p_o_o_l zzppooooll sspplliitt [--nn] [--oo _p_r_o_p_e_r_t_y=_v_a_l_u_e]... [--RR _r_o_o_t] _p_o_o_l _n_e_w_p_o_o_l zzppooooll ssttaattuuss [--DDvvxx] [--TT uu|dd] [_p_o_o_l]... [_i_n_t_e_r_v_a_l [_c_o_u_n_t]] zzppooooll uuppggrraaddee zzppooooll uuppggrraaddee --vv zzppooooll uuppggrraaddee [--VV _v_e_r_s_i_o_n] --aa|_p_o_o_l... DDEESSCCRRIIPPTTIIOONN The zzppooooll command configures ZFS storage pools. A storage pool is a collection of devices that provides physical storage and data replication for ZFS datasets. All datasets within a storage pool share the same space. See zfs(1M) for information on managing datasets. VViirrttuuaall DDeevviicceess ((vvddeevvss)) A "virtual device" describes a single device or a collection of devices organized according to certain performance and fault characteristics. The following virtual devices are supported: ddiisskk A block device, typically located under _/_d_e_v_/_d_s_k. ZFS can use individual slices or partitions, though the recommended mode of operation is to use whole disks. A disk can be specified by a full path, or it can be a shorthand name (the relative portion of the path under _/_d_e_v_/_d_s_k). A whole disk can be specified by omitting the slice or partition designation. For example, _c_0_t_0_d_0 is equivalent to _/_d_e_v_/_d_s_k_/_c_0_t_0_d_0_s_2. When given a whole disk, ZFS automatically labels the disk, if necessary. ffiillee A regular file. The use of files as a backing store is strongly discouraged. It is designed primarily for experimental purposes, as the fault tolerance of a file is only as good as the file system of which it is a part. A file must be specified by a full path. mmiirrrroorr A mirror of two or more devices. Data is replicated in an identical fashion across all components of a mirror. A mirror with N disks of size X can hold X bytes and can withstand (N-1) devices failing before data integrity is compromised. rraaiiddzz, rraaiiddzz11, rraaiiddzz22, rraaiiddzz33 A variation on RAID-5 that allows for better distribution of parity and eliminates the RAID-5 "write hole" (in which data and parity become inconsistent after a power loss). Data and parity is striped across all disks within a raidz group. A raidz group can have single-, double-, or triple-parity, meaning that the raidz group can sustain one, two, or three failures, respectively, without losing any data. The rraaiiddzz11 vdev type specifies a single-parity raidz group; the rraaiiddzz22 vdev type specifies a double-parity raidz group; and the rraaiiddzz33 vdev type specifies a triple-parity raidz group. The rraaiiddzz vdev type is an alias for rraaiiddzz11. A raidz group with N disks of size X with P parity disks can hold approximately (N-P)*X bytes and can withstand P device(s) failing before data integrity is compromised. The minimum number of devices in a raidz group is one more than the number of parity disks. The recommended number is between 3 and 9 to help increase performance. ssppaarree A special pseudo-vdev which keeps track of available hot spares for a pool. For more information, see the _H_o_t _S_p_a_r_e_s section. lloogg A separate intent log device. If more than one log device is specified, then writes are load-balanced between devices. Log devices can be mirrored. However, raidz vdev types are not supported for the intent log. For more information, see the _I_n_t_e_n_t _L_o_g section. ccaacchhee A device used to cache storage pool data. A cache device cannot be configured as a mirror or raidz group. For more information, see the _C_a_c_h_e _D_e_v_i_c_e_s section. Virtual devices cannot be nested, so a mirror or raidz virtual device can only contain files or disks. Mirrors of mirrors (or other combinations) are not allowed. A pool can have any number of virtual devices at the top of the configuration (known as "root vdevs"). Data is dynamically distributed across all top-level devices to balance data among devices. As new virtual devices are added, ZFS automatically places data on the newly available devices. Virtual devices are specified one at a time on the command line, separated by whitespace. The keywords mmiirrrroorr and rraaiiddzz are used to distinguish where a group ends and another begins. For example, the following creates two root vdevs, each a mirror of two disks: # zpool create mypool mirror c0t0d0 c0t1d0 mirror c1t0d0 c1t1d0 DDeevviiccee FFaaiilluurree aanndd RReeccoovveerryy ZFS supports a rich set of mechanisms for handling device failure and data corruption. All metadata and data is checksummed, and ZFS automatically repairs bad data from a good copy when corruption is detected. In order to take advantage of these features, a pool must make use of some form of redundancy, using either mirrored or raidz groups. While ZFS supports running in a non-redundant configuration, where each root vdev is simply a disk or file, this is strongly discouraged. A single case of bit corruption can render some or all of your data unavailable. A pool's health status is described by one of three states: online, degraded, or faulted. An online pool has all devices operating normally. A degraded pool is one in which one or more devices have failed, but the data is still available due to a redundant configuration. A faulted pool has corrupted metadata, or one or more faulted devices, and insufficient replicas to continue functioning. The health of the top-level vdev, such as mirror or raidz device, is potentially impacted by the state of its associated vdevs, or component devices. A top-level vdev or component device is in one of the following states: DDEEGGRRAADDEEDD One or more top-level vdevs is in the degraded state because one or more component devices are offline. Sufficient replicas exist to continue functioning. One or more component devices is in the degraded or faulted state, but sufficient replicas exist to continue functioning. The underlying conditions are as follows: ++oo The number of checksum errors exceeds acceptable levels and the device is degraded as an indication that something may be wrong. ZFS continues to use the device as necessary. ++oo The number of I/O errors exceeds acceptable levels. The device could not be marked as faulted because there are insufficient replicas to continue functioning. FFAAUULLTTEEDD One or more top-level vdevs is in the faulted state because one or more component devices are offline. Insufficient replicas exist to continue functioning. One or more component devices is in the faulted state, and insufficient replicas exist to continue functioning. The underlying conditions are as follows: ++oo The device could be opened, but the contents did not match expected values. ++oo The number of I/O errors exceeds acceptable levels and the device is faulted to prevent further use of the device. OOFFFFLLIINNEE The device was explicitly taken offline by the zzppooooll oofffflliinnee command. OONNLLIINNEE The device is online and functioning. RREEMMOOVVEEDD The device was physically removed while the system was running. Device removal detection is hardware-dependent and may not be supported on all platforms. UUNNAAVVAAIILL The device could not be opened. If a pool is imported when a device was unavailable, then the device will be identified by a unique identifier instead of its path since the path was never correct in the first place. If a device is removed and later re-attached to the system, ZFS attempts to put the device online automatically. Device attach detection is hardware-dependent and might not be supported on all platforms. HHoott SSppaarreess ZFS allows devices to be associated with pools as "hot spares". These devices are not actively used in the pool, but when an active device fails, it is automatically replaced by a hot spare. To create a pool with hot spares, specify a ssppaarree vdev with any number of devices. For example, # zpool create pool mirror c0d0 c1d0 spare c2d0 c3d0 Spares can be shared across multiple pools, and can be added with the zzppooooll aadddd command and removed with the zzppooooll rreemmoovvee command. Once a spare replacement is initiated, a new ssppaarree vdev is created within the configuration that will remain there until the original device is replaced. At this point, the hot spare becomes available again if another device fails. If a pool has a shared spare that is currently being used, the pool can not be exported since other pools may use this shared spare, which may lead to potential data corruption. An in-progress spare replacement can be cancelled by detaching the hot spare. If the original faulted device is detached, then the hot spare assumes its place in the configuration, and is removed from the spare list of all active pools. Spares cannot replace log devices. IInntteenntt LLoogg The ZFS Intent Log (ZIL) satisfies POSIX requirements for synchronous transactions. For instance, databases often require their transactions to be on stable storage devices when returning from a system call. NFS and other applications can also use fsync(3C) to ensure data stability. By default, the intent log is allocated from blocks within the main pool. However, it might be possible to get better performance using separate intent log devices such as NVRAM or a dedicated disk. For example: # zpool create pool c0d0 c1d0 log c2d0 Multiple log devices can also be specified, and they can be mirrored. See the _E_X_A_M_P_L_E_S section for an example of mirroring multiple log devices. Log devices can be added, replaced, attached, detached, and imported and exported as part of the larger pool. Mirrored log devices can be removed by specifying the top-level mirror for the log. CCaacchhee DDeevviicceess Devices can be added to a storage pool as "cache devices". These devices provide an additional layer of caching between main memory and disk. For read-heavy workloads, where the working set size is much larger than what can be cached in main memory, using cache devices allow much more of this working set to be served from low latency media. Using cache devices provides the greatest performance improvement for random read-workloads of mostly static content. To create a pool with cache devices, specify a ccaacchhee vdev with any number of devices. For example: # zpool create pool c0d0 c1d0 cache c2d0 c3d0 Cache devices cannot be mirrored or part of a raidz configuration. If a read error is encountered on a cache device, that read I/O is reissued to the original storage pool device, which might be part of a mirrored or raidz configuration. The content of the cache devices is considered volatile, as is the case with other system caches. PPrrooppeerrttiieess Each pool has several properties associated with it. Some properties are read-only statistics while others are configurable and change the behavior of the pool. The following are read-only properties: aavvaaiillaabbllee Amount of storage available within the pool. This property can also be referred to by its shortened column name, aavvaaiill. ccaappaacciittyy Percentage of pool space used. This property can also be referred to by its shortened column name, ccaapp. eexxppaannddssiizzee Amount of uninitialized space within the pool or device that can be used to increase the total capacity of the pool. Uninitialized space consists of any space on an EFI labeled vdev which has not been brought online (e.g, using zzppooooll oonnlliinnee --ee). This space occurs when a LUN is dynamically expanded. ffrraaggmmeennttaattiioonn The amount of fragmentation in the pool. ffrreeee The amount of free space available in the pool. ffrreeeeiinngg After a file system or snapshot is destroyed, the space it was using is returned to the pool asynchronously. ffrreeeeiinngg is the amount of space remaining to be reclaimed. Over time ffrreeeeiinngg will decrease while ffrreeee increases. hheeaalltthh The current health of the pool. Health can be one of OONNLLIINNEE, DDEEGGRRAADDEEDD, FFAAUULLTTEEDD, OOFFFFLLIINNEE,, RREEMMOOVVEEDD, UUNNAAVVAAIILL. gguuiidd A unique identifier for the pool. ssiizzee Total size of the storage pool. uunnssuuppppoorrtteedd@@_f_e_a_t_u_r_e___g_u_i_d Information about unsupported features that are enabled on the pool. See zpool-features(5) for details. uusseedd Amount of storage space used within the pool. The space usage properties report actual physical space available to the storage pool. The physical space can be different from the total amount of space that any contained datasets can actually use. The amount of space used in a raidz configuration depends on the characteristics of the data being written. In addition, ZFS reserves some space for internal accounting that the zfs(1M) command takes into account, but the zzppooooll command does not. For non-full pools of a reasonable size, these effects should be invisible. For small pools, or pools that are close to being completely full, these discrepancies may become more noticeable. The following property can be set at creation time and import time: aallttrroooott Alternate root directory. If set, this directory is prepended to any mount points within the pool. This can be used when examining an unknown pool where the mount points cannot be trusted, or in an alternate boot environment, where the typical paths are not valid. aallttrroooott is not a persistent property. It is valid only while the system is up. Setting aallttrroooott defaults to using ccaacchheeffiillee=nnoonnee, though this may be overridden using an explicit setting. The following property can be set only at import time: rreeaaddoonnllyy=oonn|ooffff If set to oonn, the pool will be imported in read-only mode. This property can also be referred to by its shortened column name, rrddoonnllyy. The following properties can be set at creation time and import time, and later changed with the zzppooooll sseett command: aauuttooeexxppaanndd=oonn|ooffff Controls automatic pool expansion when the underlying LUN is grown. If set to oonn, the pool will be resized according to the size of the expanded device. If the device is part of a mirror or raidz then all devices within that mirror/raidz group must be expanded before the new space is made available to the pool. The default behavior is ooffff. This property can also be referred to by its shortened column name, eexxppaanndd. aauuttoorreeppllaaccee=oonn|ooffff Controls automatic device replacement. If set to ooffff, device replacement must be initiated by the administrator by using the zzppooooll rreeppllaaccee command. If set to oonn, any new device, found in the same physical location as a device that previously belonged to the pool, is automatically formatted and replaced. The default behavior is ooffff. This property can also be referred to by its shortened column name, rreeppllaaccee. bboooottffss=_p_o_o_l/_d_a_t_a_s_e_t Identifies the default bootable dataset for the root pool. This property is expected to be set mainly by the installation and upgrade programs. ccaacchheeffiillee=_p_a_t_h|nnoonnee Controls the location of where the pool configuration is cached. Discovering all pools on system startup requires a cached copy of the configuration data that is stored on the root file system. All pools in this cache are automatically imported when the system boots. Some environments, such as install and clustering, need to cache this information in a different location so that pools are not automatically imported. Setting this property caches the pool configuration in a different location that can later be imported with zzppooooll iimmppoorrtt --cc. Setting it to the special value nnoonnee creates a temporary pool that is never cached, and the special value "" (empty string) uses the default location. Multiple pools can share the same cache file. Because the kernel destroys and recreates this file when pools are added and removed, care should be taken when attempting to access this file. When the last pool using a ccaacchheeffiillee is exported or destroyed, the file is removed. ccoommmmeenntt=_t_e_x_t A text string consisting of printable ASCII characters that will be stored such that it is available even if the pool becomes faulted. An administrator can provide additional information about a pool using this property. ddeedduuppddiittttoo=_n_u_m_b_e_r Threshold for the number of block ditto copies. If the reference count for a deduplicated block increases above this number, a new ditto copy of this block is automatically stored. The default setting is 00 which causes no ditto copies to be created for deduplicated blocks. The miniumum legal nonzero setting is 110000. ddeelleeggaattiioonn=oonn|ooffff Controls whether a non-privileged user is granted access based on the dataset permissions defined on the dataset. See zfs(1M) for more information on ZFS delegated administration. ffaaiillmmooddee=wwaaiitt|ccoonnttiinnuuee|ppaanniicc Controls the system behavior in the event of catastrophic pool failure. This condition is typically a result of a loss of connectivity to the underlying storage device(s) or a failure of all devices within the pool. The behavior of such an event is determined as follows: wwaaiitt Blocks all I/O access until the device connectivity is recovered and the errors are cleared. This is the default behavior. ccoonnttiinnuuee Returns EIO to any new write I/O requests but allows reads to any of the remaining healthy devices. Any write requests that have yet to be committed to disk would be blocked. ppaanniicc Prints out a message to the console and generates a system crash dump. ffeeaattuurree@@_f_e_a_t_u_r_e___n_a_m_e=eennaabblleedd The value of this property is the current state of _f_e_a_t_u_r_e___n_a_m_e. The only valid value when setting this property is eennaabblleedd which moves _f_e_a_t_u_r_e___n_a_m_e to the enabled state. See zpool-features(5) for details on feature states. lliissttssnnaappss=oonn|ooffff Controls whether information about snapshots associated with this pool is output when zzffss lliisstt is run without the --tt option. The default value is ooffff. vveerrssiioonn=_v_e_r_s_i_o_n The current on-disk version of the pool. This can be increased, but never decreased. The preferred method of updating pools is with the zzppooooll uuppggrraaddee command, though this property can be used when a specific version is needed for backwards compatibility. Once feature flags is enabled on a pool this property will no longer have a value. SSuubbccoommmmaannddss All subcommands that modify state are logged persistently to the pool in their original form. The zzppooooll command provides subcommands to create and destroy storage pools, add capacity to storage pools, and provide information about the storage pools. The following subcommands are supported: zzppooooll --?? Displays a help message. zzppooooll aadddd [--ffnn] _p_o_o_l _v_d_e_v... Adds the specified virtual devices to the given pool. The _v_d_e_v specification is described in the _V_i_r_t_u_a_l _D_e_v_i_c_e_s section. The behavior of the --ff option, and the device checks performed are described in the zzppooooll ccrreeaattee subcommand. --ff Forces use of _v_d_e_vs, even if they appear in use or specify a conflicting replication level. Not all devices can be overridden in this manner. --nn Displays the configuration that would be used without actually adding the _v_d_e_vs. The actual pool creation can still fail due to insufficient privileges or device sharing. zzppooooll aattttaacchh [--ff] _p_o_o_l _d_e_v_i_c_e _n_e_w___d_e_v_i_c_e Attaches _n_e_w___d_e_v_i_c_e to the existing _d_e_v_i_c_e. The existing device cannot be part of a raidz configuration. If _d_e_v_i_c_e is not currently part of a mirrored configuration, _d_e_v_i_c_e automatically transforms into a two-way mirror of _d_e_v_i_c_e and _n_e_w___d_e_v_i_c_e. If _d_e_v_i_c_e is part of a two-way mirror, attaching _n_e_w___d_e_v_i_c_e creates a three-way mirror, and so on. In either case, _n_e_w___d_e_v_i_c_e begins to resilver immediately. --ff Forces use of _n_e_w___d_e_v_i_c_e, even if its appears to be in use. Not all devices can be overridden in this manner. zzppooooll cclleeaarr _p_o_o_l [_d_e_v_i_c_e] Clears device errors in a pool. If no arguments are specified, all device errors within the pool are cleared. If one or more devices is specified, only those errors associated with the specified device or devices are cleared. zzppooooll ccrreeaattee [--ddffnn] [--mm _m_o_u_n_t_p_o_i_n_t] [--oo _p_r_o_p_e_r_t_y=_v_a_l_u_e]... [--OO _f_i_l_e_-_s_y_s_t_e_m_-_p_r_o_p_e_r_t_y=_v_a_l_u_e]... [--RR _r_o_o_t] _p_o_o_l _v_d_e_v... Creates a new storage pool containing the virtual devices specified on the command line. The pool name must begin with a letter, and can only contain alphanumeric characters as well as underscore ("__"), dash ("--"), and period (".."). The pool names mmiirrrroorr, rraaiiddzz, ssppaarree and lloogg are reserved, as are names beginning with the pattern cc[[00--99]]. The _v_d_e_v specification is described in the _V_i_r_t_u_a_l _D_e_v_i_c_e_s section. The command verifies that each device specified is accessible and not currently in use by another subsystem. There are some uses, such as being currently mounted, or specified as the dedicated dump device, that prevents a device from ever being used by ZFS . Other uses, such as having a preexisting UFS file system, can be overridden with the --ff option. The command also checks that the replication strategy for the pool is consistent. An attempt to combine redundant and non- redundant storage in a single pool, or to mix disks and files, results in an error unless --ff is specified. The use of differently sized devices within a single raidz or mirror group is also flagged as an error unless --ff is specified. Unless the --RR option is specified, the default mount point is _/_p_o_o_l. The mount point must not exist or must be empty, or else the root dataset cannot be mounted. This can be overridden with the --mm option. By default all supported features are enabled on the new pool unless the --dd option is specified. --dd Do not enable any features on the new pool. Individual features can be enabled by setting their corresponding properties to eennaabblleedd with the --oo option. See zpool-features(5) for details about feature properties. --ff Forces use of _v_d_e_vs, even if they appear in use or specify a conflicting replication level. Not all devices can be overridden in this manner. --mm _m_o_u_n_t_p_o_i_n_t Sets the mount point for the root dataset. The default mount point is _/_p_o_o_l or _a_l_t_r_o_o_t_/_p_o_o_l if _a_l_t_r_o_o_t is specified. The mount point must be an absolute path, lleeggaaccyy, or nnoonnee. For more information on dataset mount points, see zfs(1M). --nn Displays the configuration that would be used without actually creating the pool. The actual pool creation can still fail due to insufficient privileges or device sharing. --oo _p_r_o_p_e_r_t_y=_v_a_l_u_e Sets the given pool properties. See the _P_r_o_p_e_r_t_i_e_s section for a list of valid properties that can be set. --OO _f_i_l_e_-_s_y_s_t_e_m_-_p_r_o_p_e_r_t_y=_v_a_l_u_e Sets the given file system properties in the root file system of the pool. See the _P_r_o_p_e_r_t_i_e_s section of zfs(1M) for a list of valid properties that can be set. --RR _r_o_o_t Equivalent to --oo ccaacchheeffiillee=nnoonnee --oo aallttrroooott=_r_o_o_t zzppooooll ddeessttrrooyy [--ff] _p_o_o_l Destroys the given pool, freeing up any devices for other use. This command tries to unmount any active datasets before destroying the pool. --ff Forces any active datasets contained within the pool to be unmounted. zzppooooll ddeettaacchh _p_o_o_l _d_e_v_i_c_e Detaches _d_e_v_i_c_e from a mirror. The operation is refused if there are no other valid replicas of the data. zzppooooll eexxppoorrtt [--ff] _p_o_o_l... Exports the given pools from the system. All devices are marked as exported, but are still considered in use by other subsystems. The devices can be moved between systems (even those of different endianness) and imported as long as a sufficient number of devices are present. Before exporting the pool, all datasets within the pool are unmounted. A pool can not be exported if it has a shared spare that is currently being used. For pools to be portable, you must give the zzppooooll command whole disks, not just slices, so that ZFS can label the disks with portable EFI labels. Otherwise, disk drivers on platforms of different endianness will not recognize the disks. --ff Forcefully unmount all datasets, using the uunnmmoouunntt --ff command. This command will forcefully export the pool even if it has a shared spare that is currently being used. This may lead to potential data corruption. zzppooooll ggeett [--HHpp] [--oo _f_i_e_l_d[,_f_i_e_l_d]...] aallll|_p_r_o_p_e_r_t_y[,_p_r_o_p_e_r_t_y]... _p_o_o_l... Retrieves the given list of properties (or all properties if aallll is used) for the specified storage pool(s). These properties are displayed with the following fields: name Name of storage pool property Property name value Property value source Property source, either 'default' or 'local'. See the _P_r_o_p_e_r_t_i_e_s section for more information on the available pool properties. --HH Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space. --oo _f_i_e_l_d A comma-separated list of columns to display. nnaammee,pprrooppeerrttyy,vvaalluuee,ssoouurrccee is the default value. --pp Display numbers in parsable (exact) values. zzppooooll hhiissttoorryy [--iill] [_p_o_o_l]... Displays the command history of the specified pool(s) or all pools if no pool is specified. --ii Displays internally logged ZFS events in addition to user initiated events. --ll Displays log records in long format, which in addition to standard format includes, the user name, the hostname, and the zone in which the operation was performed. zzppooooll iimmppoorrtt [--DD] [--dd _d_i_r] Lists pools available to import. If the --dd option is not specified, this command searches for devices in _/_d_e_v_/_d_s_k. The --dd option can be specified multiple times, and all directories are searched. If the device appears to be part of an exported pool, this command displays a summary of the pool with the name of the pool, a numeric identifier, as well as the vdev layout and current health of the device for each device or file. Destroyed pools, pools that were previously destroyed with the zzppooooll ddeessttrrooyy command, are not listed unless the --DD option is specified. The numeric identifier is unique, and can be used instead of the pool name when multiple exported pools of the same name are available. --cc _c_a_c_h_e_f_i_l_e Reads configuration from the given _c_a_c_h_e_f_i_l_e that was created with the ccaacchheeffiillee pool property. This _c_a_c_h_e_f_i_l_e is used instead of searching for devices. --dd _d_i_r Searches for devices or files in _d_i_r. The --dd option can be specified multiple times. --DD Lists destroyed pools only. zzppooooll iimmppoorrtt --aa [--DDffmmNN] [--FF [--nn]] [--cc _c_a_c_h_e_f_i_l_e|--dd _d_i_r] [--oo _m_n_t_o_p_t_s] [--oo _p_r_o_p_e_r_t_y=_v_a_l_u_e]... [--RR _r_o_o_t] Imports all pools found in the search directories. Identical to the previous command, except that all pools with a sufficient number of devices available are imported. Destroyed pools, pools that were previously destroyed with the zzppooooll ddeessttrrooyy command, will not be imported unless the --DD option is specified. --aa Searches for and imports all pools found. --cc _c_a_c_h_e_f_i_l_e Reads configuration from the given _c_a_c_h_e_f_i_l_e that was created with the ccaacchheeffiillee pool property. This _c_a_c_h_e_f_i_l_e is used instead of searching for devices. --dd _d_i_r Searches for devices or files in _d_i_r. The --dd option can be specified multiple times. This option is incompatible with the --cc option. --DD Imports destroyed pools only. The --ff option is also required. --ff Forces import, even if the pool appears to be potentially active. --FF Recovery mode for a non-importable pool. Attempt to return the pool to an importable state by discarding the last few transactions. Not all damaged pools can be recovered by using this option. If successful, the data from the discarded transactions is irretrievably lost. This option is ignored if the pool is importable or already imported. --mm Allows a pool to import when there is a missing log device. Recent transactions can be lost because the log device will be discarded. --nn Used with the --FF recovery option. Determines whether a non-importable pool can be made importable again, but does not actually perform the pool recovery. For more details about pool recovery mode, see the --FF option, above. --NN Import the pool without mounting any file systems. --oo _m_n_t_o_p_t_s Comma-separated list of mount options to use when mounting datasets within the pool. See zfs(1M) for a description of dataset properties and mount options. --oo _p_r_o_p_e_r_t_y=_v_a_l_u_e Sets the specified property on the imported pool. See the _P_r_o_p_e_r_t_i_e_s section for more information on the available pool properties. --RR _r_o_o_t Sets the ccaacchheeffiillee property to nnoonnee and the aallttrroooott property to _r_o_o_t. zzppooooll iimmppoorrtt [--DDffmm] [--FF [--nn]] [--cc _c_a_c_h_e_f_i_l_e|--dd _d_i_r] [--oo _m_n_t_o_p_t_s] [--oo _p_r_o_p_e_r_t_y=_v_a_l_u_e]... [--RR _r_o_o_t] _p_o_o_l|_i_d [_n_e_w_p_o_o_l] Imports a specific pool. A pool can be identified by its name or the numeric identifier. If _n_e_w_p_o_o_l is specified, the pool is imported using the name _n_e_w_p_o_o_l. Otherwise, it is imported with the same name as its exported name. If a device is removed from a system without running zzppooooll eexxppoorrtt first, the device appears as potentially active. It cannot be determined if this was a failed export, or whether the device is really in use from another host. To import a pool in this state, the --ff option is required. --cc _c_a_c_h_e_f_i_l_e Reads configuration from the given _c_a_c_h_e_f_i_l_e that was created with the ccaacchheeffiillee pool property. This _c_a_c_h_e_f_i_l_e is used instead of searching for devices. --dd _d_i_r Searches for devices or files in _d_i_r. The --dd option can be specified multiple times. This option is incompatible with the --cc option. --DD Imports destroyed pool. The --ff option is also required. --ff Forces import, even if the pool appears to be potentially active. --FF Recovery mode for a non-importable pool. Attempt to return the pool to an importable state by discarding the last few transactions. Not all damaged pools can be recovered by using this option. If successful, the data from the discarded transactions is irretrievably lost. This option is ignored if the pool is importable or already imported. --mm Allows a pool to import when there is a missing log device. Recent transactions can be lost because the log device will be discarded. --nn Used with the --FF recovery option. Determines whether a non-importable pool can be made importable again, but does not actually perform the pool recovery. For more details about pool recovery mode, see the --FF option, above. --oo _m_n_t_o_p_t_s Comma-separated list of mount options to use when mounting datasets within the pool. See zfs(1M) for a description of dataset properties and mount options. --oo _p_r_o_p_e_r_t_y=_v_a_l_u_e Sets the specified property on the imported pool. See the _P_r_o_p_e_r_t_i_e_s section for more information on the available pool properties. --RR _r_o_o_t Sets the ccaacchheeffiillee property to nnoonnee and the aallttrroooott property to _r_o_o_t. zzppooooll iioossttaatt [--vv] [--TT uu|dd] [_p_o_o_l]... [_i_n_t_e_r_v_a_l [_c_o_u_n_t]] Displays I/O statistics for the given pools. When given an _i_n_t_e_r_v_a_l, the statistics are printed every _i_n_t_e_r_v_a_l seconds until ^C is pressed. If no _p_o_o_ls are specified, statistics for every pool in the system is shown. If _c_o_u_n_t is specified, the command exits after _c_o_u_n_t reports are printed. --TT uu|dd Display a time stamp. Specify uu for a printed representation of the internal representation of time. See time(2). Specify dd for standard date format. See date(1). --vv Verbose statistics. Reports usage statistics for individual vdevs within the pool, in addition to the pool-wide statistics. zzppooooll lliisstt [--HHppvv] [--oo _p_r_o_p_e_r_t_y[,_p_r_o_p_e_r_t_y]...] [--TT uu|dd] [_p_o_o_l]... [_i_n_t_e_r_v_a_l [_c_o_u_n_t]] Lists the given pools along with a health status and space usage. If no _p_o_o_ls are specified, all pools in the system are listed. When given an _i_n_t_e_r_v_a_l, the information is printed every _i_n_t_e_r_v_a_l seconds until ^C is pressed. If _c_o_u_n_t is specified, the command exits after _c_o_u_n_t reports are printed. --HH Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space. --oo _p_r_o_p_e_r_t_y Comma-separated list of properties to display. See the _P_r_o_p_e_r_t_i_e_s section for a list of valid properties. The default list is nnaammee, ssiizzee, uusseedd, aavvaaiillaabbllee, ffrraaggmmeennttaattiioonn, eexxppaannddssiizzee, ccaappaacciittyy, ddeedduupprraattiioo, hheeaalltthh, aallttrroooott. --pp Display numbers in parsable (exact) values. --TT uu|dd Display a time stamp. Specify --uu for a printed representation of the internal representation of time. See time(2). Specify --dd for standard date format. See date(1). --vv Verbose statistics. Reports usage statistics for individual vdevs within the pool, in addition to the pool-wise statistics. zzppooooll oofffflliinnee [--tt] _p_o_o_l _d_e_v_i_c_e... Takes the specified physical device offline. While the _d_e_v_i_c_e is offline, no attempt is made to read or write to the device. This command is not applicable to spares. --tt Temporary. Upon reboot, the specified physical device reverts to its previous state. zzppooooll oonnlliinnee [--ee] _p_o_o_l _d_e_v_i_c_e... Brings the specified physical device online. This command is not applicable to spares. --ee Expand the device to use all available space. If the device is part of a mirror or raidz then all devices must be expanded before the new space will become available to the pool. zzppooooll rreegguuiidd _p_o_o_l Generates a new unique identifier for the pool. You must ensure that all devices in this pool are online and healthy before performing this action. zzppooooll rreeooppeenn _p_o_o_l Reopen all the vdevs associated with the pool. zzppooooll rreemmoovvee _p_o_o_l _d_e_v_i_c_e... Removes the specified device from the pool. This command currently only supports removing hot spares, cache, and log devices. A mirrored log device can be removed by specifying the top-level mirror for the log. Non-log devices that are part of a mirrored configuration can be removed using the zzppooooll ddeettaacchh command. Non-redundant and raidz devices cannot be removed from a pool. zzppooooll rreeppllaaccee [--ff] _p_o_o_l _d_e_v_i_c_e [_n_e_w___d_e_v_i_c_e] Replaces _o_l_d___d_e_v_i_c_e with _n_e_w___d_e_v_i_c_e. This is equivalent to attaching _n_e_w___d_e_v_i_c_e, waiting for it to resilver, and then detaching _o_l_d___d_e_v_i_c_e. The size of _n_e_w___d_e_v_i_c_e must be greater than or equal to the minimum size of all the devices in a mirror or raidz configuration. _n_e_w___d_e_v_i_c_e is required if the pool is not redundant. If _n_e_w___d_e_v_i_c_e is not specified, it defaults to _o_l_d___d_e_v_i_c_e. This form of replacement is useful after an existing disk has failed and has been physically replaced. In this case, the new disk may have the same _/_d_e_v_/_d_s_k path as the old device, even though it is actually a different disk. ZFS recognizes this. --ff Forces use of _n_e_w___d_e_v_i_c_e, even if its appears to be in use. Not all devices can be overridden in this manner. zzppooooll ssccrruubb [--ss] _p_o_o_l... Begins a scrub. The scrub examines all data in the specified pools to verify that it checksums correctly. For replicated (mirror or raidz) devices, ZFS automatically repairs any damage discovered during the scrub. The zzppooooll ssttaattuuss command reports the progress of the scrub and summarizes the results of the scrub upon completion. Scrubbing and resilvering are very similar operations. The difference is that resilvering only examines data that ZFS knows to be out of date (for example, when attaching a new device to a mirror or replacing an existing device), whereas scrubbing examines all data to discover silent errors due to hardware faults or disk failure. Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows one at a time. If a scrub is already in progress, the zzppooooll ssccrruubb command terminates it and starts a new scrub. If a resilver is in progress, ZFS does not allow a scrub to be started until the resilver completes. --ss Stop scrubbing. zzppooooll sseett _p_r_o_p_e_r_t_y=_v_a_l_u_e _p_o_o_l Sets the given property on the specified pool. See the _P_r_o_p_e_r_t_i_e_s section for more information on what properties can be set and acceptable values. zzppooooll sspplliitt [--nn] [--oo _p_r_o_p_e_r_t_y=_v_a_l_u_e]... [--RR _r_o_o_t] _p_o_o_l _n_e_w_p_o_o_l Splits devices off _p_o_o_l creating _n_e_w_p_o_o_l. All vdevs in _p_o_o_l must be mirrors. At the time of the split, _n_e_w_p_o_o_l will be a replica of _p_o_o_l. --nn Do dry run, do not actually perform the split. Print out the expected configuration of _n_e_w_p_o_o_l. --oo _p_r_o_p_e_r_t_y=_v_a_l_u_e Sets the specified property for _n_e_w_p_o_o_l. See the _P_r_o_p_e_r_t_i_e_s section for more information on the available pool properties. --RR _r_o_o_t Set aallttrroooott for _n_e_w_p_o_o_l to _r_o_o_t and automaticaly import it. zzppooooll ssttaattuuss [--DDvvxx] [--TT uu|dd] [_p_o_o_l]... [_i_n_t_e_r_v_a_l [_c_o_u_n_t]] Displays the detailed health status for the given pools. If no _p_o_o_l is specified, then the status of each pool in the system is displayed. For more information on pool and device health, see the _D_e_v_i_c_e _F_a_i_l_u_r_e _a_n_d _R_e_c_o_v_e_r_y section. If a scrub or resilver is in progress, this command reports the percentage done and the estimated time to completion. Both of these are only approximate, because the amount of data in the pool and the other workloads on the system can change. --DD Display a histogram of deduplication statistics, showing the allocated (physically present on disk) and referenced (logically referenced in the pool) block counts and sizes by reference count. --TT uu|dd Display a time stamp. Specify --uu for a printed representation of the internal representation of time. See time(2). Specify --dd for standard date format. See date(1). --vv Displays verbose data error information, printing out a complete list of all data errors since the last complete pool scrub. --xx Only display status for pools that are exhibiting errors or are otherwise unavailable. Warnings about pools not using the latest on-disk format will not be included. zzppooooll uuppggrraaddee Displays pools which do not have all supported features enabled and pools formatted using a legacy ZFS version number. These pools can continue to be used, but some features may not be available. Use zzppooooll uuppggrraaddee --aa to enable all features on all pools. zzppooooll uuppggrraaddee --vv Displays legacy ZFS versions supported by the current software. See zpool-features(5) for a description of feature flags features supported by the current software. zzppooooll uuppggrraaddee [--VV _v_e_r_s_i_o_n] --aa|_p_o_o_l... Enables all supported features on the given pool. Once this is done, the pool will no longer be accessible on systems that do not support feature flags. See zpool-features(5) for details on compatibility with systems that support feature flags, but do not support all features enabled on the pool. --aa Enables all supported features on all pools. --VV _v_e_r_s_i_o_n Upgrade to the specified legacy version. If the --VV flag is specified, no features will be enabled on the pool. This option can only be used to increase the version number up to the last supported legacy version number. EEXXIITT SSTTAATTUUSS The following exit values are returned: 00 Successful completion. 11 An error occurred. 22 Invalid command line options were specified. EEXXAAMMPPLLEESS EExxaammppllee 11 Creating a RAID-Z Storage Pool The following command creates a pool with a single raidz root vdev that consists of six disks. # zpool create tank raidz c0t0d0 c0t1d0 c0t2d0 c0t3d0 c0t4d0 c0t5d0 EExxaammppllee 22 Creating a Mirrored Storage Pool The following command creates a pool with two mirrors, where each mirror contains two disks. # zpool create tank mirror c0t0d0 c0t1d0 mirror c0t2d0 c0t3d0 EExxaammppllee 33 Creating a ZFS Storage Pool by Using Slices The following command creates an unmirrored pool using two disk slices. # zpool create tank /dev/dsk/c0t0d0s1 c0t1d0s4 EExxaammppllee 44 Creating a ZFS Storage Pool by Using Files The following command creates an unmirrored pool using files. While not recommended, a pool based on files can be useful for experimental purposes. # zpool create tank /path/to/file/a /path/to/file/b EExxaammppllee 55 Adding a Mirror to a ZFS Storage Pool The following command adds two mirrored disks to the pool _t_a_n_k, assuming the pool is already made up of two-way mirrors. The additional space is immediately available to any datasets within the pool. # zpool add tank mirror c1t0d0 c1t1d0 EExxaammppllee 66 Listing Available ZFS Storage Pools The following command lists all available pools on the system. In this case, the pool _z_i_o_n is faulted due to a missing device. The results from this command are similar to the following: # zpool list NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT rpool 19.9G 8.43G 11.4G 33% - 42% 1.00x ONLINE - tank 61.5G 20.0G 41.5G 48% - 32% 1.00x ONLINE - zion - - - - - - - FAULTED - EExxaammppllee 77 Destroying a ZFS Storage Pool The following command destroys the pool _t_a_n_k and any datasets contained within. # zpool destroy -f tank EExxaammppllee 88 Exporting a ZFS Storage Pool The following command exports the devices in pool _t_a_n_k so that they can be relocated or later imported. # zpool export tank EExxaammppllee 99 Importing a ZFS Storage Pool The following command displays available pools, and then imports the pool _t_a_n_k for use on the system. The results from this command are similar to the following: # zpool import pool: tank id: 15451357997522795478 state: ONLINE action: The pool can be imported using its name or numeric identifier. config: tank ONLINE mirror ONLINE c1t2d0 ONLINE c1t3d0 ONLINE # zpool import tank EExxaammppllee 1100 Upgrading All ZFS Storage Pools to the Current Version The following command upgrades all ZFS Storage pools to the current version of the software. # zpool upgrade -a This system is currently running ZFS version 2. EExxaammppllee 1111 Managing Hot Spares The following command creates a new pool with an available hot spare: # zpool create tank mirror c0t0d0 c0t1d0 spare c0t2d0 If one of the disks were to fail, the pool would be reduced to the degraded state. The failed device can be replaced using the following command: # zpool replace tank c0t0d0 c0t3d0 Once the data has been resilvered, the spare is automatically removed and is made available should another device fails. The hot spare can be permanently removed from the pool using the following command: # zpool remove tank c0t2d0 EExxaammppllee 1122 Creating a ZFS Pool with Mirrored Separate Intent Logs The following command creates a ZFS storage pool consisting of two, two-way mirrors and mirrored log devices: # zpool create pool mirror c0d0 c1d0 mirror c2d0 c3d0 log mirror \ c4d0 c5d0 EExxaammppllee 1133 Adding Cache Devices to a ZFS Pool The following command adds two disks for use as cache devices to a ZFS storage pool: # zpool add pool cache c2d0 c3d0 Once added, the cache devices gradually fill with content from main memory. Depending on the size of your cache devices, it could take over an hour for them to fill. Capacity and reads can be monitored using the iioossttaatt option as follows: # zpool iostat -v pool 5 EExxaammppllee 1144 Removing a Mirrored Log Device The following command removes the mirrored log device mmiirrrroorr--22. Given this configuration: pool: tank state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM tank ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c6t0d0 ONLINE 0 0 0 c6t1d0 ONLINE 0 0 0 mirror-1 ONLINE 0 0 0 c6t2d0 ONLINE 0 0 0 c6t3d0 ONLINE 0 0 0 logs mirror-2 ONLINE 0 0 0 c4t0d0 ONLINE 0 0 0 c4t1d0 ONLINE 0 0 0 The command to remove the mirrored log mmiirrrroorr--22 is: # zpool remove tank mirror-2 EExxaammppllee 1155 Displaying expanded space on a device The following command dipslays the detailed information for the pool _d_a_t_a. This pool is comprised of a single raidz vdev where one of its devices increased its capacity by 10GB. In this example, the pool will not be able to utilize this extra capacity until all the devices under the raidz vdev have been expanded. # zpool list -v data NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT data 23.9G 14.6G 9.30G 48% - 61% 1.00x ONLINE - raidz1 23.9G 14.6G 9.30G 48% - c1t1d0 - - - - - c1t2d0 - - - - 10G c1t3d0 - - - - - IINNTTEERRFFAACCEE SSTTAABBIILLIITTYY EEvvoollvviinngg SSEEEE AALLSSOO zfs(1M), attributes(5), zpool-features(5) illumos March 25, 2016 illumos