0

If a disk gets disconnected from a ZFS array, but the drive itself if totally fine, what happens when you reconnect it?

For example, if I have a mirror of 2 drives, if one is disconnected, then reconnected, will ZFS simply continue where it left off or will all the data need to be recopied to the disconnected disk?

If there's a zpool with just striped single-disk vdevs, is the pool toast regardless of if the disk is reconnected? Similarly, in a RAID10-style configuration, if one set of mirrors is disconnected, is the pool gone?

  • AFAIK when you remove part of a stripe configuration, the whole pool stops working. No reads or writes will work. If you return the disk, it will work again. Removing and reattaching part of redundant vdev should result in resilver. – Fox Jun 28 '15 at 07:18
  • Why would the disk be disconnected? – ewwhite Jun 28 '15 at 11:38
  • Any number of reasons, for example, the cable gets unplugged or the enclosure loses power. Basically any disconnection where a disk is temporarily removed from its array but has not failed or been damaged. – AdorableHoneycrisp Jun 28 '15 at 12:21

1 Answers1

3

If a drive from a 2 drive mirror gets disconnected then the pool is still usable, although marked as degraded.

    NAME                                          STATE     READ WRITE CKSUM
tank                                          DEGRADED     0     0     0
  raidz1-0                                    ONLINE       0     0     0
    ata-WDC_WD20EZRX-00D8PB0_WD-WMC4M3335755  ONLINE       0     0     0
    ata-WDC_WD20EZRX-00DC0B0_WD-WMC300332200  ONLINE       0     0     0
    ata-WDC_WD20EZRX-00DC0B0_WD-WMC300475178  ONLINE       0     0     0
    ata-WDC_WD20EARS-00U0AB0_WD-WMAZ20003312  ONLINE       0     0     0
  mirror-1                                    DEGRADED     0     0     0
    14297679323067028052                      UNAVAIL      0     0     0  was /dev/disk/by-id/usb-SAMSUNG_HD103SI_1605000cf659-0:0-part1
    usb-Seagate_Expansion_Desk_NA4KSWFS-0:0   ONLINE       0     0     0

Once it is reconnected you can notify ZFS with the online command: sudo zpool online tank 14297679323067028052

I find the ZFS docs to be really well written, here's the relevant page for reconnecting drives: http://docs.oracle.com/cd/E19253-01/819-5461/gbbvb/index.html