Go to main content

Managing ZFS File Systems in Oracle® Solaris 11.4

Exit Print View

Updated: August 2019
 
 

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. However, removing toplevel data vdevs in a RAID-Z pool is unsupported. You can remove devices by referring to their identifiers, such as mirror-1 in Example 3, Adding Disks to a Mirrored ZFS Configuration.

You can cancel a top-level device removal operation by using the command zpool remove –s.

Example 7  Removing Top Level Virtual Data Devices

This example shows how to remove mirror-1 and mirror-2 from the pool that was created in Example 3, 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 8  Removing a Mirrored Log Device

This example shows how to remove the log device mirror-1 that was created in Example 5, 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 9  Removing Cache Devices

This example shows how to remove the cache device that was created in Example 6, 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