1*eda14cbcSMatt Macy.\" 2*eda14cbcSMatt Macy.\" CDDL HEADER START 3*eda14cbcSMatt Macy.\" 4*eda14cbcSMatt Macy.\" The contents of this file are subject to the terms of the 5*eda14cbcSMatt Macy.\" Common Development and Distribution License (the "License"). 6*eda14cbcSMatt Macy.\" You may not use this file except in compliance with the License. 7*eda14cbcSMatt Macy.\" 8*eda14cbcSMatt Macy.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*eda14cbcSMatt Macy.\" or http://www.opensolaris.org/os/licensing. 10*eda14cbcSMatt Macy.\" See the License for the specific language governing permissions 11*eda14cbcSMatt Macy.\" and limitations under the License. 12*eda14cbcSMatt Macy.\" 13*eda14cbcSMatt Macy.\" When distributing Covered Code, include this CDDL HEADER in each 14*eda14cbcSMatt Macy.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*eda14cbcSMatt Macy.\" If applicable, add the following below this CDDL HEADER, with the 16*eda14cbcSMatt Macy.\" fields enclosed by brackets "[]" replaced with your own identifying 17*eda14cbcSMatt Macy.\" information: Portions Copyright [yyyy] [name of copyright owner] 18*eda14cbcSMatt Macy.\" 19*eda14cbcSMatt Macy.\" CDDL HEADER END 20*eda14cbcSMatt Macy.\" 21*eda14cbcSMatt Macy.\" 22*eda14cbcSMatt Macy.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved. 23*eda14cbcSMatt Macy.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved. 24*eda14cbcSMatt Macy.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved. 25*eda14cbcSMatt Macy.\" Copyright (c) 2017 Datto Inc. 26*eda14cbcSMatt Macy.\" Copyright (c) 2018 George Melikov. All Rights Reserved. 27*eda14cbcSMatt Macy.\" Copyright 2017 Nexenta Systems, Inc. 28*eda14cbcSMatt Macy.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved. 29*eda14cbcSMatt Macy.\" 30*eda14cbcSMatt Macy.Dd May 15, 2020 31*eda14cbcSMatt Macy.Dt ZPOOL-REPLACE 8 32*eda14cbcSMatt Macy.Os 33*eda14cbcSMatt Macy.Sh NAME 34*eda14cbcSMatt Macy.Nm zpool Ns Pf - Cm replace 35*eda14cbcSMatt Macy.Nd Replace one device with another in a ZFS storage pool 36*eda14cbcSMatt Macy.Sh SYNOPSIS 37*eda14cbcSMatt Macy.Nm 38*eda14cbcSMatt Macy.Cm replace 39*eda14cbcSMatt Macy.Op Fl fsw 40*eda14cbcSMatt Macy.Oo Fl o Ar property Ns = Ns Ar value Oc 41*eda14cbcSMatt Macy.Ar pool Ar device Op Ar new_device 42*eda14cbcSMatt Macy.Sh DESCRIPTION 43*eda14cbcSMatt Macy.Bl -tag -width Ds 44*eda14cbcSMatt Macy.It Xo 45*eda14cbcSMatt Macy.Nm 46*eda14cbcSMatt Macy.Cm replace 47*eda14cbcSMatt Macy.Op Fl fsw 48*eda14cbcSMatt Macy.Op Fl o Ar property Ns = Ns Ar value 49*eda14cbcSMatt Macy.Ar pool Ar device Op Ar new_device 50*eda14cbcSMatt Macy.Xc 51*eda14cbcSMatt MacyReplaces 52*eda14cbcSMatt Macy.Ar old_device 53*eda14cbcSMatt Macywith 54*eda14cbcSMatt Macy.Ar new_device . 55*eda14cbcSMatt MacyThis is equivalent to attaching 56*eda14cbcSMatt Macy.Ar new_device , 57*eda14cbcSMatt Macywaiting for it to resilver, and then detaching 58*eda14cbcSMatt Macy.Ar old_device . 59*eda14cbcSMatt MacyAny in progress scrub will be cancelled. 60*eda14cbcSMatt Macy.Pp 61*eda14cbcSMatt MacyThe size of 62*eda14cbcSMatt Macy.Ar new_device 63*eda14cbcSMatt Macymust be greater than or equal to the minimum size of all the devices in a mirror 64*eda14cbcSMatt Macyor raidz configuration. 65*eda14cbcSMatt Macy.Pp 66*eda14cbcSMatt Macy.Ar new_device 67*eda14cbcSMatt Macyis required if the pool is not redundant. 68*eda14cbcSMatt MacyIf 69*eda14cbcSMatt Macy.Ar new_device 70*eda14cbcSMatt Macyis not specified, it defaults to 71*eda14cbcSMatt Macy.Ar old_device . 72*eda14cbcSMatt MacyThis form of replacement is useful after an existing disk has failed and has 73*eda14cbcSMatt Macybeen physically replaced. 74*eda14cbcSMatt MacyIn this case, the new disk may have the same 75*eda14cbcSMatt Macy.Pa /dev 76*eda14cbcSMatt Macypath as the old device, even though it is actually a different disk. 77*eda14cbcSMatt MacyZFS recognizes this. 78*eda14cbcSMatt Macy.Bl -tag -width Ds 79*eda14cbcSMatt Macy.It Fl f 80*eda14cbcSMatt MacyForces use of 81*eda14cbcSMatt Macy.Ar new_device , 82*eda14cbcSMatt Macyeven if it appears to be in use. 83*eda14cbcSMatt MacyNot all devices can be overridden in this manner. 84*eda14cbcSMatt Macy.It Fl o Ar property Ns = Ns Ar value 85*eda14cbcSMatt MacySets the given pool properties. See the 86*eda14cbcSMatt Macy.Xr zpoolprops 87*eda14cbcSMatt Macymanual page for a list of valid properties that can be set. 88*eda14cbcSMatt MacyThe only property supported at the moment is 89*eda14cbcSMatt Macy.Sy ashift . 90*eda14cbcSMatt Macy.It Fl s 91*eda14cbcSMatt MacyThe 92*eda14cbcSMatt Macy.Ar new_device 93*eda14cbcSMatt Macyis reconstructed sequentially to restore redundancy as quickly as possible. 94*eda14cbcSMatt MacyChecksums are not verfied during sequential reconstruction so a scrub is 95*eda14cbcSMatt Macystarted when the resilver completes. 96*eda14cbcSMatt MacySequential reconstruction is not supported for raidz configurations. 97*eda14cbcSMatt Macy.It Fl w 98*eda14cbcSMatt MacyWaits until the replacement has completed before returning. 99*eda14cbcSMatt Macy.El 100*eda14cbcSMatt Macy.El 101*eda14cbcSMatt Macy.Sh SEE ALSO 102*eda14cbcSMatt Macy.Xr zpool-detach 8 , 103*eda14cbcSMatt Macy.Xr zpool-initialize 8 , 104*eda14cbcSMatt Macy.Xr zpool-online 8 , 105*eda14cbcSMatt Macy.Xr zpool-resilver 8 106