Unraid wants to clear new data drive that has preclear signature


Recommended Posts

Hello Everyone,

 

I am trying to add 3 new drives to my existing array on Unraid v6.8.3 and my Preclear Disks plugin was updated on 2020.10.22. I have run preclear on the new drives, which completed successfully, and the drives show the precleared status in Unassigned Devices. The drives were precleared in my server chassis (i.e. not in some external enclosure). This is shown below.

Precleared.thumb.PNG.f1e3d05ed8719f0e32138bdb005dbc80.PNG

 

I am having the issue that when I go to add the precleared drive to the array, Unraid is stating that it wants to clear the drive again. Here are the steps I am taking. I add the first drive (sdg ending in XZ) to disk slot 6

DriveView.thumb.PNG.2831b55a71cce904709a0fe57fbd13df.PNG

Then looking at the Array Operation area it shows that when I start the array it is going to clear the drive.

StartView.thumb.PNG.220a0c7d1d3906a7504bbe2056ed04b1.PNG

 

This is the part that I don't understand. It was my understanding that if I were to preclear the drive in advance, then when I add it to the array Unraid wouldn't need to clear it again. Am I doing something wrong in the order in which I am adding new drives to my array? Any advice/suggestions would be much appreciated. Thanks.

Link to comment

So I hate to answer my own question, but I took the plunge with my 6TB drive and added it to the array. It immediately showed up in the drive list as unmountable. Going down to Array Operation, I had a new option to select format drive. Once accepting the warning and clicking yes, the format took a couple of seconds and then the drive was online in the array. The disk was not cleared again.

 

It might be worthwhile to change the text, as "start Clearing new data disk(s)" is wrong. The disk was not cleared again.

Link to comment
  • 1 year later...
On 10/28/2020 at 7:30 PM, itimpi said:

You are probably falling foul of the fact that preclear is not a standard part of Unraid but a 3rd party utility so the GUI does not take account of the fact that a Clear had been done outside the control of Unraid.

 

I am new and just learning UNRAID, but can you please elaborate on the following:

If UNRAID "does not take account of the fact that a Clear has been done outside", then how does it make a decision to add the drive to the array without the subsequent clear procedure? Doesn't it still rely on the signature issued by Preclear, technically risking the integrity of the entire array?

Link to comment
1 hour ago, trurl said:

don't understand what you mean there. When you add a precleared drive to the array, it already agrees with parity since it is all zeros.

I'll try to explain but correct me if I am wrong at any point.

The statement above implies that UNRAID has no knowledge if disk clearing has been performed outside own native functionality, hence the message that the disk will be cleared.

At the same time, as we see later, UNRAID trusts the signature that is issued by the same plug-in from "outside", assumes that the new disk has been zeroed and adds it to the array without own native clearing process.

My confusion is why UNRAID has no knowledge of outside clearing, if in fact it can validate it via Preclear signature? Am I missing something?

 

Thanks!

Link to comment
34 minutes ago, m-a-x said:

My confusion is why UNRAID has no knowledge of outside clearing, if in fact it can validate it via Preclear signature? Am I missing something?

It can't validate via the signature, it can only trust that the signature has been applied to a fully cleared disk. The signature is placed in a logical location on the disk such that any write access that would normally be applied to a fully blank disk will destroy the signature.

 

If you were to take a precleared disk with signature intact and manually flip bits NOT in the signature area, Unraid would still trust it as precleared, and subsequent parity checks would find the altered area and either only alert or alert and alter the parity disk to match, depending on whether the check was correcting or not.

 

If there was a disk failure before those bits were corrected in parity, then each altered bit would be incorrect on the emulated disk, causing anything from file system corruption to absolutely no noticeable effect if the bits were in unoccupied space on the emulated drive.

 

Clear as mud?

 

At some point between the finalization of the preclear process and adding the disk to the array, the signature was overwritten, causing Unraid to require a clearing cycle. When that occurred can be very tough to pin down, but any attempt to mount or read the precleared drive could possibly cause it.

Link to comment
1 hour ago, JonathanM said:

It can't validate via the signature, it can only trust that the signature has been applied to a fully cleared disk. The signature is placed in a logical location on the disk such that any write access that would normally be applied to a fully blank disk will destroy the signature.

 

If you were to take a precleared disk with signature intact and manually flip bits NOT in the signature area, Unraid would still trust it as precleared, and subsequent parity checks would find the altered area and either only alert or alert and alter the parity disk to match, depending on whether the check was correcting or not.

 

If there was a disk failure before those bits were corrected in parity, then each altered bit would be incorrect on the emulated disk, causing anything from file system corruption to absolutely no noticeable effect if the bits were in unoccupied space on the emulated drive.

 

Clear as mud?

 

At some point between the finalization of the preclear process and adding the disk to the array, the signature was overwritten, causing Unraid to require a clearing cycle. When that occurred can be very tough to pin down, but any attempt to mount or read the precleared drive could possibly cause it.

 

This makes total sense, thanks for the detailed explanation. I assume that the term "emulated disk" is in reference to the disk that has been added to the array?

Also, I assume "flipping bits" refers to a procedure that bypasses traditional write access, otherwise the clear signature would have been destroyed, correct?

I also understand that the result of mismatching parity is correction of the parity data, not the flipped bits?

 

About the disk failure remark - this is exactly the scenario I had in mind when I said "risking the integrity of the entire array" in my original comment.

 

I found confusing that, I quote, "preclear is not a standard part of Unraid but a 3rd party utility so the GUI does not take account of the fact that a Clear had been done outside the control of Unraid". Here's why:

 

The OP tried to add a precleared drive to the array and Unraid was stating that it wanted to clear the drive again.

So on one hand UNRAID uses the signature as a proof that that drive is zeroed, and on the other hand the GUI still throws a misleading message that the disk cleaning was going to happen again.

It's worth noting that the drive was certainly clean and untampered with: as per OP follow up he OKed the prompt for one more clearing, only to realize that nothing really happened and the drive was added to the array instantly.

 

What's in bold seems to me contradictory. Not trying to be annoying, just trying to understand how it all works. UNRAID is awesome.

 

Edited by m-a-x
Link to comment
1 minute ago, m-a-x said:

I assume that the term "emulated disk" is in reference to the disk that has been added to the array?

No. When a write to a disk fails for any reason, it is disabled (kicked out of the array) because it is no longer in sync. After a disk is disabled, it is no longer used until rebuilt. Any reads of the disabled disk is emulated from the parity calculation by reading all other disks. Any writes of the disabled disk is emulated by updating parity. The initial failed write, and any subsequent writes to the emulated disk, can be recovered by rebuilding.

Link to comment
11 minutes ago, trurl said:

No. When a write to a disk fails for any reason, it is disabled (kicked out of the array) because it is no longer in sync. After a disk is disabled, it is no longer used until rebuilt. Any reads of the disabled disk is emulated from the parity calculation by reading all other disks. Any writes of the disabled disk is emulated by updating parity. The initial failed write, and any subsequent writes to the emulated disk, can be recovered by rebuilding.

 

This is sort of what meant, I just worded it poorly. By saying "emulated disk is in reference to the disk that has been added to the array", I meant the disk that was going to be added to the array as a replacement to the failed one, which is the 1:1 copy of the emulated disk. But yes, I do realize that emulated disk is not even the replacement disk, it's not physical, it's a result of XOR in the RAM (I assume).

 

Thanks for amazing explanation!

Edited by m-a-x
Link to comment

The whole point of clearing a disk is so it can be added to a new data slot in the parity array without affecting parity. This is the only situation where a clear disk is required, and if the disk to be added hasn't been precleared, Unraid will clear it before adding it to the array.

 

An emulated disk would be a disk that was already in the array, but had been disabled as I explained. Clearing or adding doesn't apply in that case, only replacing.

Link to comment
17 minutes ago, trurl said:

An emulated disk would be a disk that was already in the array, but had been disabled as I explained. Clearing or adding doesn't apply in that case, only replacing.

Emulated disk was brought up in this conversation in a different context, specifically a scenario of data corruption on the emulated disk in case of bit flip on a precleared disk that had been added to the array at some point and a subsequent failure of a disk. Anyway, that's beyond this topic.

 

The real question is - if UNRAID trusts that the new disk is clean based on the signature, why then GUI would still throw a message that the drive will be cleared again.

One can't argue that this is a result of UNRAID not trusting Preclear/3rd party plugin. Because the drive signature is provided by Preclear too, and UNRAID happily trusts that signature i.e. Preclear's clearing job.

Link to comment
4 hours ago, m-a-x said:

The real question is - if UNRAID trusts that the new disk is clean based on the signature, why then GUI would still throw a message that the drive will be cleared again.

I think it is an issue in that since standard Unraid does not have preclear built in there is no status information available to the GUI to indicate a precleared disk.  The check for the signature is done at a lower level during the add process.  I guess this could be changed in a future Unraid release but I would not want to bet on it.

Link to comment

The GUI indeed is unaware of whether a disk is precleared or not.

The standard procedure is to clear a new disk added to the array. The lower level function doing the clearing would recognize the signature set by preclear and sees clearing is already done and skip it.

 

If you want to avoid confusion, then simply let Unraid do all the work, it knows exactly what is required.

 

Link to comment
3 hours ago, bonienl said:

The GUI indeed is unaware of whether a disk is precleared or not.

The standard procedure is to clear a new disk added to the array. The lower level function doing the clearing would recognize the signature set by preclear and sees clearing is already done and skip it.

 

If you want to avoid confusion, then simply let Unraid do all the work, it knows exactly what is required.

 

 

Would it make sense to do a quick check for disk signature before the message? Something like: "the disk seems to have been already precleared by 3rd party tool. If you trust the tool and wish to add the drive and skip the clear check [x] I trust this tool and understand the consequences. Otherwise leave unchecked and UNRAID will clear the disk again.

 

Thanks everyone for the input! I totally understand the technical side, I get it. It'd just be nice if the message was less confusing for users who don't know. At least a simple note: [*if the disk has been precleared, then Unraid will skip it].

 

Link to comment
11 hours ago, itimpi said:

I think it is an issue in that since standard Unraid does not have preclear built in there is no status information available to the GUI to indicate a precleared disk.  The check for the signature is done at a lower level during the add process.  I guess this could be changed in a future Unraid release but I would not want to bet on it.

 

Thanks! Totally agree.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.