logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

zpool-remove.8 (5648B)


  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 https://opensource.org/licenses/CDDL-1.0.
  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. .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
  22. .\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
  23. .\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
  24. .\" Copyright (c) 2017 Datto Inc.
  25. .\" Copyright (c) 2018 George Melikov. All Rights Reserved.
  26. .\" Copyright 2017 Nexenta Systems, Inc.
  27. .\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
  28. .\"
  29. .Dd March 16, 2022
  30. .Dt ZPOOL-REMOVE 8
  31. .Os
  32. .
  33. .Sh NAME
  34. .Nm zpool-remove
  35. .Nd remove devices from ZFS storage pool
  36. .
  37. .Sh SYNOPSIS
  38. .Nm zpool
  39. .Cm remove
  40. .Op Fl npw
  41. .Ar pool Ar device Ns …
  42. .Nm zpool
  43. .Cm remove
  44. .Fl s
  45. .Ar pool
  46. .
  47. .Sh DESCRIPTION
  48. .Bl -tag -width Ds
  49. .It Xo
  50. .Nm zpool
  51. .Cm remove
  52. .Op Fl npw
  53. .Ar pool Ar device Ns …
  54. .Xc
  55. Removes the specified device from the pool.
  56. This command supports removing hot spare, cache, log, and both mirrored and
  57. non-redundant primary top-level vdevs, including dedup and special vdevs.
  58. .Pp
  59. Top-level vdevs can only be removed if the primary pool storage does not contain
  60. a top-level raidz vdev, all top-level vdevs have the same sector size, and the
  61. keys for all encrypted datasets are loaded.
  62. .Pp
  63. Removing a top-level vdev reduces the total amount of space in the storage pool.
  64. The specified device will be evacuated by copying all allocated space from it to
  65. the other devices in the pool.
  66. In this case, the
  67. .Nm zpool Cm remove
  68. command initiates the removal and returns, while the evacuation continues in
  69. the background.
  70. The removal progress can be monitored with
  71. .Nm zpool Cm status .
  72. If an I/O error is encountered during the removal process it will be cancelled.
  73. The
  74. .Sy device_removal
  75. feature flag must be enabled to remove a top-level vdev, see
  76. .Xr zpool-features 7 .
  77. .Pp
  78. A mirrored top-level device (log or data) can be removed by specifying the top-
  79. level mirror for the
  80. same.
  81. Non-log devices or data devices that are part of a mirrored configuration can be
  82. removed using
  83. the
  84. .Nm zpool Cm detach
  85. command.
  86. .Bl -tag -width Ds
  87. .It Fl n
  88. Do not actually perform the removal
  89. .Pq Qq No-op .
  90. Instead, print the estimated amount of memory that will be used by the
  91. mapping table after the removal completes.
  92. This is nonzero only for top-level vdevs.
  93. .El
  94. .Bl -tag -width Ds
  95. .It Fl p
  96. Used in conjunction with the
  97. .Fl n
  98. flag, displays numbers as parsable (exact) values.
  99. .It Fl w
  100. Waits until the removal has completed before returning.
  101. .El
  102. .It Xo
  103. .Nm zpool
  104. .Cm remove
  105. .Fl s
  106. .Ar pool
  107. .Xc
  108. Stops and cancels an in-progress removal of a top-level vdev.
  109. .El
  110. .
  111. .Sh EXAMPLES
  112. .\" These are, respectively, examples 15 from zpool.8
  113. .\" Make sure to update them bidirectionally
  114. .Ss Example 1 : No Removing a Mirrored top-level (Log or Data) Device
  115. The following commands remove the mirrored log device
  116. .Sy mirror-2
  117. and mirrored top-level data device
  118. .Sy mirror-1 .
  119. .Pp
  120. Given this configuration:
  121. .Bd -literal -compact -offset Ds
  122. pool: tank
  123. state: ONLINE
  124. scrub: none requested
  125. config:
  126. NAME STATE READ WRITE CKSUM
  127. tank ONLINE 0 0 0
  128. mirror-0 ONLINE 0 0 0
  129. sda ONLINE 0 0 0
  130. sdb ONLINE 0 0 0
  131. mirror-1 ONLINE 0 0 0
  132. sdc ONLINE 0 0 0
  133. sdd ONLINE 0 0 0
  134. logs
  135. mirror-2 ONLINE 0 0 0
  136. sde ONLINE 0 0 0
  137. sdf ONLINE 0 0 0
  138. .Ed
  139. .Pp
  140. The command to remove the mirrored log
  141. .Ar mirror-2 No is :
  142. .Dl # Nm zpool Cm remove Ar tank mirror-2
  143. .Pp
  144. At this point, the log device no longer exists
  145. (both sides of the mirror have been removed):
  146. .Bd -literal -compact -offset Ds
  147. pool: tank
  148. state: ONLINE
  149. scan: none requested
  150. config:
  151. NAME STATE READ WRITE CKSUM
  152. tank ONLINE 0 0 0
  153. mirror-0 ONLINE 0 0 0
  154. sda ONLINE 0 0 0
  155. sdb ONLINE 0 0 0
  156. mirror-1 ONLINE 0 0 0
  157. sdc ONLINE 0 0 0
  158. sdd ONLINE 0 0 0
  159. .Ed
  160. .Pp
  161. The command to remove the mirrored data
  162. .Ar mirror-1 No is :
  163. .Dl # Nm zpool Cm remove Ar tank mirror-1
  164. .Pp
  165. After
  166. .Ar mirror-1 No has been evacuated, the pool remains redundant, but
  167. the total amount of space is reduced:
  168. .Bd -literal -compact -offset Ds
  169. pool: tank
  170. state: ONLINE
  171. scan: none requested
  172. config:
  173. NAME STATE READ WRITE CKSUM
  174. tank ONLINE 0 0 0
  175. mirror-0 ONLINE 0 0 0
  176. sda ONLINE 0 0 0
  177. sdb ONLINE 0 0 0
  178. .Ed
  179. .
  180. .Sh SEE ALSO
  181. .Xr zpool-add 8 ,
  182. .Xr zpool-detach 8 ,
  183. .Xr zpool-labelclear 8 ,
  184. .Xr zpool-offline 8 ,
  185. .Xr zpool-replace 8 ,
  186. .Xr zpool-split 8