xref: /freebsd/sys/contrib/openzfs/man/man8/zpool-remove.8 (revision a521f2116473fbd8c09db395518f060a27d02334)
1.\"
2.\" CDDL HEADER START
3.\"
4.\" The contents of this file are subject to the terms of the
5.\" Common Development and Distribution License (the "License").
6.\" You may not use this file except in compliance with the License.
7.\"
8.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9.\" or http://www.opensolaris.org/os/licensing.
10.\" See the License for the specific language governing permissions
11.\" and limitations under the License.
12.\"
13.\" When distributing Covered Code, include this CDDL HEADER in each
14.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15.\" If applicable, add the following below this CDDL HEADER, with the
16.\" fields enclosed by brackets "[]" replaced with your own identifying
17.\" information: Portions Copyright [yyyy] [name of copyright owner]
18.\"
19.\" CDDL HEADER END
20.\"
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 August 9, 2019
31.Dt ZPOOL-REMOVE 8
32.Os
33.Sh NAME
34.Nm zpool Ns Pf - Cm remove
35.Nd Remove a device from a ZFS storage pool
36.Sh SYNOPSIS
37.Nm
38.Cm remove
39.Op Fl npw
40.Ar pool Ar device Ns ...
41.Nm
42.Cm remove
43.Fl s
44.Ar pool
45.Sh DESCRIPTION
46.Bl -tag -width Ds
47.It Xo
48.Nm
49.Cm remove
50.Op Fl npw
51.Ar pool Ar device Ns ...
52.Xc
53Removes the specified device from the pool.
54This command supports removing hot spare, cache, log, and both mirrored and
55non-redundant primary top-level vdevs, including dedup and special vdevs.
56When the primary pool storage includes a top-level raidz vdev only hot spare,
57cache, and log devices can be removed.
58Note that keys for all encrypted datasets must be loaded for top-level vdevs
59to be removed.
60.sp
61Removing a top-level vdev reduces the total amount of space in the storage pool.
62The specified device will be evacuated by copying all allocated space from it to
63the other devices in the pool.
64In this case, the
65.Nm zpool Cm remove
66command initiates the removal and returns, while the evacuation continues in
67the background.
68The removal progress can be monitored with
69.Nm zpool Cm status .
70If an IO error is encountered during the removal process it will be
71cancelled. The
72.Sy device_removal
73feature flag must be enabled to remove a top-level vdev, see
74.Xr zpool-features 5 .
75.Pp
76A mirrored top-level device (log or data) can be removed by specifying the top-level mirror for the
77same.
78Non-log devices or data devices that are part of a mirrored configuration can be removed using
79the
80.Nm zpool Cm detach
81command.
82.Bl -tag -width Ds
83.It Fl n
84Do not actually perform the removal ("no-op").
85Instead, print the estimated amount of memory that will be used by the
86mapping table after the removal completes.
87This is nonzero only for top-level vdevs.
88.El
89.Bl -tag -width Ds
90.It Fl p
91Used in conjunction with the
92.Fl n
93flag, displays numbers as parsable (exact) values.
94.It Fl w
95Waits until the removal has completed before returning.
96.El
97.It Xo
98.Nm
99.Cm remove
100.Fl s
101.Ar pool
102.Xc
103Stops and cancels an in-progress removal of a top-level vdev.
104.El
105.Sh SEE ALSO
106.Xr zpool-add 8 ,
107.Xr zpool-detach 8 ,
108.Xr zpool-offline 8 ,
109.Xr zpool-labelclear 8 ,
110.Xr zpool-replace 8 ,
111.Xr zpool-split 8
112