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