xref: /freebsd/sys/contrib/openzfs/man/man8/zpool-remove.8 (revision eda14cbc264d6969b02f2b1994cef11148e914f1)
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 August 9, 2019
31*eda14cbcSMatt Macy.Dt ZPOOL-REMOVE 8
32*eda14cbcSMatt Macy.Os
33*eda14cbcSMatt Macy.Sh NAME
34*eda14cbcSMatt Macy.Nm zpool Ns Pf - Cm remove
35*eda14cbcSMatt Macy.Nd Remove a device from a ZFS storage pool
36*eda14cbcSMatt Macy.Sh SYNOPSIS
37*eda14cbcSMatt Macy.Nm
38*eda14cbcSMatt Macy.Cm remove
39*eda14cbcSMatt Macy.Op Fl npw
40*eda14cbcSMatt Macy.Ar pool Ar device Ns ...
41*eda14cbcSMatt Macy.Nm
42*eda14cbcSMatt Macy.Cm remove
43*eda14cbcSMatt Macy.Fl s
44*eda14cbcSMatt Macy.Ar pool
45*eda14cbcSMatt Macy.Sh DESCRIPTION
46*eda14cbcSMatt Macy.Bl -tag -width Ds
47*eda14cbcSMatt Macy.It Xo
48*eda14cbcSMatt Macy.Nm
49*eda14cbcSMatt Macy.Cm remove
50*eda14cbcSMatt Macy.Op Fl npw
51*eda14cbcSMatt Macy.Ar pool Ar device Ns ...
52*eda14cbcSMatt Macy.Xc
53*eda14cbcSMatt MacyRemoves the specified device from the pool.
54*eda14cbcSMatt MacyThis command supports removing hot spare, cache, log, and both mirrored and
55*eda14cbcSMatt Macynon-redundant primary top-level vdevs, including dedup and special vdevs.
56*eda14cbcSMatt MacyWhen the primary pool storage includes a top-level raidz vdev only hot spare,
57*eda14cbcSMatt Macycache, and log devices can be removed.
58*eda14cbcSMatt Macy.sp
59*eda14cbcSMatt MacyRemoving a top-level vdev reduces the total amount of space in the storage pool.
60*eda14cbcSMatt MacyThe specified device will be evacuated by copying all allocated space from it to
61*eda14cbcSMatt Macythe other devices in the pool.
62*eda14cbcSMatt MacyIn this case, the
63*eda14cbcSMatt Macy.Nm zpool Cm remove
64*eda14cbcSMatt Macycommand initiates the removal and returns, while the evacuation continues in
65*eda14cbcSMatt Macythe background.
66*eda14cbcSMatt MacyThe removal progress can be monitored with
67*eda14cbcSMatt Macy.Nm zpool Cm status .
68*eda14cbcSMatt MacyIf an IO error is encountered during the removal process it will be
69*eda14cbcSMatt Macycancelled. The
70*eda14cbcSMatt Macy.Sy device_removal
71*eda14cbcSMatt Macyfeature flag must be enabled to remove a top-level vdev, see
72*eda14cbcSMatt Macy.Xr zpool-features 5 .
73*eda14cbcSMatt Macy.Pp
74*eda14cbcSMatt MacyA mirrored top-level device (log or data) can be removed by specifying the top-level mirror for the
75*eda14cbcSMatt Macysame.
76*eda14cbcSMatt MacyNon-log devices or data devices that are part of a mirrored configuration can be removed using
77*eda14cbcSMatt Macythe
78*eda14cbcSMatt Macy.Nm zpool Cm detach
79*eda14cbcSMatt Macycommand.
80*eda14cbcSMatt Macy.Bl -tag -width Ds
81*eda14cbcSMatt Macy.It Fl n
82*eda14cbcSMatt MacyDo not actually perform the removal ("no-op").
83*eda14cbcSMatt MacyInstead, print the estimated amount of memory that will be used by the
84*eda14cbcSMatt Macymapping table after the removal completes.
85*eda14cbcSMatt MacyThis is nonzero only for top-level vdevs.
86*eda14cbcSMatt Macy.El
87*eda14cbcSMatt Macy.Bl -tag -width Ds
88*eda14cbcSMatt Macy.It Fl p
89*eda14cbcSMatt MacyUsed in conjunction with the
90*eda14cbcSMatt Macy.Fl n
91*eda14cbcSMatt Macyflag, displays numbers as parsable (exact) values.
92*eda14cbcSMatt Macy.It Fl w
93*eda14cbcSMatt MacyWaits until the removal has completed before returning.
94*eda14cbcSMatt Macy.El
95*eda14cbcSMatt Macy.It Xo
96*eda14cbcSMatt Macy.Nm
97*eda14cbcSMatt Macy.Cm remove
98*eda14cbcSMatt Macy.Fl s
99*eda14cbcSMatt Macy.Ar pool
100*eda14cbcSMatt Macy.Xc
101*eda14cbcSMatt MacyStops and cancels an in-progress removal of a top-level vdev.
102*eda14cbcSMatt Macy.El
103*eda14cbcSMatt Macy.Sh SEE ALSO
104*eda14cbcSMatt Macy.Xr zpool-add 8 ,
105*eda14cbcSMatt Macy.Xr zpool-detach 8 ,
106*eda14cbcSMatt Macy.Xr zpool-offline 8 ,
107*eda14cbcSMatt Macy.Xr zpool-labelclear 8 ,
108*eda14cbcSMatt Macy.Xr zpool-replace 8 ,
109*eda14cbcSMatt Macy.Xr zpool-split 8
110