[TriLUG] ZFS Mirroring Fix

Jos Purvis via TriLUG trilug at trilug.org
Thu Sep 14 16:18:04 EDT 2023


On Thu, Sep 14, 2023, at 07:51, Joseph Mack NA3T via TriLUG wrote:
> On Wed, 13 Sep 2023, Jos Purvis via TriLUG wrote:
>
>> 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.
>
>
>> ----
>> 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
>> ----
>
> what's the size of the pool? (df /huron). Is it one disk (as should be for 
> mirroring) or two disks, in which case you've joined them head to tail as 
> one disk.

Well, foo. I was initially hopeful, but `zpool list` shows that pool as 10.9T, which is 2x the available drive capacity (6TiB disk -> 5.46TiB usable -> 2x = 10.92TiB). So that appears to be the case. As it happens, the visible "Avail" field in `df` is close enough to the drive size that I hadn't noticed it was too big. :P

>> Or should I bit the bullet and price out an 8TB disk on Amazon to use as 
>> a temporary holding bucket?
>
> That's what I did.
>
> You just put the single disk into a new pool, copy everything on huron 
> onto it, and then take one of your huron disks (zero out the start of it 
> with dd if=/dev/zero) and then make it part of a mirror with your new 
> disk. The disk from huron will then resilver. The other disk from huron is 
> now a spare.

Hm. I was just thinking of using the 8TB (which is larger than either of the two pools I'm wrestling with) as a temporary holding platform — move the data onto it, destroy the ZFS pool, rebuild the ZFS pool as a proper mirror, then move the data back. The advantage to the method you're describing is that the new 'spare' actually has a copy of the existing data on it; the disadvantage is that I've got to buy two disks (one for each pool being rescued).

Worth a shot (and a look at the budget...). Thanks!

Cheers,

Jos


More information about the TriLUG mailing list