xref: /freebsd/sys/contrib/openzfs/man/man8/zpool-remove.8 (revision bb2d13b686e3ccf6c3ccb36209dfb7dcc108b182)
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
9271171e0SMartin 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
78*bb2d13b6SMartin MatuskaA mirrored top-level device (log or data) can be removed by specifying the top-
79*bb2d13b6SMartin Matuskalevel mirror for the
80eda14cbcSMatt Macysame.
81*bb2d13b6SMartin MatuskaNon-log devices or data devices that are part of a mirrored configuration can be
82*bb2d13b6SMartin Matuskaremoved using
83eda14cbcSMatt Macythe
84eda14cbcSMatt Macy.Nm zpool Cm detach
85eda14cbcSMatt Macycommand.
86eda14cbcSMatt Macy.Bl -tag -width Ds
87eda14cbcSMatt Macy.It Fl n
8816038816SMartin MatuskaDo not actually perform the removal
8916038816SMartin Matuska.Pq Qq No-op .
90eda14cbcSMatt MacyInstead, print the estimated amount of memory that will be used by the
91eda14cbcSMatt Macymapping table after the removal completes.
92eda14cbcSMatt MacyThis is nonzero only for top-level vdevs.
93eda14cbcSMatt Macy.El
94eda14cbcSMatt Macy.Bl -tag -width Ds
95eda14cbcSMatt Macy.It Fl p
96eda14cbcSMatt MacyUsed in conjunction with the
97eda14cbcSMatt Macy.Fl n
98eda14cbcSMatt Macyflag, displays numbers as parsable (exact) values.
99eda14cbcSMatt Macy.It Fl w
100eda14cbcSMatt MacyWaits until the removal has completed before returning.
101eda14cbcSMatt Macy.El
102eda14cbcSMatt Macy.It Xo
1037877fdebSMatt Macy.Nm zpool
104eda14cbcSMatt Macy.Cm remove
105eda14cbcSMatt Macy.Fl s
106eda14cbcSMatt Macy.Ar pool
107eda14cbcSMatt Macy.Xc
108eda14cbcSMatt MacyStops and cancels an in-progress removal of a top-level vdev.
109eda14cbcSMatt Macy.El
110da5137abSMartin Matuska.
111da5137abSMartin Matuska.Sh EXAMPLES
112da5137abSMartin Matuska.\" These are, respectively, examples 14 from zpool.8
113da5137abSMartin Matuska.\" Make sure to update them bidirectionally
114da5137abSMartin Matuska.Ss Example 1 : No Removing a Mirrored top-level (Log or Data) Device
115da5137abSMartin MatuskaThe following commands remove the mirrored log device
116da5137abSMartin Matuska.Sy mirror-2
117da5137abSMartin Matuskaand mirrored top-level data device
118da5137abSMartin Matuska.Sy mirror-1 .
119da5137abSMartin Matuska.Pp
120da5137abSMartin MatuskaGiven this configuration:
121da5137abSMartin Matuska.Bd -literal -compact -offset Ds
122da5137abSMartin Matuska  pool: tank
123da5137abSMartin Matuska state: ONLINE
124da5137abSMartin Matuska scrub: none requested
125da5137abSMartin Matuskaconfig:
126da5137abSMartin Matuska
127da5137abSMartin Matuska         NAME        STATE     READ WRITE CKSUM
128da5137abSMartin Matuska         tank        ONLINE       0     0     0
129da5137abSMartin Matuska           mirror-0  ONLINE       0     0     0
130da5137abSMartin Matuska             sda     ONLINE       0     0     0
131da5137abSMartin Matuska             sdb     ONLINE       0     0     0
132da5137abSMartin Matuska           mirror-1  ONLINE       0     0     0
133da5137abSMartin Matuska             sdc     ONLINE       0     0     0
134da5137abSMartin Matuska             sdd     ONLINE       0     0     0
135da5137abSMartin Matuska         logs
136da5137abSMartin Matuska           mirror-2  ONLINE       0     0     0
137da5137abSMartin Matuska             sde     ONLINE       0     0     0
138da5137abSMartin Matuska             sdf     ONLINE       0     0     0
139da5137abSMartin Matuska.Ed
140da5137abSMartin Matuska.Pp
141da5137abSMartin MatuskaThe command to remove the mirrored log
142da5137abSMartin Matuska.Ar mirror-2 No is :
143da5137abSMartin Matuska.Dl # Nm zpool Cm remove Ar tank mirror-2
144da5137abSMartin Matuska.Pp
145da5137abSMartin MatuskaThe command to remove the mirrored data
146da5137abSMartin Matuska.Ar mirror-1 No is :
147da5137abSMartin Matuska.Dl # Nm zpool Cm remove Ar tank mirror-1
148da5137abSMartin Matuska.
149eda14cbcSMatt Macy.Sh SEE ALSO
150eda14cbcSMatt Macy.Xr zpool-add 8 ,
151eda14cbcSMatt Macy.Xr zpool-detach 8 ,
152eda14cbcSMatt Macy.Xr zpool-labelclear 8 ,
15316038816SMartin Matuska.Xr zpool-offline 8 ,
154eda14cbcSMatt Macy.Xr zpool-replace 8 ,
155eda14cbcSMatt Macy.Xr zpool-split 8
156