• Currently using VMware at work? We want to hear from you.

    Thinking of making a switch from VMware? We'd love to hear your thoughts and feedback about which hypervisor you have been researching or already using. Click here to vote and share your thoughts! You can vote HERE!

spare drive in RAIDZ2 - can avoid resilvering twice?

Status
Not open for further replies.

cfcaballero

Dabbler
Joined
Nov 26, 2017
Messages
45
Running FreeNAS 11 on a new machine that I am testing. I have a pool with 6 disks, 5 drives plus a spare (hotspare?)

I meant to add a drive to the 7th bay, but accidentally popped the 6th bay. No drama, I waited for the pool to resilver, shut down, popped the drive in, and then "replaced" the disk using the GUI. All good.

However, I notice that the array is now resilvering again, apparently so the original spare drive will become the spare once again.

Is there a different way to configure/use the spare so that if a drive fails, the spare gets used and the replacement drive becomes the new spare instead of the pool resilvering twice?

Thanks in advance!
 

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,478
I'm not going to directly answer your question, but instead am going to ask you a question:
Why do you want to have a hot spare?

Most people on here (myself included) are of the opinion that hot spares are really a waste of energy and hardware. Unless you do not have easy physical access to the server or you need crazy uptime numbers (why not use TrueNAS at that point?), then a hot spare is a waste.

Some people keep cold spares around, which another choice you could weight with the pros/cons, but with a properly planned and designed system (redundancy level, planning for future storage needs, etc.), a hot spare makes little sense majority of the time.

Or maybe all of that is moot, and you are simply testing?
 

cfcaballero

Dabbler
Joined
Nov 26, 2017
Messages
45
I'm not going to directly answer your question, but instead am going to ask you a question:
Why do you want to have a hot spare?

You guessed it right, I'm often away from the server for extended periods of time and cannot be assured of having someone I can rely to talk through the swapping out of drives if it happens while I'm away.

If indeed there is no way to configure the pool so a hot spare only results in the array resilvering once, then I'm likely to agree with you that it's a waste.

Thanks!
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
If ZFS is told to detach the original failed drive, the spare should be promoted into a full member of the array, and is no longer a spare. I have not tested this for specifics, though.
 

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,478
You guessed it right, I'm often away from the server for extended periods of time and cannot be assured of having someone I can rely to talk through the swapping out of drives if it happens while I'm away.

Got it. Just wanted to make sure about the path you were treading. I personally have 0 experience with hot spares but you shouldn't have as much trouble as you are outlining, it is not rare for someone to have a hot spare in their setup.

I'm assuming you read the manual, but it seems to say that if you have a hot spare, and a drive fails, the hot spare is put in service temporarily. as @wblock said, if the failed drive is removed, the hot spare becomes a full member of the pool. if the failed drive is replaced, then the hot spare goes back to being a hot spare.

so when you "popped the 6th bay" on accident, that as a regular member of the pool? It seems from the situation you described, the behavior is normal. it first resolved when the hot spare was put into service temporarily. then when you "replaced" the failed drive (I'm assuming that is what you did), then the new drive was added and it resolved again, and upon completion, put temporary replacement back to being a hot spare.

Correct?
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,505
If the original faulted pool member is detached, (but not replaced), the hot spare member takes over the place in the pool from the faulted disk.

My thought on why Sun choose to have ZFS hot-spares return back to hot-spare status after use, is that hot-spares can be shared between pools. Plus, it's possible to use a larger hot-spare disk to replace smaller disks. For example, like a 8TB hot-spare acting as a replacement for both 6TB and 8TB pool memebers.
 

farmerpling2

Patron
Joined
Mar 20, 2017
Messages
224
You would likely be better off with a RAIDZ3 then a RAIDZ2 + spare.

RAIDZ2 can loose 3 drives ad not worry about resilver. RAIDZ2 + spare would mean a drive fails and then the spare is resilvered into the RAIDZ2. If you were unlucky enough to loose 2 more drives, you lost the whole raid set...
 

cfcaballero

Dabbler
Joined
Nov 26, 2017
Messages
45
Hi all, thanks for the great replies. It was indeed the case that I never detached the drive that I accidentally removed, and when I attached it (even though I wiped first) it resilvered again. I just tested again and indeed there is no second resilvering when I detach the "failed" drive first (I removed and inserted a different one for testing).

Really interesting to learn that spares can be shared among pools. For me, that clinches the preference for using RAIDZ2+spare as opposed to RAIDZ3, as I value the flexibility over the additional redundancy (especially as this new server is to be a full replica of my first FreeNAS box in another country).
 
Status
Not open for further replies.
Top