Replacing same drive after offlined

Status
Not open for further replies.

Pseudobolt

Dabbler
Joined
Apr 16, 2014
Messages
17
Hi,
this question seems like it should have a simple answer but I've looked through the manual and searched the forums and can't find one. So here goes:

I'm playing with my FreeNAS box to get the hang of it before I set it up 'for real', and last night I offlined one of the drives and pulled it to check how it worked. That part went fine, but now I want to put the same drive back into the machine. I tried using "replace" in the GUI and selecting the drive (ada2), but got the error message "/gptid/{UUID} is already a member of active pool Test_4DR".

Eventually I got it to go back in by doing a quick wipe of the removed drive and then using "replace" and letting it resilver, which is close enough to simulating a replacement with a new drive. But is there a way to do it without wiping the drive and pretending it's a new one?
 

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
This is probably due to the ZFS meta data left on the device. You can delete it either by zero'ing the first and last blocks of the drive/partition (what you did), or by using zpool labelclear -f <device>. As always, use -f (force) with caution, since it will clear the label even on disks which are considered part of an active pool.

EDIT: I'm not sure if the GUI does any additional sanity testing. I know that it keeps the GUIDs of the partitions in a pool saved in the FreeNAS database, and if it checks those you also would need to get rid of the partition table.
 

Pseudobolt

Dabbler
Joined
Apr 16, 2014
Messages
17
Ok. I guess ZFS assumes that you're not going to offline a drive unless there's something wrong with it.
 

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
Yes, and it's actually a wise precaution for unintentionally destroying data on the wrong disk.
If you remove the disk on purpose, you can cleanly detach it from the pool and clear the labels afterwards so that it is marked as not in use anymore.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Ok. I guess ZFS assumes that you're not going to offline a drive unless there's something wrong with it.

Correct.

If you offline an inappropriate drive the solution is to reboot FreeNAS and do a scrub of your pool to get the disks back in sync.
 
Status
Not open for further replies.
Top