xref: /freebsd/sys/contrib/openzfs/man/man8/zpool-replace.8 (revision 271171e0d97b88ba2a7c3bf750c9672b484c1c13)
1eda14cbcSMatt Macy.\"
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
9*271171e0SMartin 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.
28eda14cbcSMatt Macy.\"
2916038816SMartin Matuska.Dd May 29, 2021
30eda14cbcSMatt Macy.Dt ZPOOL-REPLACE 8
31eda14cbcSMatt Macy.Os
3216038816SMartin Matuska.
33eda14cbcSMatt Macy.Sh NAME
347877fdebSMatt Macy.Nm zpool-replace
3516038816SMartin Matuska.Nd replace one device with another in ZFS storage pool
36eda14cbcSMatt Macy.Sh SYNOPSIS
377877fdebSMatt Macy.Nm zpool
38eda14cbcSMatt Macy.Cm replace
39eda14cbcSMatt Macy.Op Fl fsw
40eda14cbcSMatt Macy.Oo Fl o Ar property Ns = Ns Ar value Oc
4116038816SMartin Matuska.Ar pool Ar device Op Ar new-device
4216038816SMartin Matuska.
43eda14cbcSMatt Macy.Sh DESCRIPTION
44eda14cbcSMatt MacyReplaces
4516038816SMartin Matuska.Ar device
46eda14cbcSMatt Macywith
4716038816SMartin Matuska.Ar new-device .
48eda14cbcSMatt MacyThis is equivalent to attaching
4916038816SMartin Matuska.Ar new-device ,
50eda14cbcSMatt Macywaiting for it to resilver, and then detaching
5116038816SMartin Matuska.Ar device .
52eda14cbcSMatt MacyAny in progress scrub will be cancelled.
53eda14cbcSMatt Macy.Pp
54eda14cbcSMatt MacyThe size of
5516038816SMartin Matuska.Ar new-device
56eda14cbcSMatt Macymust be greater than or equal to the minimum size of all the devices in a mirror
57eda14cbcSMatt Macyor raidz configuration.
58eda14cbcSMatt Macy.Pp
5916038816SMartin Matuska.Ar new-device
60eda14cbcSMatt Macyis required if the pool is not redundant.
61eda14cbcSMatt MacyIf
6216038816SMartin Matuska.Ar new-device
63eda14cbcSMatt Macyis not specified, it defaults to
6416038816SMartin Matuska.Ar device .
65eda14cbcSMatt MacyThis form of replacement is useful after an existing disk has failed and has
66eda14cbcSMatt Macybeen physically replaced.
67eda14cbcSMatt MacyIn this case, the new disk may have the same
68eda14cbcSMatt Macy.Pa /dev
69eda14cbcSMatt Macypath as the old device, even though it is actually a different disk.
70eda14cbcSMatt MacyZFS recognizes this.
71eda14cbcSMatt Macy.Bl -tag -width Ds
72eda14cbcSMatt Macy.It Fl f
73eda14cbcSMatt MacyForces use of
7416038816SMartin Matuska.Ar new-device ,
75eda14cbcSMatt Macyeven if it appears to be in use.
76eda14cbcSMatt MacyNot all devices can be overridden in this manner.
77eda14cbcSMatt Macy.It Fl o Ar property Ns = Ns Ar value
7816038816SMartin MatuskaSets the given pool properties.
7916038816SMartin MatuskaSee the
803ff01b23SMartin Matuska.Xr zpoolprops 7
81eda14cbcSMatt Macymanual page for a list of valid properties that can be set.
82eda14cbcSMatt MacyThe only property supported at the moment is
83eda14cbcSMatt Macy.Sy ashift .
84eda14cbcSMatt Macy.It Fl s
85eda14cbcSMatt MacyThe
8616038816SMartin Matuska.Ar new-device
87eda14cbcSMatt Macyis reconstructed sequentially to restore redundancy as quickly as possible.
88e92ffd9bSMartin MatuskaChecksums are not verified during sequential reconstruction so a scrub is
89eda14cbcSMatt Macystarted when the resilver completes.
90eda14cbcSMatt MacySequential reconstruction is not supported for raidz configurations.
91eda14cbcSMatt Macy.It Fl w
92eda14cbcSMatt MacyWaits until the replacement has completed before returning.
93eda14cbcSMatt Macy.El
9416038816SMartin Matuska.
95eda14cbcSMatt Macy.Sh SEE ALSO
96eda14cbcSMatt Macy.Xr zpool-detach 8 ,
97eda14cbcSMatt Macy.Xr zpool-initialize 8 ,
98eda14cbcSMatt Macy.Xr zpool-online 8 ,
99eda14cbcSMatt Macy.Xr zpool-resilver 8
100