HowTo: Temporarily disable mirror to generate free ports?

saveZFS

Explorer
Joined
Jan 6, 2022
Messages
87
I have to exchange one of six HDDs in my Raid-Z2 (pool1) pool.
I only have 8 ports on my HBA. 6 of them are used by the Raid-Z2 (pool1) and two are used by a mirror (pool2).
The mirror (pool2) does not have to be permanently available.
Can I somehow separate the mirror (pool2) from the system in order to use the ports to replace the defective hard disk in the Raid-Z2 (pool1)?
Then I would like to integrate the mirror (pool2) back into the system unchanged.
Is this approach possible and sensible?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
zpool offline pool2 <diskidentifier>, then unplug it and do your work.

Later:

zpool online pool2 <diskidentifier>
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I have to exchange one of six HDDs in my Raid-Z2 (pool1) pool.
So why not offline the disk to be replaced through the GUI, remove it from the system, install the replacement, and then initiate the replacement/resilvering through the GUI? Doesn't seem like any reason to mess with the mirror pool at all. But if you want to, you can offline a single disk in the mirror as @sretalla suggests--though I'd do it through the GUI rather than at the CLI.
 

saveZFS

Explorer
Joined
Jan 6, 2022
Messages
87
So why not offline the disk to be replaced through the GUI, remove it from the system, install the replacement, and then initiate the replacement/resilvering through the GUI?
If I don't deactivate the mirror pool, I don't have a free connection! :(
I thought it would always be desirable to continue to operate the pool with the greatest redundancy, even when replacing HDDs. If I take the disk offline from the Z2 pool, then I only have one disk for redundancy. In the other case, there is therefore double redundancy if no disk fails in between. Isn't that always the best way?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
If I don't deactivate the mirror pool, I don't have a free connection! :(
Sure you do--if you do what I suggested (and you quoted): remove the disk you want to replace from the RAIDZ2 pool.
Isn't that always the best way?
"Always" is a more absolute statement than I'm willing to make, but yes, it's often advantageous to do as you describe. It does maintain redundancy, though it often slows the resilvering operation.

But, again, you don't have to take the mirror pool offline entirely--just offline one of its disks while you're performing the disk replacement in the other pool. Once that's done, bring that disk back online.
 

Etorix

Wizard
Joined
Dec 30, 2020
Messages
2,134
If you have a spare port, resilvering with full redundancy is the best option.
But offlining one drive in a raidz2 and resilvering with single redundancy is a good and safe option.
Offlining one drive in a raidz1 would not be safe.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
why not offline the entire mirror pool,
I think that's OP's actual question, or at least the headline question: how to do that (answer: storage -> pools -> gear icon -> Export/Disconnect). But the post asks if this approach is sensible, and I think the more sensible approach is to offline the disk to be replaced in the RAIDZ2 pool and proceed with a normal replacement.
 

Etorix

Wizard
Joined
Dec 30, 2020
Messages
2,134
@danb35 I realised I had misread "separating the pool" and deleted that part of my answer.
OP's approach is safe, and sensible if he can do without the mirror pool for a time. But in this case, resilvering in place as you propose is the easiest approach—and it's safe too.
 

saveZFS

Explorer
Joined
Jan 6, 2022
Messages
87
I think that's OP's actual question, or at least the headline question: how to do that (answer: storage -> pools -> gear icon -> Export/Disconnect).
Thank you, this was my first intention.
But in my opinion your discribed solution is the best and easiest way in this case. And in the worst case I have a backup. ;)
I will do it so.

The other solution with deactivating the mirror will be better when I want to change all the six disks to larger ones.
Then I can replace two disks at the same time and it will not take so long I hope.
But at the moment the space is enough for me! :)
 

saveZFS

Explorer
Joined
Jan 6, 2022
Messages
87
Today I installed the new HDD.
After removing the HDD the pool status was 'Degraded'. This I understand.
Then I added the new disk by clicking replace.
Now the resilvering is running. But the pool status is 'Unhealthy'. Is this correct or did I something wrong? :(
 
Top