[zfs-discuss] Replacing a mirrored drive

Aaron bulk_mail at siegel-tech.net
Sun Mar 25 02:11:46 EDT 2012


Hello

One of my hard drives failed, it couple of weeks before I was able to free-up a replacement hard drive.

# zpool status
   pool: shed
  state: DEGRADED
status: One or more devices could not be used because the label is missing or
              invalid.  Sufficient replicas exist for the pool to continue
              functioning in a degraded state.
action: Replace the device using 'zpool replace'.
    see: http://zfsonlinux.org/msg/ZFS-8000-4J
  scan: scrub repaired 1.08M in 2h18m with 0 errors on Tue Feb 28 23:09:21 2012
config:

        NAME                                         STATE     READ WRITE CKSUM
        shed                       					                     DEGRADED     0     0     0
          mirror-0                                                                            DEGRADED     0     0     0
            scsi-SATA_SAMSUNG_HE103SJS2JBJ90B106296  ONLINE       0     0     0
            scsi-SATA_SAMSUNG_HE103SJS2JBJ90B106314  UNAVAIL      0     0     0


I tried the steps in the "Oracle Solaris ZFS Administration Guide" Page 89

# zpool offline shed scsi-SATA_SAMSUNG_HE103SJS2JBJ90B106314
cannot offline scsi-SATA_SAMSUNG_HE103SJS2JBJ90B106314: no such device in pool

 # zpool replace shed scsi-SATA_SAMSUNG_HE103SJS2JBJ90B106314 scsi-SATA_SAMSUNG_HE103SJS2JBJ90B106295
cannot replace scsi-SATA_SAMSUNG_HE103SJS2JBJ90B106314 with scsi-SATA_SAMSUNG_HE103SJS2JBJ90B106295: no such device in pool

So of course I had to do something stupid and add the new drive with zpool add -f.  So now the status is:
# zpool status
  pool: shed
 state: DEGRADED
status: One or more devices could not be used because the label is missing or
        invalid.  Sufficient replicas exist for the pool to continue
        functioning in a degraded state.
action: Replace the device using 'zpool replace'.
   see: http://zfsonlinux.org/msg/ZFS-8000-4J
 scan: scrub repaired 1.08M in 2h18m with 0 errors on Tue Feb 28 23:09:21 2012
config:

        NAME                                         STATE     READ WRITE CKSUM
        shed                                         DEGRADED     0     0     0
          mirror-0                                   DEGRADED     0     0     0
            scsi-SATA_SAMSUNG_HE103SJS2JBJ90B106296  ONLINE       0     0     0
            scsi-SATA_SAMSUNG_HE103SJS2JBJ90B106314  UNAVAIL      0     0     0
          scsi-SATA_SAMSUNG_HE103SJS2JBJ90B106295    ONLINE       0     0     0

I think it is time for me to use the zpool destroy.  Will following work and preserve my data.

# zpool destroy shed
# zpool create shed mirror scsi-SATA_SAMSUNG_HE103SJS2JBJ90B106296 scsi-SATA_SAMSUNG_HE103SJS2JBJ90B106295

Is there a another command for removing the drive added outside the mirror, *106295?

Then when I receive my replacement drive I can add a Hot Spare with the following
# zpool add shed spare <name of device>

Thank you
Aaron



More information about the zfs-discuss mailing list