[TriLUG] ZFS Mirroring Fix

Joseph Mack NA3T via TriLUG trilug at trilug.org
Thu Sep 14 07:51:07 EDT 2023


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.

> 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'.

I don't remember which is which but I remember when I wanted to add a disk 
to a single disk to make a mirrored pool, I picked the likely command and 
wound up with a non-mirrored pool the size of two disks.

> At this point, is there a graceful way to convert that set to a mirror 
> without having to move all the data off it?

Not that I found.

> 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.

> 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.

This way lies madness. You don't have enough disk space to do even current 
maintenance. In a year you'll have more files and the situation will be 
worse. If a disk goes bad, you'll be scrambling. Instead buy a pair of 
disks now, twice your current biggest disk.


Joe

-- 
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
Don't upgrade a working machine - it won't work any
better - it could work worse; it may not work at all.
Homepage http://www.austintek.com/ It's GNU/Linux!



More information about the TriLUG mailing list