xref: /freebsd/sys/contrib/openzfs/man/man8/zpool-remove.8 (revision 271171e0d97b88ba2a7c3bf750c9672b484c1c13)
1eda14cbcSMatt Macy.\"
2eda14cbcSMatt Macy.\" CDDL HEADER START
3eda14cbcSMatt Macy.\"
4eda14cbcSMatt Macy.\" The contents of this file are subject to the terms of the
5eda14cbcSMatt Macy.\" Common Development and Distribution License (the "License").
6eda14cbcSMatt Macy.\" You may not use this file except in compliance with the License.
7eda14cbcSMatt Macy.\"
8eda14cbcSMatt Macy.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*271171e0SMartin Matuska.\" or https://opensource.org/licenses/CDDL-1.0.
10eda14cbcSMatt Macy.\" See the License for the specific language governing permissions
11eda14cbcSMatt Macy.\" and limitations under the License.
12eda14cbcSMatt Macy.\"
13eda14cbcSMatt Macy.\" When distributing Covered Code, include this CDDL HEADER in each
14eda14cbcSMatt Macy.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15eda14cbcSMatt Macy.\" If applicable, add the following below this CDDL HEADER, with the
16eda14cbcSMatt Macy.\" fields enclosed by brackets "[]" replaced with your own identifying
17eda14cbcSMatt Macy.\" information: Portions Copyright [yyyy] [name of copyright owner]
18eda14cbcSMatt Macy.\"
19eda14cbcSMatt Macy.\" CDDL HEADER END
20eda14cbcSMatt Macy.\"
21eda14cbcSMatt Macy.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
22eda14cbcSMatt Macy.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
23eda14cbcSMatt Macy.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
24eda14cbcSMatt Macy.\" Copyright (c) 2017 Datto Inc.
25eda14cbcSMatt Macy.\" Copyright (c) 2018 George Melikov. All Rights Reserved.
26eda14cbcSMatt Macy.\" Copyright 2017 Nexenta Systems, Inc.
27eda14cbcSMatt Macy.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
28eda14cbcSMatt Macy.\"
29da5137abSMartin Matuska.Dd March 16, 2022
30eda14cbcSMatt Macy.Dt ZPOOL-REMOVE 8
31eda14cbcSMatt Macy.Os
32da5137abSMartin Matuska.
33eda14cbcSMatt Macy.Sh NAME
347877fdebSMatt Macy.Nm zpool-remove
3516038816SMartin Matuska.Nd remove devices from ZFS storage pool
36da5137abSMartin Matuska.
37eda14cbcSMatt Macy.Sh SYNOPSIS
387877fdebSMatt Macy.Nm zpool
39eda14cbcSMatt Macy.Cm remove
40eda14cbcSMatt Macy.Op Fl npw
4116038816SMartin Matuska.Ar pool Ar device Ns …
427877fdebSMatt Macy.Nm zpool
43eda14cbcSMatt Macy.Cm remove
44eda14cbcSMatt Macy.Fl s
45eda14cbcSMatt Macy.Ar pool
46da5137abSMartin Matuska.
47eda14cbcSMatt Macy.Sh DESCRIPTION
48eda14cbcSMatt Macy.Bl -tag -width Ds
49eda14cbcSMatt Macy.It Xo
507877fdebSMatt Macy.Nm zpool
51eda14cbcSMatt Macy.Cm remove
52eda14cbcSMatt Macy.Op Fl npw
5316038816SMartin Matuska.Ar pool Ar device Ns …
54eda14cbcSMatt Macy.Xc
55eda14cbcSMatt MacyRemoves the specified device from the pool.
56eda14cbcSMatt MacyThis command supports removing hot spare, cache, log, and both mirrored and
57eda14cbcSMatt Macynon-redundant primary top-level vdevs, including dedup and special vdevs.
5821b492edSMartin Matuska.Pp
5921b492edSMartin MatuskaTop-level vdevs can only be removed if the primary pool storage does not contain
6021b492edSMartin Matuskaa top-level raidz vdev, all top-level vdevs have the same sector size, and the
6121b492edSMartin Matuskakeys for all encrypted datasets are loaded.
6216038816SMartin Matuska.Pp
63eda14cbcSMatt MacyRemoving a top-level vdev reduces the total amount of space in the storage pool.
64eda14cbcSMatt MacyThe specified device will be evacuated by copying all allocated space from it to
65eda14cbcSMatt Macythe other devices in the pool.
66eda14cbcSMatt MacyIn this case, the
67eda14cbcSMatt Macy.Nm zpool Cm remove
68eda14cbcSMatt Macycommand initiates the removal and returns, while the evacuation continues in
69eda14cbcSMatt Macythe background.
70eda14cbcSMatt MacyThe removal progress can be monitored with
71eda14cbcSMatt Macy.Nm zpool Cm status .
72c03c5b1cSMartin MatuskaIf an I/O error is encountered during the removal process it will be cancelled.
7316038816SMartin MatuskaThe
74eda14cbcSMatt Macy.Sy device_removal
75eda14cbcSMatt Macyfeature flag must be enabled to remove a top-level vdev, see
763ff01b23SMartin Matuska.Xr zpool-features 7 .
77eda14cbcSMatt Macy.Pp
78eda14cbcSMatt MacyA mirrored top-level device (log or data) can be removed by specifying the top-level mirror for the
79eda14cbcSMatt Macysame.
80eda14cbcSMatt MacyNon-log devices or data devices that are part of a mirrored configuration can be removed using
81eda14cbcSMatt Macythe
82eda14cbcSMatt Macy.Nm zpool Cm detach
83eda14cbcSMatt Macycommand.
84eda14cbcSMatt Macy.Bl -tag -width Ds
85eda14cbcSMatt Macy.It Fl n
8616038816SMartin MatuskaDo not actually perform the removal
8716038816SMartin Matuska.Pq Qq No-op .
88eda14cbcSMatt MacyInstead, print the estimated amount of memory that will be used by the
89eda14cbcSMatt Macymapping table after the removal completes.
90eda14cbcSMatt MacyThis is nonzero only for top-level vdevs.
91eda14cbcSMatt Macy.El
92eda14cbcSMatt Macy.Bl -tag -width Ds
93eda14cbcSMatt Macy.It Fl p
94eda14cbcSMatt MacyUsed in conjunction with the
95eda14cbcSMatt Macy.Fl n
96eda14cbcSMatt Macyflag, displays numbers as parsable (exact) values.
97eda14cbcSMatt Macy.It Fl w
98eda14cbcSMatt MacyWaits until the removal has completed before returning.
99eda14cbcSMatt Macy.El
100eda14cbcSMatt Macy.It Xo
1017877fdebSMatt Macy.Nm zpool
102eda14cbcSMatt Macy.Cm remove
103eda14cbcSMatt Macy.Fl s
104eda14cbcSMatt Macy.Ar pool
105eda14cbcSMatt Macy.Xc
106eda14cbcSMatt MacyStops and cancels an in-progress removal of a top-level vdev.
107eda14cbcSMatt Macy.El
108da5137abSMartin Matuska.
109da5137abSMartin Matuska.Sh EXAMPLES
110da5137abSMartin Matuska.\" These are, respectively, examples 14 from zpool.8
111da5137abSMartin Matuska.\" Make sure to update them bidirectionally
112da5137abSMartin Matuska.Ss Example 1 : No Removing a Mirrored top-level (Log or Data) Device
113da5137abSMartin MatuskaThe following commands remove the mirrored log device
114da5137abSMartin Matuska.Sy mirror-2
115da5137abSMartin Matuskaand mirrored top-level data device
116da5137abSMartin Matuska.Sy mirror-1 .
117da5137abSMartin Matuska.Pp
118da5137abSMartin MatuskaGiven this configuration:
119da5137abSMartin Matuska.Bd -literal -compact -offset Ds
120da5137abSMartin Matuska  pool: tank
121da5137abSMartin Matuska state: ONLINE
122da5137abSMartin Matuska scrub: none requested
123da5137abSMartin Matuskaconfig:
124da5137abSMartin Matuska
125da5137abSMartin Matuska         NAME        STATE     READ WRITE CKSUM
126da5137abSMartin Matuska         tank        ONLINE       0     0     0
127da5137abSMartin Matuska           mirror-0  ONLINE       0     0     0
128da5137abSMartin Matuska             sda     ONLINE       0     0     0
129da5137abSMartin Matuska             sdb     ONLINE       0     0     0
130da5137abSMartin Matuska           mirror-1  ONLINE       0     0     0
131da5137abSMartin Matuska             sdc     ONLINE       0     0     0
132da5137abSMartin Matuska             sdd     ONLINE       0     0     0
133da5137abSMartin Matuska         logs
134da5137abSMartin Matuska           mirror-2  ONLINE       0     0     0
135da5137abSMartin Matuska             sde     ONLINE       0     0     0
136da5137abSMartin Matuska             sdf     ONLINE       0     0     0
137da5137abSMartin Matuska.Ed
138da5137abSMartin Matuska.Pp
139da5137abSMartin MatuskaThe command to remove the mirrored log
140da5137abSMartin Matuska.Ar mirror-2 No is:
141da5137abSMartin Matuska.Dl # Nm zpool Cm remove Ar tank mirror-2
142da5137abSMartin Matuska.Pp
143da5137abSMartin MatuskaThe command to remove the mirrored data
144da5137abSMartin Matuska.Ar mirror-1 No is:
145da5137abSMartin Matuska.Dl # Nm zpool Cm remove Ar tank mirror-1
146da5137abSMartin Matuska.
147eda14cbcSMatt Macy.Sh SEE ALSO
148eda14cbcSMatt Macy.Xr zpool-add 8 ,
149eda14cbcSMatt Macy.Xr zpool-detach 8 ,
150eda14cbcSMatt Macy.Xr zpool-labelclear 8 ,
15116038816SMartin Matuska.Xr zpool-offline 8 ,
152eda14cbcSMatt Macy.Xr zpool-replace 8 ,
153eda14cbcSMatt Macy.Xr zpool-split 8
154