Removing Devices From a Storage Pool
To remove devices from a pool, use the zpool remove
command. This command supports removing hot spares, cache, log, and top level virtual data devices. You can remove devices by referring to their identifiers, such as mirror-1
in Adding Disks to a Mirrored ZFS Configuration.
You can cancel a top-level device removal operation by using the command zpool remove -s
.
Note:
The primary use case for removing a top-level data device is when you accidentally add a device to a pool. You can lessen the potential impact to the running system if you remove the accidentally added device promptly. For example, system or application performance might be impacted negatively if you remove a top-level data device from an existing pool while reading a large amount of cold data that is not re-written after the device is removed. Such a process might be an RMAN backup of a data warehouse database. So, only use thezpool remove
command to recover a pool when you have added another device to the pool accidentally.
Avoid using the zpool remove
command in cases where you cannot tolerate a performance degradation or when the pool is nearly full. In such cases, consider creating a new pool and then using the zfs send
and zfs recv
commands to migrate the data to the new pool.
Example 4-5 Removing Top Level Virtual Data Devices
This example shows how to remove mirror-1
and mirror-2
from the pool that was created in Adding Disks to a Mirrored ZFS Configuration. The example provides two pieces of information after you issue the command to remove devices:
-
The status of the pool while the devices are being removed.
-
The status of the pool after the device removal is completed.
$ zpool remove mpool mirror-1 mirror-2 # zpool status mpool pool: mpool state: ONLINE status: One or more devices is currently being removed. action: Wait for the resilver to complete. Run 'zpool status -v' to see device specific details. scan: resilver in progress since Mon Jul 7 18:19:35 2014 16.7G scanned 884M resilvered at 52.6M/s, 9.94% done, 0h1m to go config: NAME STATE READ WRITE CKSUM mpool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c0t1d0 ONLINE 0 0 0 c1t1d0 ONLINE 0 0 0 mirror-1 REMOVING 0 0 0 c0t2d0 ONLINE 0 0 0 c1t2d0 ONLINE 0 0 0 mirror-2 REMOVING 0 0 0 c0t3d0 ONLINE 0 0 0 c1t3d0 ONLINE 0 0 0 + + errors: No known data errors $ zpool status mpool pool: mpool state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM mirror-0 ONLINE 0 0 0 c0t1d0 ONLINE 0 0 0 c1t1d0 ONLINE 0 0 0 errors: No known data errors
Example 4-6 Removing a Mirrored Log Device
This example shows how to remove the log device mirror-1
that was created in Adding a Mirrored Log Device. Note that if the log device is not redundant, then remove the device by referring to the device name, such as c0t6d0
.
$ zpool remove newpool mirror-1 $ zpool status newpool pool: newpool state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM newpool ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c0t4d0 ONLINE 0 0 0 c0t5d0 ONLINE 0 0 0 errors: No known data errors
Example 4-7 Removing Cache Devices
This example shows how to remove the cache device that was created in Adding Cache Devices.
$ zpool remove system1 c2t5d0 c2t8d0 $ zpool status system1 pool: system1 state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM system1 ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c2t0d0 ONLINE 0 0 0 c2t1d0 ONLINE 0 0 0 c2t3d0 ONLINE 0 0 0 errors: No known data errors