How to Replace a Device in a Storage Pool

  1. If necessary, switch the device to the OFFLINE state.
    $ zpool offline pool device
  2. Physically replace the device with a new device.

    In the case of redundant storage pools, ensure that the replacement device is equal to or larger than the smallest disk in the pool.

  3. Run the format command.

    Check the following in the output:

    • Ensure that the new device is listed.

    • Check whether the replacement device is marked as WWN to verify that the device ID has changed.

  4. Replace the device in the pool.

    If the new device has a new ID, include the ID in the command.

    $ zpool replaced pool replaced-device [new-device-ID]

    Note:

    If you are replacing multiple devices, make sure that each device is fully resilvered before you replace the next device.
  5. If necessary, bring the device online.
    $ zpool online pool new-device
  6. If faulted device errors are reported, perform FMA procedures.
    1. Run the command fmadm faulty.
    2. From the Affects: section of the output, identify the pool name and the GUID of the virtual device.
    3. Run the following command and provide the information from the previous step.
      $ fmadm repaired zfs://pool=name/vdev=guid

Example 4-11 Replacing Devices in a Mirrored Pool

In this example, two 16GB disks in the pool system1 are replaced with two 72GB disks. The autoexpand property is enabled after the disk replacements to expand the full disk sizes.

$ zpool status system1
  pool: system1
 state: ONLINE
 scrub: none requested
config:

        NAME         STATE     READ WRITE CKSUM
        system1      ONLINE       0     0     0
          mirror     ONLINE       0     0     0
            c1t16d0  ONLINE       0     0     0
            c1t17d0  ONLINE       0     0     0

$ zpool list system1
NAME      SIZE   ALLOC   FREE    CAP  HEALTH  ALTROOT
system1  16.8G   76.5K  16.7G     0%  ONLINE  -
$ zpool replaced system1 c1t16d0 c1t1d0
$ zpool replaced system1 c1t17d0 c1t2d0
$ zpool list system1
NAME      SIZE   ALLOC   FREE    CAP  HEALTH  ALTROOT
system1  16.8G   88.5K  16.7G     0%  ONLINE  -
$ zpool set autoexpand=on system1
$ zpool list system1
NAME      SIZE   ALLOC   FREE    CAP  HEALTH  ALTROOT
system1  68.2G    117K  68.2G     0%  ONLINE  -