1.\" SPDX-License-Identifier: CDDL-1.0 2.\" 3.\" CDDL HEADER START 4.\" 5.\" The contents of this file are subject to the terms of the 6.\" Common Development and Distribution License (the "License"). 7.\" You may not use this file except in compliance with the License. 8.\" 9.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10.\" or https://opensource.org/licenses/CDDL-1.0. 11.\" See the License for the specific language governing permissions 12.\" and limitations under the License. 13.\" 14.\" When distributing Covered Code, include this CDDL HEADER in each 15.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16.\" If applicable, add the following below this CDDL HEADER, with the 17.\" fields enclosed by brackets "[]" replaced with your own identifying 18.\" information: Portions Copyright [yyyy] [name of copyright owner] 19.\" 20.\" CDDL HEADER END 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 29, 2021 31.Dt ZPOOL-REPLACE 8 32.Os 33. 34.Sh NAME 35.Nm zpool-replace 36.Nd replace one device with another in ZFS storage pool 37.Sh SYNOPSIS 38.Nm zpool 39.Cm replace 40.Op Fl fsw 41.Oo Fl o Ar property Ns = Ns Ar value Oc 42.Ar pool Ar device Op Ar new-device 43. 44.Sh DESCRIPTION 45Replaces 46.Ar device 47with 48.Ar new-device . 49This is equivalent to attaching 50.Ar new-device , 51waiting for it to resilver, and then detaching 52.Ar device . 53Any in progress scrub will be canceled. 54.Pp 55The size of 56.Ar new-device 57must be greater than or equal to the minimum size of all the devices in a mirror 58or raidz configuration. 59.Pp 60.Ar new-device 61is required if the pool is not redundant. 62If 63.Ar new-device 64is not specified, it defaults to 65.Ar device . 66This form of replacement is useful after an existing disk has failed and has 67been physically replaced. 68In this case, the new disk may have the same 69.Pa /dev 70path as the old device, even though it is actually a different disk. 71ZFS recognizes this. 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. 80See the 81.Xr zpoolprops 7 82manual page for a list of valid properties that can be set. 83The only property supported at the moment is 84.Sy ashift . 85.It Fl s 86The 87.Ar new-device 88is reconstructed sequentially to restore redundancy as quickly as possible. 89Checksums are not verified during sequential reconstruction so a scrub is 90started when the resilver completes. 91Sequential reconstruction is not supported for raidz configurations. 92.It Fl w 93Waits until the replacement has completed before returning. 94.El 95. 96.Sh SEE ALSO 97.Xr zpool-detach 8 , 98.Xr zpool-initialize 8 , 99.Xr zpool-online 8 , 100.Xr zpool-resilver 8 101