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