xref: /freebsd/sys/contrib/openzfs/man/man8/zpool-attach.8 (revision 9e5787d2284e187abb5b654d924394a65772e004)
1.\"
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 http://www.opensolaris.org/os/licensing.
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.\"
22.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
23.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
24.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
25.\" Copyright (c) 2017 Datto Inc.
26.\" Copyright (c) 2018 George Melikov. All Rights Reserved.
27.\" Copyright 2017 Nexenta Systems, Inc.
28.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
29.\"
30.Dd May 15, 2020
31.Dt ZPOOL-ATTACH 8
32.Os
33.Sh NAME
34.Nm zpool Ns Pf - Cm attach
35.Nd Attach a new device to an existing ZFS virtual device (vdev).
36.Sh SYNOPSIS
37.Nm
38.Cm attach
39.Op Fl fsw
40.Oo Fl o Ar property Ns = Ns Ar value Oc
41.Ar pool device new_device
42.Sh DESCRIPTION
43.Bl -tag -width Ds
44.It Xo
45.Nm
46.Cm attach
47.Op Fl fsw
48.Oo Fl o Ar property Ns = Ns Ar value Oc
49.Ar pool device new_device
50.Xc
51Attaches
52.Ar new_device
53to the existing
54.Ar device .
55The existing device cannot be part of a raidz configuration.
56If
57.Ar device
58is not currently part of a mirrored configuration,
59.Ar device
60automatically transforms into a two-way mirror of
61.Ar device
62and
63.Ar new_device .
64If
65.Ar device
66is part of a two-way mirror, attaching
67.Ar new_device
68creates a three-way mirror, and so on.
69In either case,
70.Ar new_device
71begins to resilver immediately and any running scrub is cancelled.
72.Bl -tag -width Ds
73.It Fl f
74Forces use of
75.Ar new_device ,
76even if it appears to be in use.
77Not all devices can be overridden in this manner.
78.It Fl o Ar property Ns = Ns Ar value
79Sets the given pool properties. See the
80.Xr zpoolprops 8
81manual page for a list of valid properties that can be set. The only property
82supported at the moment is ashift.
83.It Fl s
84The
85.Ar new_device
86is reconstructed sequentially to restore redundancy as quickly as possible.
87Checksums are not verfied during sequential reconstruction so a scrub is
88started when the resilver completes.
89Sequential reconstruction is not supported for raidz configurations.
90.It Fl w
91Waits until
92.Ar new_device
93has finished resilvering before returning.
94.El
95.El
96.Sh SEE ALSO
97.Xr zpool-detach 8 ,
98.Xr zpool-add 8 ,
99.Xr zpool-import 8 ,
100.Xr zpool-initialize 8 ,
101.Xr zpool-online 8 ,
102.Xr zpool-replace 8 ,
103.Xr zpool-resilver 8
104