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