Replace a disk in Solaris (zpool)

To replace a disk in a zpool on Solaris you need to follow a few (logical) steps.

Rescan the system for the new physical disk(s)

# cfgadm -al

Check if the disk is present

# format
Searching for disks...done

       0. c1t0d0   Boot
       1. c1t1d0   Mirror
       2. c5t600A0B800019E507000031B24EA729D1d0 
       3. c5t600143801259D9050000B000015B0000d0 
       4. c5t600143801259D9050000B000015F0000d0 
       5. c5t600143801259D9050000B000016B0000d0 
       6. c5t600143801259D9050000B00001530000d0 
       7. c5t600143801259D9050000B00001570000d0 
       8. c5t600143801259D9050000B00001630000d0 
       9. c5t600143801259D9050000B00001670000d0 

Move the existing data (zpool) to the new disk.
First check the status of the zpool.

# zpool status

Replace the disk

# zpool replace   

To follow up the replacement, you can execute the command “zpool status” again.
You will see two disks in your zpool, after the replacement there is only one disk available and you’ll get the message that it’s resilvered.

# zpool status
  pool: myzpoolname
 state: ONLINE
 scrub: resilver completed after 0h5m with 0 errors on Thu Dec 13 07:35:08 2012

        NAME                                     STATE     READ WRITE CKSUM
        myzpoolname                                    ONLINE       0     0     0
          c5t600143801259D9050000B000015B0000d0  ONLINE       0     0     0  8.34G resilvered

When the zpool is resilvered, you can remove the old disk and run following command again to remove the disk from the system.

# cfgadm -al