xref: /freebsd/sys/contrib/openzfs/man/man8/zpool-add.8 (revision 53e1cbefe4b81e6ecdad529fcd252600f838cf69)
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 http://www.opensolaris.org/os/licensing.
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.\"
28.Dd March 16, 2022
29.Dt ZPOOL-ADD 8
30.Os
31.
32.Sh NAME
33.Nm zpool-add
34.Nd add vdevs to ZFS storage pool
35.Sh SYNOPSIS
36.Nm zpool
37.Cm add
38.Op Fl fgLnP
39.Oo Fl o Ar property Ns = Ns Ar value Oc
40.Ar pool vdev Ns …
41.
42.Sh DESCRIPTION
43Adds the specified virtual devices to the given pool.
44The
45.Ar vdev
46specification is described in the
47.Em Virtual Devices
48section of
49.Xr zpoolconcepts 7 .
50The behavior of the
51.Fl f
52option, and the device checks performed are described in the
53.Nm zpool Cm create
54subcommand.
55.Bl -tag -width Ds
56.It Fl f
57Forces use of
58.Ar vdev Ns s ,
59even if they appear in use or specify a conflicting replication level.
60Not all devices can be overridden in this manner.
61.It Fl g
62Display
63.Ar vdev ,
64GUIDs instead of the normal device names.
65These GUIDs can be used in place of
66device names for the zpool detach/offline/remove/replace commands.
67.It Fl L
68Display real paths for
69.Ar vdev Ns s
70resolving all symbolic links.
71This can be used to look up the current block
72device name regardless of the
73.Pa /dev/disk
74path used to open it.
75.It Fl n
76Displays the configuration that would be used without actually adding the
77.Ar vdev Ns s .
78The actual pool creation can still fail due to insufficient privileges or
79device sharing.
80.It Fl P
81Display real paths for
82.Ar vdev Ns s
83instead of only the last component of the path.
84This can be used in conjunction with the
85.Fl L
86flag.
87.It Fl o Ar property Ns = Ns Ar value
88Sets the given pool properties.
89See the
90.Xr zpoolprops 7
91manual page for a list of valid properties that can be set.
92The only property supported at the moment is
93.Sy ashift .
94.El
95.
96.Sh EXAMPLES
97.\" These are, respectively, examples 5, 13 from zpool.8
98.\" Make sure to update them bidirectionally
99.Ss Example 1 : No Adding a Mirror to a ZFS Storage Pool
100The following command adds two mirrored disks to the pool
101.Ar tank ,
102assuming the pool is already made up of two-way mirrors.
103The additional space is immediately available to any datasets within the pool.
104.Dl # Nm zpool Cm add Ar tank Sy mirror Pa sda sdb
105.
106.Ss Example 2 : No Adding Cache Devices to a ZFS Pool
107The following command adds two disks for use as cache devices to a ZFS storage
108pool:
109.Dl # Nm zpool Cm add Ar pool Sy cache Pa sdc sdd
110.Pp
111Once added, the cache devices gradually fill with content from main memory.
112Depending on the size of your cache devices, it could take over an hour for
113them to fill.
114Capacity and reads can be monitored using the
115.Cm iostat
116subcommand as follows:
117.Dl # Nm zpool Cm iostat Fl v Ar pool 5
118.
119.Sh SEE ALSO
120.Xr zpool-attach 8 ,
121.Xr zpool-import 8 ,
122.Xr zpool-initialize 8 ,
123.Xr zpool-online 8 ,
124.Xr zpool-remove 8
125