xref: /freebsd/sys/contrib/openzfs/man/man8/zpool-add.8 (revision 783d3ff6d7fae619db8a7990b8a6387de0c677b5)
1eda14cbcSMatt Macy.\" CDDL HEADER START
2eda14cbcSMatt Macy.\"
3eda14cbcSMatt Macy.\" The contents of this file are subject to the terms of the
4eda14cbcSMatt Macy.\" Common Development and Distribution License (the "License").
5eda14cbcSMatt Macy.\" You may not use this file except in compliance with the License.
6eda14cbcSMatt Macy.\"
7eda14cbcSMatt Macy.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8271171e0SMartin Matuska.\" or https://opensource.org/licenses/CDDL-1.0.
9eda14cbcSMatt Macy.\" See the License for the specific language governing permissions
10eda14cbcSMatt Macy.\" and limitations under the License.
11eda14cbcSMatt Macy.\"
12eda14cbcSMatt Macy.\" When distributing Covered Code, include this CDDL HEADER in each
13eda14cbcSMatt Macy.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14eda14cbcSMatt Macy.\" If applicable, add the following below this CDDL HEADER, with the
15eda14cbcSMatt Macy.\" fields enclosed by brackets "[]" replaced with your own identifying
16eda14cbcSMatt Macy.\" information: Portions Copyright [yyyy] [name of copyright owner]
17eda14cbcSMatt Macy.\"
18eda14cbcSMatt Macy.\" CDDL HEADER END
19eda14cbcSMatt Macy.\"
20eda14cbcSMatt Macy.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
21eda14cbcSMatt Macy.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
22eda14cbcSMatt Macy.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
23eda14cbcSMatt Macy.\" Copyright (c) 2017 Datto Inc.
24eda14cbcSMatt Macy.\" Copyright (c) 2018 George Melikov. All Rights Reserved.
25eda14cbcSMatt Macy.\" Copyright 2017 Nexenta Systems, Inc.
26eda14cbcSMatt Macy.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
27*783d3ff6SMartin Matuska.\" Copyright (c) 2024 by Delphix. All Rights Reserved.
28eda14cbcSMatt Macy.\"
29*783d3ff6SMartin Matuska.Dd March 8, 2024
30eda14cbcSMatt Macy.Dt ZPOOL-ADD 8
31eda14cbcSMatt Macy.Os
3216038816SMartin Matuska.
33eda14cbcSMatt Macy.Sh NAME
347877fdebSMatt Macy.Nm zpool-add
3516038816SMartin Matuska.Nd add vdevs to ZFS storage pool
36eda14cbcSMatt Macy.Sh SYNOPSIS
377877fdebSMatt Macy.Nm zpool
38eda14cbcSMatt Macy.Cm add
39eda14cbcSMatt Macy.Op Fl fgLnP
40*783d3ff6SMartin Matuska.Op Fl -allow-in-use -allow-replication-mismatch -allow-ashift-mismatch
41eda14cbcSMatt Macy.Oo Fl o Ar property Ns = Ns Ar value Oc
4216038816SMartin Matuska.Ar pool vdev Ns …
4316038816SMartin Matuska.
44eda14cbcSMatt Macy.Sh DESCRIPTION
45eda14cbcSMatt MacyAdds the specified virtual devices to the given pool.
46eda14cbcSMatt MacyThe
47eda14cbcSMatt Macy.Ar vdev
48eda14cbcSMatt Macyspecification is described in the
49eda14cbcSMatt Macy.Em Virtual Devices
50eda14cbcSMatt Macysection of
513ff01b23SMartin Matuska.Xr zpoolconcepts 7 .
52eda14cbcSMatt MacyThe behavior of the
53eda14cbcSMatt Macy.Fl f
54eda14cbcSMatt Macyoption, and the device checks performed are described in the
55eda14cbcSMatt Macy.Nm zpool Cm create
56eda14cbcSMatt Macysubcommand.
57eda14cbcSMatt Macy.Bl -tag -width Ds
58eda14cbcSMatt Macy.It Fl f
59eda14cbcSMatt MacyForces use of
60eda14cbcSMatt Macy.Ar vdev Ns s ,
61*783d3ff6SMartin Matuskaeven if they appear in use, have conflicting ashift values, or specify
62*783d3ff6SMartin Matuskaa conflicting replication level.
63eda14cbcSMatt MacyNot all devices can be overridden in this manner.
64eda14cbcSMatt Macy.It Fl g
65eda14cbcSMatt MacyDisplay
66eda14cbcSMatt Macy.Ar vdev ,
6716038816SMartin MatuskaGUIDs instead of the normal device names.
6816038816SMartin MatuskaThese GUIDs can be used in place of
69eda14cbcSMatt Macydevice names for the zpool detach/offline/remove/replace commands.
70eda14cbcSMatt Macy.It Fl L
71eda14cbcSMatt MacyDisplay real paths for
72eda14cbcSMatt Macy.Ar vdev Ns s
7316038816SMartin Matuskaresolving all symbolic links.
7416038816SMartin MatuskaThis can be used to look up the current block
7516038816SMartin Matuskadevice name regardless of the
7616038816SMartin Matuska.Pa /dev/disk
7716038816SMartin Matuskapath used to open it.
78eda14cbcSMatt Macy.It Fl n
79eda14cbcSMatt MacyDisplays the configuration that would be used without actually adding the
80eda14cbcSMatt Macy.Ar vdev Ns s .
81eda14cbcSMatt MacyThe actual pool creation can still fail due to insufficient privileges or
82eda14cbcSMatt Macydevice sharing.
83eda14cbcSMatt Macy.It Fl P
84eda14cbcSMatt MacyDisplay real paths for
85eda14cbcSMatt Macy.Ar vdev Ns s
8616038816SMartin Matuskainstead of only the last component of the path.
8716038816SMartin MatuskaThis can be used in conjunction with the
88eda14cbcSMatt Macy.Fl L
89eda14cbcSMatt Macyflag.
90eda14cbcSMatt Macy.It Fl o Ar property Ns = Ns Ar value
9116038816SMartin MatuskaSets the given pool properties.
9216038816SMartin MatuskaSee the
933ff01b23SMartin Matuska.Xr zpoolprops 7
9416038816SMartin Matuskamanual page for a list of valid properties that can be set.
9516038816SMartin MatuskaThe only property supported at the moment is
9616038816SMartin Matuska.Sy ashift .
97*783d3ff6SMartin Matuska.It Fl -allow-ashift-mismatch
98*783d3ff6SMartin MatuskaDisable the ashift validation which allows mismatched ashift values in the
99*783d3ff6SMartin Matuskapool.
100*783d3ff6SMartin MatuskaAdding top-level
101*783d3ff6SMartin Matuska.Ar vdev Ns s
102*783d3ff6SMartin Matuskawith different sector sizes will prohibit future device removal operations, see
103*783d3ff6SMartin Matuska.Xr zpool-remove 8 .
104*783d3ff6SMartin Matuska.It Fl -allow-in-use
105*783d3ff6SMartin MatuskaAllow vdevs to be added even if they might be in use in another pool.
106*783d3ff6SMartin Matuska.It Fl -allow-replication-mismatch
107*783d3ff6SMartin MatuskaAllow vdevs with conflicting replication levels to be added to the pool.
108eda14cbcSMatt Macy.El
10916038816SMartin Matuska.
110da5137abSMartin Matuska.Sh EXAMPLES
111da5137abSMartin Matuska.\" These are, respectively, examples 5, 13 from zpool.8
112da5137abSMartin Matuska.\" Make sure to update them bidirectionally
113da5137abSMartin Matuska.Ss Example 1 : No Adding a Mirror to a ZFS Storage Pool
114da5137abSMartin MatuskaThe following command adds two mirrored disks to the pool
115da5137abSMartin Matuska.Ar tank ,
116da5137abSMartin Matuskaassuming the pool is already made up of two-way mirrors.
117da5137abSMartin MatuskaThe additional space is immediately available to any datasets within the pool.
118da5137abSMartin Matuska.Dl # Nm zpool Cm add Ar tank Sy mirror Pa sda sdb
119da5137abSMartin Matuska.
120da5137abSMartin Matuska.Ss Example 2 : No Adding Cache Devices to a ZFS Pool
121da5137abSMartin MatuskaThe following command adds two disks for use as cache devices to a ZFS storage
122da5137abSMartin Matuskapool:
123da5137abSMartin Matuska.Dl # Nm zpool Cm add Ar pool Sy cache Pa sdc sdd
124da5137abSMartin Matuska.Pp
125da5137abSMartin MatuskaOnce added, the cache devices gradually fill with content from main memory.
126da5137abSMartin MatuskaDepending on the size of your cache devices, it could take over an hour for
127da5137abSMartin Matuskathem to fill.
128da5137abSMartin MatuskaCapacity and reads can be monitored using the
129da5137abSMartin Matuska.Cm iostat
130da5137abSMartin Matuskasubcommand as follows:
131da5137abSMartin Matuska.Dl # Nm zpool Cm iostat Fl v Ar pool 5
132da5137abSMartin Matuska.
133eda14cbcSMatt Macy.Sh SEE ALSO
134eda14cbcSMatt Macy.Xr zpool-attach 8 ,
135eda14cbcSMatt Macy.Xr zpool-import 8 ,
136eda14cbcSMatt Macy.Xr zpool-initialize 8 ,
13716038816SMartin Matuska.Xr zpool-online 8 ,
13816038816SMartin Matuska.Xr zpool-remove 8
139