4
.\" The contents of this file are subject to the terms of the
5
.\" Common Development and Distribution License (the "License").
6
.\" You may not use this file except in compliance with the License.
8
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9
.\" or http://www.opensolaris.org/os/licensing.
10
.\" See the License for the specific language governing permissions
11
.\" and limitations under the License.
13
.\" When distributing Covered Code, include this CDDL HEADER in each
14
.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15
.\" If applicable, add the following below this CDDL HEADER, with the
16
.\" fields enclosed by brackets "[]" replaced with your own identifying
17
.\" information: Portions Copyright [yyyy] [name of copyright owner]
20
.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
21
.TH zpool 1M "14 Nov 2006" "SunOS 5.11" "System Administration Commands"
23
zpool \- configures ZFS storage pools
27
\fBzpool\fR [\fB-?\fR]
32
\fBzpool create\fR [\fB-fn\fR] [\fB-R\fR \fIroot\fR] [\fB-m\fR \fImountpoint\fR] \fIpool\fR \fIvdev ...\fR
37
\fBzpool destroy\fR [\fB-f\fR] \fIpool\fR
42
\fBzpool add\fR [\fB-fn\fR] \fIpool\fR \fIvdev\fR
47
\fBzpool remove\fR \fIpool\fR \fIvdev\fR
52
\fBzpool \fR \fBlist\fR [\fB-H\fR] [\fB-o\fR \fIfield\fR[,\fIfield\fR]*] [\fIpool\fR] ...
57
\fBzpool iostat\fR [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR [\fIcount\fR]]
62
\fBzpool status\fR [\fB-xv\fR] [\fIpool\fR] ...
67
\fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...
72
\fBzpool online\fR \fIpool\fR \fIdevice\fR ...
77
\fBzpool clear\fR \fIpool\fR [\fIdevice\fR] ...
82
\fBzpool attach\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR
87
\fBzpool detach\fR \fIpool\fR \fIdevice\fR
92
\fBzpool replace\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR [\fInew_device\fR]
97
\fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...
102
\fBzpool export\fR [\fB-f\fR] \fIpool\fR
107
\fBzpool import\fR [\fB-d\fR \fIdir\fR] [\fB-D\fR]
112
\fBzpool import\fR [\fB-d\fR \fIdir\fR] [\fB-D\fR] [\fB-f\fR] [\fB-o \fIopts\fR\fR] [\fB-R \fR\fIroot\fR] \fIpool\fR | \fIid\fR
118
\fBzpool import\fR [\fB-d\fR \fIdir\fR] [\fB-D\fR] [\fB-f\fR] [\fB-a\fR]
128
\fBzpool upgrade\fR \fB-v\fR
133
\fBzpool upgrade\fR [\fB-a\fR | \fIpool\fR]
138
\fBzpool history\fR [\fIpool\fR] ...
143
The \fBzpool\fR command configures \fBZFS\fR storage pools. A storage pool is a collection of devices that provides physical storage and data replication for \fBZFS\fR datasets.
145
All datasets within a storage pool share the same space. See \fBzfs\fR(1M) for information on managing datasets.
146
.SS "Virtual Devices (vdevs)"
148
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:
157
A block device, typically located under "/dev/dsk". \fBZFS\fR 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
158
of the path under "/dev/dsk"). A whole disk can be specified by omitting the slice or partition designation. For example, "c0t0d0" is equivalent to "/dev/dsk/c0t0d0s2". When given a whole disk, \fBZFS\fR automatically labels the disk, if necessary.
169
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.
180
A mirror of two or more devices. Data is replicated in an identical fashion across all components of a mirror. A mirror with \fIN\fR disks of size \fIX\fR can hold \fIX\fR bytes and can withstand (\fIN-1\fR)
181
devices failing before data integrity is compromised.
200
A variation on \fBRAID-5\fR that allows for better distribution of parity and eliminates the "\fBRAID-5\fR write hole" (in which data and parity become inconsistent after a power loss). Data and parity is striped across all disks within a \fBraidz\fR group.
202
A \fBraidz\fR group can have either single- or double-parity, meaning that the \fBraidz\fR group can sustain one or two failures respectively without losing any data. The \fBraidz1\fR \fBvdev\fR type specifies a single-parity \fBraidz\fR group
203
and the \fBraidz2\fR \fBvdev\fR type specifies a double-parity \fBraidz\fR group. The \fBraidz\fR \fBvdev\fR type is an alias for \fBraidz1\fR.
205
A \fBraidz\fR group with \fIN\fR disks of size \fIX\fR with \fIP\fR parity disks can hold approximately (\fIN-P\fR)*\fIX\fR bytes and can withstand one device failing before
206
data integrity is compromised. The minimum number of devices in a \fBraidz\fR group is one more than the number of parity disks. The recommended number is between 3 and 9.
217
A special pseudo-\fBvdev\fR which keeps track of available hot spares for a pool. For more information, see the "Hot Spares" section.
221
Virtual devices cannot be nested, so a mirror or \fBraidz\fR virtual device can only contain files or disks. Mirrors of mirrors (or other combinations) are not allowed.
223
A pool can have any number of virtual devices at the top of the configuration (known as "root vdevs"). Data is dynamically distributed across all top-level devices to balance data among devices. As new virtual devices are added, \fBZFS\fR automatically places data
224
on the newly available devices.
226
Virtual devices are specified one at a time on the command line, separated by whitespace. The keywords "mirror" and "raidz" are used to distinguish where a group ends and another begins. For example, the following creates two root vdevs, each a mirror of two disks:
230
\fB# zpool create mypool mirror c0t0d0 c0t1d0 mirror c1t0d0 c1t1d0\fR
235
.SS "Device Failure and Recovery"
237
\fBZFS\fR supports a rich set of mechanisms for handling device failure and data corruption. All metadata and data is checksummed, and \fBZFS\fR automatically repairs bad data from a good copy when corruption is detected.
239
In order to take advantage of these features, a pool must make use of some form of redundancy, using either mirrored or \fBraidz\fR groups. While \fBZFS\fR supports running in a non-redundant configuration, where each root vdev is simply a disk or file, this is
240
strongly discouraged. A single case of bit corruption can render some or all of your data unavailable.
242
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
243
one or more failed devices, and there is insufficient redundancy to replicate the missing data.
246
\fBZFS\fR allows devices to be associated with pools as "hot spares". These devices are not actively used in the pool, but when an active device fails, it is automatically replaced by a hot spare. To create a pool with hot spares, specify a "spare" \fBvdev\fR with any number of devices. For example,
250
# zpool create pool mirror c0d0 c1d0 spare c2d0 c3d0
256
Spares can be shared across multiple pools, and can be added with the "zpool add" command and removed with the "zpool remove" command. Once a spare replacement is initiated, a new "spare" \fBvdev\fR is created within the configuration that
257
will remain there until the original device is replaced. At this point, the hot spare becomes available again if another device fails.
259
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.
260
.SS "Alternate Root Pools"
262
The "zpool create -R" and "zpool import -R" commands allow users to create and import a pool with a different root path. By default, whenever a pool is created or imported on a system, it is permanently added so that it is available whenever the system boots. For
263
removable media, or when in recovery situations, this may not always be desirable. An alternate root pool does not persist on the system. Instead, it exists only until exported or the system is rebooted, at which point it will have to be imported again.
265
In addition, all mount points in the pool are prefixed with the given root, so a pool can be constrained to a particular area of the file system. This is most useful when importing unknown pools from removable media, as the mount points of any file systems cannot be trusted.
267
When creating an alternate root pool, the default mount point is "/", rather than the normal default "/\fIpool\fR".
270
All subcommands that modify state are logged persistently to the pool in their original form.
272
The \fBzpool\fR command provides subcommands to create and destroy storage pools, add capacity to storage pools, and provide information about the storage pools. The following subcommands are supported:
277
\fB\fBzpool\fR \fB-?\fR\fR
281
Displays a help message.
288
\fB\fBzpool create\fR [\fB-fn\fR] [\fB-R\fR \fIroot\fR] [\fB-m\fR \fImountpoint\fR] \fIpool\fR \fIvdev ...\fR\fR
292
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
293
names "mirror", "raidz", and "spare" are reserved, as are names beginning with the pattern "c[0-9]". The \fBvdev\fR specification is described in the "Virtual Devices" section.
295
The command verifies that each device specified is accessible and not currently in use by another subsystem. There are some uses, such as being currently mounted, or specified as the dedicated dump device, that prevents a device from ever being used by \fBZFS\fR. Other uses,
296
such as having a preexisting \fBUFS\fR file system, can be overridden with the \fB-f\fR option.
298
The command also checks that the replication strategy for the pool is consistent. An attempt to combine redundant and non-redundant storage in a single pool, or to mix disks and files, results in an error unless \fB-f\fR is specified. The use of differently sized devices within
299
a single \fBraidz\fR or mirror group is also flagged as an error unless \fB-f\fR is specified.
301
Unless the \fB-R\fR option is specified, the default mount point is "/\fIpool\fR". The mount point must not exist or must be empty, or else the root dataset cannot be mounted. This can be overridden with the \fB-m\fR option.
310
Forces use of \fBvdev\fRs, even if they appear in use or specify a conflicting replication level. Not all devices can be overridden in this manner.
321
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.
328
\fB\fB-R\fR \fIroot\fR\fR
332
Creates the pool with an alternate \fIroot\fR. See the "Alternate Root Pools" section. The root dataset has its mount point set to "/" as part of this operation.
339
\fB\fB-m\fR \fImountpoint\fR\fR
343
Sets the mount point for the root dataset. The default mount point is "/\fIpool\fR". The mount point must be an absolute path, "\fBlegacy\fR", or "\fBnone\fR". For more information on dataset mount
344
points, see \fBzfs\fR(1M).
353
\fB\fBzpool destroy\fR [\fB-f\fR] \fIpool\fR\fR
357
Destroys the given pool, freeing up any devices for other use. This command tries to unmount any active datasets before destroying the pool.
366
Forces any active datasets contained within the pool to be unmounted.
375
\fB\fBzpool add\fR [\fB-fn\fR] \fIpool\fR \fIvdev ...\fR\fR
379
Adds the specified virtual devices to the given pool. The \fIvdev\fR specification is described in the "Virtual Devices" section. The behavior of the \fB-f\fR option, and the device checks performed are described in the "zpool create"
389
Forces use of \fBvdev\fRs, even if they appear in use or specify a conflicting replication level. Not all devices can be overridden in this manner.
400
Displays the configuration that would be used without actually adding the \fBvdev\fRs. The actual pool creation can still fail due to insufficient privileges or device sharing.
403
Do not add a disk that is currently configured as a quorum device to a zpool. Once a disk is in a zpool, that disk can then be configured as a quorum device.
410
\fB\fBzpool remove\fR \fIpool\fR \fIvdev\fR\fR
414
Removes the given \fBvdev\fR from the pool. This command currently only supports removing hot spares. Devices which are part of a mirror can be removed using the "zpool detach" command. \fBRaidz\fR and top-level \fBvdevs\fR cannot
415
be removed from a pool.
422
\fB\fBzpool list\fR [\fB-H\fR] [\fB-o\fR \fIfield\fR[,\fIfield*\fR]] [\fIpool\fR] ...\fR
426
Lists the given pools along with a health status and space usage. When given no arguments, all pools in the system are listed.
435
Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
442
\fB\fB-o\fR \fIfield\fR\fR
446
Comma-separated list of fields to display. Each field must be one of:
452
used Amount of space used
453
available Amount of space available
454
capacity Percentage of pool space used
460
The default is all fields.
463
This command reports actual physical space available to the storage pool. The physical space can be different from the total amount of space that any contained datasets can actually use. The amount of space used in a \fBraidz\fR configuration depends on the characteristics of
464
the data being written. In addition, \fBZFS\fR reserves some space for internal accounting that the \fBzfs\fR(1M) command takes into account, but the \fBzpool\fR command does not. For non-full pools of a reasonable size, these effects should be invisible. For small pools, or pools that are close to being completely full, these discrepancies may become more noticeable.
471
\fB\fBzpool iostat\fR [\fB-v\fR] [\fIpool\fR] ... [\fIinterval\fR [\fIcount\fR]]\fR
475
Displays \fBI/O\fR statistics for the given pools. When given an interval, the statistics are printed every \fIinterval\fR seconds until \fBCtrl-C\fR is pressed. If no \fIpools\fR are specified, statistics for
476
every pool in the system is shown. If \fIcount\fR is specified, the command exits after \fIcount\fR reports are printed.
485
Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wide statistics.
494
\fB\fBzpool status\fR [\fB-xv\fR] [\fIpool\fR] ...\fR
498
Displays the detailed health status for the given pools. If no \fIpool\fR is specified, then the status of each pool in the system is displayed.
500
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.
509
Only display status for pools that are exhibiting errors or are otherwise unavailable.
520
Displays verbose data error information, printing out a complete list of all data errors since the last complete pool scrub.
529
\fB\fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...\fR
533
Takes the specified physical device offline. While the \fIdevice\fR is offline, no attempt is made to read or write to the device.
535
This command is not applicable to spares.
544
Temporary. Upon reboot, the specified physical device reverts to its previous state.
553
\fB\fBzpool online\fR \fIpool\fR \fIdevice\fR ...\fR
557
Brings the specified physical device online.
559
This command is not applicable to spares.
566
\fB\fBzpool clear\fR \fIpool\fR [\fIdevice\fR] ...\fR
570
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.
577
\fB\fBzpool attach\fR [\fB-f\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR\fR
581
Attaches \fInew_device\fR to an existing \fBzpool\fR device. The existing device cannot be part of a \fBraidz\fR configuration. If \fIdevice\fR is not currently part of a mirrored configuration, \fIdevice\fR automatically
582
transforms into a two-way mirror of \fIdevice\fR and \fInew_device\fR. If \fIdevice\fR is part of a two-way mirror, attaching \fInew_device\fR creates a three-way mirror, and so on. In either case, \fInew_device\fR begins to resilver immediately.
591
Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
600
\fB\fBzpool detach\fR \fIpool\fR \fIdevice\fR\fR
604
Detaches \fIdevice\fR from a mirror. The operation is refused if there are no other valid replicas of the data.
611
\fB\fBzpool replace\fR [\fB-f\fR] \fIpool\fR \fIold_device\fR [\fInew_device\fR]\fR
615
Replaces \fIold_device\fR with \fInew_device\fR. This is equivalent to attaching \fInew_device\fR, waiting for it to resilver, and then detaching \fIold_device\fR.
617
The size of \fInew_device\fR must be greater than or equal to the minimum size of all the devices in a mirror or \fBraidz\fR configuration.
619
If \fInew_device\fR is not specified, it defaults to \fIold_device\fR. This form of replacement is useful after an existing disk has failed and has been physically replaced. In this case, the new disk may have the same \fB/dev/dsk\fR path
620
as the old device, even though it is actually a different disk. \fBZFS\fR recognizes this.
629
Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
638
\fB\fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...\fR
642
Begins a scrub. The scrub examines all data in the specified pools to verify that it checksums correctly. For replicated (mirror or \fBraidz\fR) devices, \fBZFS\fR automatically repairs any damage discovered during the scrub. The "\fBzpool
643
status\fR" command reports the progress of the scrub and summarizes the results of the scrub upon completion.
645
Scrubbing and resilvering are very similar operations. The difference is that resilvering only examines data that \fBZFS\fR knows to be out of date (for example, when attaching a new device to a mirror or replacing an existing device), whereas scrubbing examines all data to
646
discover silent errors due to hardware faults or disk failure.
648
Because scrubbing and resilvering are \fBI/O\fR-intensive operations, \fBZFS\fR only allows one at a time. If a scrub is already in progress, the "\fBzpool scrub\fR" command terminates it and starts a new scrub. If a resilver is in progress, \fBZFS\fR does not allow a scrub to be started until the resilver completes.
666
\fB\fBzpool export\fR [\fB-f\fR] \fIpool\fR ...\fR
670
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.
672
Before exporting the pool, all datasets within the pool are unmounted.
674
For pools to be portable, you must give the \fBzpool\fR command whole disks, not just slices, so that \fBZFS\fR can label the disks with portable \fBEFI\fR labels. Otherwise, disk drivers on platforms of different endianness will not recognize the disks.
683
Forcefully unmount all datasets, using the "\fBunmount -f\fR" command.
692
\fB\fBzpool import\fR [\fB-d\fR \fIdir\fR] [\fB-D\fR]\fR
696
Lists pools available to import. If the \fB-d\fR option is not specified, this command searches for devices in "/dev/dsk". The \fB-d\fR option can be specified multiple times, and all directories are searched. If the device appears to be part of
697
an exported pool, this command displays a summary of the pool with the name of the pool, a numeric identifier, as well as the \fIvdev\fR layout and current health of the device for each device or file. Destroyed pools, pools that were previously destroyed with the "\fB-zpool destroy\fR" command, are not listed unless the \fB-D\fR option is specified.
699
The numeric identifier is unique, and can be used instead of the pool name when multiple exported pools of the same name are available.
704
\fB\fB-d\fR \fIdir\fR\fR
708
Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times.
719
Lists destroyed pools only.
728
\fB\fBzpool import\fR [\fB-d\fR \fIdir\fR] [\fB-D\fR] [\fB-f\fR] [\fB-o\fR \fIopts\fR] [\fB-R\fR \fIroot\fR] \fIpool\fR | \fIid\fR [\fInewpool\fR]\fR
732
Imports a specific pool. A pool can be identified by its name or the numeric identifier. If \fInewpool\fR is specified, the pool is imported using the name \fInewpool\fR. Otherwise, it is imported with the same name as its exported name.
734
If a device is removed from a system without running "\fBzpool export\fR" first, the device appears as potentially active. It cannot be determined if this was a failed export, or whether the device is really in use from another host. To import a pool in this state,
735
the \fB-f\fR option is required.
740
\fB\fB-d\fR \fIdir\fR\fR
744
Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times.
755
Imports destroyed pool. The \fB-f\fR option is also required.
766
Forces import, even if the pool appears to be potentially active.
773
\fB\fB-o\fR \fIopts\fR\fR
777
Comma-separated list of mount options to use when mounting datasets within the pool. See \fBzfs\fR(1M) for a description of dataset properties and mount
785
\fB\fB-R\fR \fIroot\fR\fR
789
Imports pool(s) with an alternate \fIroot\fR. See the "Alternate Root Pools" section.
798
\fB\fBzpool import\fR [\fB-d\fR \fIdir\fR] [\fB-D\fR] [\fB-f\fR] [\fB-a\fR]\fR
802
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 "\fB-zpool destroy\fR" command,
803
will not be imported unless the \fB-D\fR option is specified.
808
\fB\fB-d\fR \fIdir\fR\fR
812
Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times.
823
Imports destroyed pools only. The \fB-f\fR option is also required.
834
Forces import, even if the pool appears to be potentially active.
843
\fB\fBzpool upgrade\fR\fR
847
Displays all pools formatted using a different \fBZFS\fR on-disk version. Older versions can continue to be used, but some features may not be available. These pools can be upgraded using "\fBzpool upgrade -a\fR". Pools that are formatted with
848
a more recent version are also displayed, although these pools will be inaccessible on the system.
855
\fB\fBzpool upgrade\fR \fB-v\fR\fR
859
Displays \fBZFS\fR versions supported by the current software. The current \fBZFS\fR versions and all previous supportedversions are displayed, along with an explanation of the features provided with each version.
866
\fB\fBzpool upgrade\fR [\fB-a\fR | \fIpool\fR]\fR
870
Upgrades the given pool to the latest on-disk version. Once this is done, the pool will no longer be accessible on systems running older versions of the software.
888
\fB\fBzpool history\fR [\fIpool\fR] ...\fR
892
Displays the command history of the specified pools (or all pools if no pool is specified).
897
\fBExample 1 \fRCreating a RAID-Z Storage Pool
899
The following command creates a pool with a single \fBraidz\fR root \fIvdev\fR that consists of six disks.
904
\fB# zpool create tank raidz c0t0d0 c0t1d0 c0t2d0 c0t3d0 c0t4d0 c0t5d0\fR
910
\fBExample 2 \fRCreating a Mirrored Storage Pool
912
The following command creates a pool with two mirrors, where each mirror contains two disks.
917
\fB# zpool create tank mirror c0t0d0 c0t1d0 mirror c0t2d0 c0t3d0\fR
923
\fBExample 3 \fRCreating a ZFS Storage Pool by Using Slices
925
The following command creates an unmirrored pool using two disk slices.
930
\fB# zpool create tank /dev/dsk/c0t0d0s1 c0t1d0s4\fR
936
\fBExample 4 \fRCreating a ZFS Storage Pool by Using Files
938
The following command creates an unmirrored pool using files. While not recommended, a pool based on files can be useful for experimental purposes.
943
\fB# zpool create tank /path/to/file/a /path/to/file/b\fR
949
\fBExample 5 \fRAdding a Mirror to a ZFS Storage Pool
951
The following command adds two mirrored disks to the pool "\fItank\fR", assuming the pool is already made up of two-way mirrors. The additional space is immediately available to any datasets within the pool.
956
\fB# zpool add tank mirror c1t0d0 c1t1d0\fR
962
\fBExample 6 \fRListing Available ZFS Storage Pools
964
The following command lists all available pools on the system. In this case, the pool \fIzion\fR is faulted due to a missing device.
967
The results from this command are similar to the following:
973
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
974
pool 67.5G 2.92M 67.5G 0% ONLINE -
975
tank 67.5G 2.92M 67.5G 0% ONLINE -
976
zion - - - 0% FAULTED -
982
\fBExample 7 \fRDestroying a ZFS Storage Pool
984
The following command destroys the pool "\fItank\fR" and any datasets contained within.
989
\fB# zpool destroy -f tank\fR
995
\fBExample 8 \fRExporting a ZFS Storage Pool
997
The following command exports the devices in pool \fItank\fR so that they can be relocated or later imported.
1002
\fB# zpool export tank\fR
1008
\fBExample 9 \fRImporting a ZFS Storage Pool
1010
The following command displays available pools, and then imports the pool "tank" for use on the system.
1013
The results from this command are similar to the following:
1018
\fB# zpool import\fR
1020
id: 15451357997522795478
1022
action: The pool can be imported using its name or numeric identifier.
1030
\fB# zpool import tank\fR
1036
\fBExample 10 \fRUpgrading All ZFS Storage Pools to the Current Version
1038
The following command upgrades all ZFS Storage pools to the current version of the software.
1043
\fB# zpool upgrade -a\fR
1044
This system is currently running ZFS version 2.
1050
\fBExample 11 \fRManaging Hot Spares
1052
The following command creates a new pool with an available hot spare:
1057
\fB# zpool create tank mirror c0t0d0 c0t1d0 spare c0t2d0\fR
1063
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:
1068
\fB# zpool replace tank c0t0d0 c0t3d0\fR
1074
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:
1079
\fB# zpool remove tank c0t2d0\fR
1086
The following exit values are returned:
1095
Successful completion.
1117
Invalid command line options were specified.
1122
See \fBattributes\fR(5) for descriptions of the following attributes:
1128
cw(2.75i) |cw(2.75i)
1129
lw(2.75i) |lw(2.75i)
1131
ATTRIBUTE TYPEATTRIBUTE VALUE
1133
AvailabilitySUNWzfsu
1135
Interface StabilityEvolving
1140
\fBzfs\fR(1M), \fBattributes\fR(5)