xref: /freebsd/sys/contrib/openzfs/man/man8/zpool-add.8 (revision a90b9d0159070121c221b966469c3e36d912bf82)
1.\" CDDL HEADER START
2.\"
3.\" The contents of this file are subject to the terms of the
4.\" Common Development and Distribution License (the "License").
5.\" You may not use this file except in compliance with the License.
6.\"
7.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8.\" or https://opensource.org/licenses/CDDL-1.0.
9.\" See the License for the specific language governing permissions
10.\" and limitations under the License.
11.\"
12.\" When distributing Covered Code, include this CDDL HEADER in each
13.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14.\" If applicable, add the following below this CDDL HEADER, with the
15.\" fields enclosed by brackets "[]" replaced with your own identifying
16.\" information: Portions Copyright [yyyy] [name of copyright owner]
17.\"
18.\" CDDL HEADER END
19.\"
20.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
21.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
22.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
23.\" Copyright (c) 2017 Datto Inc.
24.\" Copyright (c) 2018 George Melikov. All Rights Reserved.
25.\" Copyright 2017 Nexenta Systems, Inc.
26.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
27.\" Copyright (c) 2024 by Delphix. All Rights Reserved.
28.\"
29.Dd March 8, 2024
30.Dt ZPOOL-ADD 8
31.Os
32.
33.Sh NAME
34.Nm zpool-add
35.Nd add vdevs to ZFS storage pool
36.Sh SYNOPSIS
37.Nm zpool
38.Cm add
39.Op Fl fgLnP
40.Op Fl -allow-in-use -allow-replication-mismatch -allow-ashift-mismatch
41.Oo Fl o Ar property Ns = Ns Ar value Oc
42.Ar pool vdev Ns …
43.
44.Sh DESCRIPTION
45Adds the specified virtual devices to the given pool.
46The
47.Ar vdev
48specification is described in the
49.Em Virtual Devices
50section of
51.Xr zpoolconcepts 7 .
52The behavior of the
53.Fl f
54option, and the device checks performed are described in the
55.Nm zpool Cm create
56subcommand.
57.Bl -tag -width Ds
58.It Fl f
59Forces use of
60.Ar vdev Ns s ,
61even if they appear in use, have conflicting ashift values, or specify
62a conflicting replication level.
63Not all devices can be overridden in this manner.
64.It Fl g
65Display
66.Ar vdev ,
67GUIDs instead of the normal device names.
68These GUIDs can be used in place of
69device names for the zpool detach/offline/remove/replace commands.
70.It Fl L
71Display real paths for
72.Ar vdev Ns s
73resolving all symbolic links.
74This can be used to look up the current block
75device name regardless of the
76.Pa /dev/disk
77path used to open it.
78.It Fl n
79Displays the configuration that would be used without actually adding the
80.Ar vdev Ns s .
81The actual pool creation can still fail due to insufficient privileges or
82device sharing.
83.It Fl P
84Display real paths for
85.Ar vdev Ns s
86instead of only the last component of the path.
87This can be used in conjunction with the
88.Fl L
89flag.
90.It Fl o Ar property Ns = Ns Ar value
91Sets the given pool properties.
92See the
93.Xr zpoolprops 7
94manual page for a list of valid properties that can be set.
95The only property supported at the moment is
96.Sy ashift .
97.It Fl -allow-ashift-mismatch
98Disable the ashift validation which allows mismatched ashift values in the
99pool.
100Adding top-level
101.Ar vdev Ns s
102with different sector sizes will prohibit future device removal operations, see
103.Xr zpool-remove 8 .
104.It Fl -allow-in-use
105Allow vdevs to be added even if they might be in use in another pool.
106.It Fl -allow-replication-mismatch
107Allow vdevs with conflicting replication levels to be added to the pool.
108.El
109.
110.Sh EXAMPLES
111.\" These are, respectively, examples 5, 13 from zpool.8
112.\" Make sure to update them bidirectionally
113.Ss Example 1 : No Adding a Mirror to a ZFS Storage Pool
114The following command adds two mirrored disks to the pool
115.Ar tank ,
116assuming the pool is already made up of two-way mirrors.
117The additional space is immediately available to any datasets within the pool.
118.Dl # Nm zpool Cm add Ar tank Sy mirror Pa sda sdb
119.
120.Ss Example 2 : No Adding Cache Devices to a ZFS Pool
121The following command adds two disks for use as cache devices to a ZFS storage
122pool:
123.Dl # Nm zpool Cm add Ar pool Sy cache Pa sdc sdd
124.Pp
125Once added, the cache devices gradually fill with content from main memory.
126Depending on the size of your cache devices, it could take over an hour for
127them to fill.
128Capacity and reads can be monitored using the
129.Cm iostat
130subcommand as follows:
131.Dl # Nm zpool Cm iostat Fl v Ar pool 5
132.
133.Sh SEE ALSO
134.Xr zpool-attach 8 ,
135.Xr zpool-import 8 ,
136.Xr zpool-initialize 8 ,
137.Xr zpool-online 8 ,
138.Xr zpool-remove 8
139