[TriLUG] ZFS Mirroring Fix

Jos Purvis via TriLUG trilug at trilug.org
Wed Sep 13 21:17:45 EDT 2023


Hi folks! Looking to tap some ZFS expertise (ZFSpertise?). I have two computers, each of which has some external attached disks using ZFS-on-Linux. While researching a different question today, I discovered that my ZFS setup was, alas, not what I'd intended it to be.

My *intention* was to have three two-disk mirrors. However, I've discovered that apparently two of the pairs are not set up that way so far as I can tell. This pool appears correctly mirrored:
----
  pool: superior
state: ONLINE
  scan: scrub repaired 0B in 03:52:52 with 0 errors on Sun Sep 10 04:16:55 2023
config:

        NAME                                     STATE     READ WRITE CKSUM
        superior                                 ONLINE       0     0     0
          mirror-0                               ONLINE       0     0     0
            scsi-SATA_Elite_Pro_Dual-1_WSD8P178  ONLINE       0     0     0
            scsi-SATA_Elite_Pro_Dual-2_WSD7MT5K  ONLINE       0     0     0
----
However, this one appears to NOT be a mirror:
----
  pool: huron
state: ONLINE
  scan: scrub repaired 0B in 20:37:16 with 0 errors on Sun Sep 10 21:01:17 2023
config:

        NAME                                        STATE     READ WRITE CKSUM
        huron                                       ONLINE       0     0     0
          usb-ST6000VN_001-2BB186_152D00539000-0:0  ONLINE       0     0     0
          usb-ST6000VN_001-2BB186_152D00539000-0:1  ONLINE       0     0     0

errors: No known data errors
----
So if that second pair *isn't* a mirror, I'm guessing it's a stripe? Which I may have inadvertently done at some point by replacing a disk with 'zfs attach' vs. 'zfs add'. (Yes, I'm busy making backups as we speak to anything I can find that will hold all of that data, so that a disk fail doesn't blow the set...) The three sets have just enough data split between them that trying to get one of the two non-mirrors empty enough to destroy and rebuild will be a real juggling act, so I'm hoping to find a way to avoid it.


At this point, is there a graceful way to convert that set to a mirror without having to move all the data off it? Or should I bit the bullet and price out an 8TB disk on Amazon to use as a temporary holding bucket?

Thanks,

Jos


More information about the TriLUG mailing list