SOLVED How to repair a pool after failed drive

Bostjan

Contributor
Joined
Mar 24, 2014
Messages
122
At first I had a pool with 4 disks in 2 mirrors of two. Then one disk died. I replaced the physical disk with a new one.

After that I don’t remember what I did. Somehow I must have removed the old dead disk from the pool. Now I have
root@fn2:~ # zpool status pool: fn2 state: ONLINE NAME STATE READ WRITE CKSUM fn2 ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 gptid0 ONLINE 0 0 0 gptid1 ONLINE 0 0 0 gptid2 ONLINE 0 0 0

I want to add a new disk to the pool to get two mirrors.
I don’t want to make any mistakes - I could lose all my data.

How can I add a disk to this pool to get mirrors?

Please help.
Thank you.
 
Last edited:

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
I could lose all my data.

Indeed... No server, TrueNAS or other, can be more than a single point of failure. Backups are essential for every data you care about.

So according to your zpool status, your 3 drives are in a single mirror, mirror 0. So you do not have 2x 2 mirrors. Still, the pool is said to be online, so is working fine as of now...

Please, use the CODE tag when posting commands and the corresponding output.

So what is the capacity of your pool and your drives ? Also, is that really all the output for zpool status ?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
according to your zpool status, your 3 drives are in a single mirror, mirror 0
I think you're missing the indent level of the third drive...

I guess that drive was part of the second mirror, but is now a lonely drive in a stripe, separate from the mirror of the other 2.

You will need to attach a new disk to that lone drive to re-establish the second mirror.
 

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
I think you're missing the indent level of the third drive...

But where is the mention of mirror-1 then ?

It should be visible, indent or not...
 

Bostjan

Contributor
Joined
Mar 24, 2014
Messages
122
First it was (I don't remember fully)
mirror-0 gptid0 gptid1 mirror-0 gptid2 gptid3

Then a disk died. Then I replaced the disk. Then I did something wrong and removed the failed drive from pool.
Now it is
root@fn2:~ # zpool status pool: fn2 state: ONLINE NAME STATE READ WRITE CKSUM fn2 ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 gptid0 ONLINE 0 0 0 gptid1 ONLINE 0 0 0 gptid2 ONLINE 0 0 0


Everything works. I just don't have 2 mirrors.
How to add a new drive to gptid2, so that I'll get proper mirror?
How to find out proper names of drives - zpool status shows gptid names?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
But where is the mention of mirror-1 then ?

It should be visible, indent or not...
Not if the second/failed disk had been detached from it, leaving the remaining drive as a stripe and no longer in a mirror.

I get your point if we could still see the failed disk.

How to add a new drive to gptid2, so that I'll get proper mirror?
3 dots next to that drive in pool status, extend. (if you're using TrueNAS... if you're still on FreeNAS, it's CLI only)

How to find out proper names of drives - zpool status shows gptid names?
glabel status gives you a table where you can look it up.
 

Bostjan

Contributor
Joined
Mar 24, 2014
Messages
122
this did the trick for my situation
3 dots next to that drive in pool status, extend.

Do you perhaps know what is the equivalent CLI command?
 

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Do you perhaps know what is the equivalent CLI command?

Whenever the GUI offers you to do it, you are much better and safer to do it that way. Avoiding CLI will help you avoid catastrophe
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Do you perhaps know what is the equivalent CLI command?
it's zpool attach ...

But as advised above, don't use it if the GUI works fine.
 
Top