]> git.proxmox.com Git - mirror_zfs.git/blame - man/man8/zpool-replace.8
FreeBSD: Add zfs_link_create() error handling
[mirror_zfs.git] / man / man8 / zpool-replace.8
CommitLineData
c5ebfbbe
RW
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
1d3ba0bf 9.\" or https://opensource.org/licenses/CDDL-1.0.
c5ebfbbe
RW
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.\"
c5ebfbbe
RW
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.\"
f84fe3fc 29.Dd May 29, 2021
c5ebfbbe 30.Dt ZPOOL-REPLACE 8
6706552e 31.Os
f84fe3fc 32.
c5ebfbbe 33.Sh NAME
1e36af8c 34.Nm zpool-replace
f84fe3fc 35.Nd replace one device with another in ZFS storage pool
c5ebfbbe 36.Sh SYNOPSIS
1e36af8c 37.Nm zpool
c5ebfbbe 38.Cm replace
9a49d3f3 39.Op Fl fsw
c5ebfbbe 40.Oo Fl o Ar property Ns = Ns Ar value Oc
f84fe3fc
AZ
41.Ar pool Ar device Op Ar new-device
42.
c5ebfbbe 43.Sh DESCRIPTION
c5ebfbbe 44Replaces
f84fe3fc 45.Ar device
c5ebfbbe 46with
f84fe3fc 47.Ar new-device .
c5ebfbbe 48This is equivalent to attaching
f84fe3fc 49.Ar new-device ,
c5ebfbbe 50waiting for it to resilver, and then detaching
f84fe3fc 51.Ar device .
9a49d3f3 52Any in progress scrub will be cancelled.
c5ebfbbe
RW
53.Pp
54The size of
f84fe3fc 55.Ar new-device
c5ebfbbe
RW
56must be greater than or equal to the minimum size of all the devices in a mirror
57or raidz configuration.
58.Pp
f84fe3fc 59.Ar new-device
c5ebfbbe
RW
60is required if the pool is not redundant.
61If
f84fe3fc 62.Ar new-device
c5ebfbbe 63is not specified, it defaults to
f84fe3fc 64.Ar device .
c5ebfbbe
RW
65This form of replacement is useful after an existing disk has failed and has
66been physically replaced.
67In this case, the new disk may have the same
68.Pa /dev
69path as the old device, even though it is actually a different disk.
70ZFS recognizes this.
71.Bl -tag -width Ds
72.It Fl f
73Forces use of
f84fe3fc 74.Ar new-device ,
c5ebfbbe
RW
75even if it appears to be in use.
76Not all devices can be overridden in this manner.
77.It Fl o Ar property Ns = Ns Ar value
f84fe3fc
AZ
78Sets the given pool properties.
79See the
2badb345 80.Xr zpoolprops 7
c5ebfbbe
RW
81manual page for a list of valid properties that can be set.
82The only property supported at the moment is
83.Sy ashift .
9a49d3f3
BB
84.It Fl s
85The
f84fe3fc 86.Ar new-device
9a49d3f3 87is reconstructed sequentially to restore redundancy as quickly as possible.
0175272f 88Checksums are not verified during sequential reconstruction so a scrub is
9a49d3f3
BB
89started when the resilver completes.
90Sequential reconstruction is not supported for raidz configurations.
c5ebfbbe
RW
91.It Fl w
92Waits until the replacement has completed before returning.
93.El
f84fe3fc 94.
c5ebfbbe
RW
95.Sh SEE ALSO
96.Xr zpool-detach 8 ,
97.Xr zpool-initialize 8 ,
98.Xr zpool-online 8 ,
99.Xr zpool-resilver 8