xref: /freebsd/sys/contrib/openzfs/man/man8/zpool-replace.8 (revision a521f2116473fbd8c09db395518f060a27d02334)
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-REPLACE 8
32.Os
33.Sh NAME
34.Nm zpool Ns Pf - Cm replace
35.Nd Replace one device with another in a ZFS storage pool
36.Sh SYNOPSIS
37.Nm
38.Cm replace
39.Op Fl fsw
40.Oo Fl o Ar property Ns = Ns Ar value Oc
41.Ar pool Ar device Op Ar new_device
42.Sh DESCRIPTION
43.Bl -tag -width Ds
44.It Xo
45.Nm
46.Cm replace
47.Op Fl fsw
48.Op Fl o Ar property Ns = Ns Ar value
49.Ar pool Ar device Op Ar new_device
50.Xc
51Replaces
52.Ar old_device
53with
54.Ar new_device .
55This is equivalent to attaching
56.Ar new_device ,
57waiting for it to resilver, and then detaching
58.Ar old_device .
59Any in progress scrub will be cancelled.
60.Pp
61The size of
62.Ar new_device
63must be greater than or equal to the minimum size of all the devices in a mirror
64or raidz configuration.
65.Pp
66.Ar new_device
67is required if the pool is not redundant.
68If
69.Ar new_device
70is not specified, it defaults to
71.Ar old_device .
72This form of replacement is useful after an existing disk has failed and has
73been physically replaced.
74In this case, the new disk may have the same
75.Pa /dev
76path as the old device, even though it is actually a different disk.
77ZFS recognizes this.
78.Bl -tag -width Ds
79.It Fl f
80Forces use of
81.Ar new_device ,
82even if it appears to be in use.
83Not all devices can be overridden in this manner.
84.It Fl o Ar property Ns = Ns Ar value
85Sets the given pool properties. See the
86.Xr zpoolprops
87manual page for a list of valid properties that can be set.
88The only property supported at the moment is
89.Sy ashift .
90.It Fl s
91The
92.Ar new_device
93is reconstructed sequentially to restore redundancy as quickly as possible.
94Checksums are not verfied during sequential reconstruction so a scrub is
95started when the resilver completes.
96Sequential reconstruction is not supported for raidz configurations.
97.It Fl w
98Waits until the replacement has completed before returning.
99.El
100.El
101.Sh SEE ALSO
102.Xr zpool-detach 8 ,
103.Xr zpool-initialize 8 ,
104.Xr zpool-online 8 ,
105.Xr zpool-resilver 8
106