What actually happens when replacing a drive?

Status
Not open for further replies.

Robert Smith

Patron
Joined
May 4, 2014
Messages
270
Hi,

I am practicing replacing a drive in a Z2 pool. I have followed the documentation, and after the Replace command the new drive started reslivering, while the zpool status was reporting the removed drive as ‘repalcing’ and the new drive as ‘reslivering’.

So far so good.

The last step in the documentation is detaching the old drive.

I did not want to wait three hours before clicking the detach button; and clicked it before reslivering was complete. Why should not I be able to? The old drive is physically removed already anyway...

To my surprise this restarted the new drive reslivering from the beginning.

Why did that happen, and did I damage anything? Can I safely do what I did?


As to why am I asking this; I am looking for the replacement procedure, where I can put the new drive in, and walk away from the site, rather than wait there for hours to complete the procedure.




Thank you.

P.S. The logic of the drive replacement procedure in FreeNAS documentation goes against my experience with other systems. Should not we detach the drive as the first step, other than last?
 
D

dlavigne

Guest
The steps are offline, remove, and replace. The detach is only necesarry in the occasional case where the GUI doesn't get updated after the resilver completes.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Actually, no. The detach is always required. The last detach actually removes the "offlined" disk from the zpool permanently.

Until you actually click the 'detach' button it is actually possible to put the disk back in the pool and online the disk (or put the disk in the server and reboot iirc).

The last step shouldn't be performed until the resilver is actually complete, just like the manual says. There was no penalty for waiting the 3 hours except that you'd have to remember to go back and detach the removed disk thereby removing it from the pool permanently.

In short, do what the manual says, exactly how the manual says to do it. Anything else comes with compromises, risks, etc.
 

BigDave

FreeNAS Enthusiast
Joined
Oct 6, 2013
Messages
2,479
detach the removed disk
@cyberjock I'm just trying to understand this better...
Once the resilvering process has completeted, you must "detach" this old HDD, (it's already physically removed)
so the operating system deletes the history of the drive's existance?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yep. If you do a disk replacement and then do a "zpool status" it will still show the old drive. Disks are only permanently removed from a pool when they are "detached" from the pool. "offlining" a disk from the pool only tells ZFS to no longer use that device for reads and writes, it doesn't actually remove the disk from the zpool. :P
 
Status
Not open for further replies.
Top