Preclear Drives on Another Computer?


Recommended Posts

I know this topic was mentioned for unRAID v5 and lower, but searching didn't reveal much for those of us just starting out. I'm 6 days into my trial for unRAID and am certain I will buy a Pro license before the trial is up (waiting for my next disability cheque later this month).

 

First a little background: I have to slowly add drives to my unRAID pool. I'm on disability and my budget for new drives is limited. In the interim I am mounting them via the Unassigned Devices plugin. I know that they are not part of the parity protected array. I've started my unRAID with a couple of new drives and have begun the process of copying data from UD mounted drives (USB and SATA connected) to the array.

 

Once I have copied all the data from a UD mounted drive, I then use the preclear plugin to clear and test the UD drive so I can then add it to the unRAID parity protected array. It's a very slow and tedious process, but it's do-able. Alas there seems to be some major impact to copy speed if I attempt to copy from a UD mounted drive while the preclear is working on another drive.

 

When I copied the data from my 1st UD mounted drive (SATA attached), the copy speeds were 100MB/sec+, but no preclear was in progress.  Now that I've precleared that 1st drive and added it to my unRAID pool, I have enough array free space to copy the next SATA attached drive (my oldest 8TB drive). Alas with the preclear going on for another 4TB drive I was able to free up, the copy speeds have dropped to less than 40MB/sec, most of the time hovering around 15MB/sec.

 

I suspect the preclear access to the 4TB drive is using too much DMA/PCI-e bandwidth for some reason, so the copy speeds suffer. So I was wondering if I can use another PC to preclear the drives and just let my unRAID focus on the copying from UD mounted drives to the array. Is there any way of doing the pre-clear or at least similar testing on another PC so that I can then re-attach it to unRAID, format it, and add it to the array pool?

 

Thoughts? Suggestions? Any help appreciated for this unRAID newbie, only 6 days in so far. I also need to give props/kudos to dlandon (the current UD developer) for answering my UD questions in the support thread for it. On a Sunday no less. Very much appreciated and will also be sending him a donation for his efforts when I get my next disability cheque. And also to Squid and bonienl for answering my questions in the Pre-sales Support area.

 

Thanks in advance to any unRAID folks willing to help! Community support appears to be strong for unRAID, so glad I've made the switch from FreeNAS.

 

Dale

 

 

Link to comment

You can definitely pre-clear on another machine.

 

It is surprising that you are seeing much impact from a pre-clear.    I know I can pre-clear a couple of drives on my system without noting any impact on performance.    Without more information on your hardware setup it is difficult to guess why you are seeing such an impact.

  • Upvote 1
Link to comment
18 minutes ago, itimpi said:

You can definitely pre-clear on another machine.

 

It is surprising that you are seeing much impact from a pre-clear.    I know I can pre-clear a couple of drives on my system without noting any impact on performance.    Without more information on your hardware setup it is difficult to guess why you are seeing such an impact.

I realized that it's easy to pre-clear using tools like WD Data Guardian, etc. Those tools also write zeroes to all sectors of the drive and would force any bad sectors to get re-allocated. Then I could take the drive and add it to unRAID, after formatting in XFS. I assume this would work as it would be similar to just formatting the drive with XFS without running a pre-clear. As most of my drives range in age from 2 - 4 years old, I prefer the full test with bad sector re-allocation prior to adding to the unRAID pool.

 

Another reason for wanting to do it on another computer is that as an unRAID newbie, I'm having to occasionally reboot to get drives recognized when attached to SATA. USB drives all show up without a reboot, but SATA attached seem to require a reboot for unRAID/UD to recognize them. Plus I'm adding more Docker apps and a VM during my trial so more reboots are anticipated to ensure I have things working as I want. These reboots would stop the pre-clear and require it to start from scratch. This is a really good reason to do it on another system.

 

As for the slow copy speed, I've downloaded and attached my anonymized diagnostics from unRAID. I need to spend time acquainting myself with the logs and what to look for, but I'm more focused on getting my data onto the parity protected array at the moment. Anyone wishing to provide assistance with the diagnostics will be thanked!

 

Dale

animnas-diagnostics-20190603-1846.zip

Link to comment
4 minutes ago, AgentXXL said:

Those tools also write zeroes to all sectors of the drive and would force any bad sectors to get re-allocated. Then I could take the drive and add it to unRAID,

There's also a signature that gets written to the drive after the preclear runs so that unRaid knows that it's already cleared.  Those other tools wouldn't do that, which would force unRaid to clear it again no matter what

 

5 minutes ago, AgentXXL said:

I'm having to occasionally reboot to get drives recognized when attached to SATA. USB drives all show up without a reboot, but SATA attached seem to require a reboot for unRAID/UD to recognize them.

Make sure that AHCI is set in the BIOS for the sata ports

  • Upvote 1
Link to comment
9 minutes ago, Squid said:

There's also a signature that gets written to the drive after the preclear runs so that unRaid knows that it's already cleared.  Those other tools wouldn't do that, which would force unRaid to clear it again no matter what

 

Make sure that AHCI is set in the BIOS for the sata ports

Ahh, didn't think about the signature. Is it mandatory? If I pre-clear using other tools, it has the same effect. Definitely should be simple enough to get a secondary clear avoided by unRAID. Or is there a tool or way of running unRAID without purchasing a 2nd license just to accomplish that task?

 

It would also be fine if there was a way to pause the pre-clear to allow for a reboot. Pre-clear seems to take about 1.5 - 2 hrs per terabyte, so pausing and saving the state would benefit those of us that need to restart.

 

And yes, my motherboard SATA ports are set to AHCI. I seem to remember a way of making the motherboard SATA ports all hot-swap capable in the past, but I didn't find that option when I went through the BIOS prior to 1st installing unRAID. Onboard SATA is alll I'm using right now as I wait for my LSI 16 port controller to arrive from China.

 

Dale

Edited by AgentXXL
Link to comment
2 minutes ago, AgentXXL said:

Ahh, didn't think about the signature. Is it mandatory?

Yes.  Because how is unRaid supposed to know if it's cleared or not without reading each and every byte?

2 minutes ago, AgentXXL said:

Or is there a tool or way of running unRAID without purchasing a 2nd license just to accomplish that task?

Use another flash drive and run a trial on it.  Preclear doesn't need to have the array even started for it to do its thing, so effectively the trial will last forever.

  • Upvote 1
Link to comment
4 minutes ago, Squid said:

Yes.  Because how is unRaid supposed to know if it's cleared or not without reading each and every byte?

Use another flash drive and run a trial on it.  Preclear doesn't need to have the array even started for it to do its thing, so effectively the trial will last forever.

Still should be a relatively simple fix to allow the user to check a box indicating to unRAID that the drive was pre-cleared externally. A thought for a future feature request I guess.

 

Running another trial of unRAID that doesn't expire is a valid option, but requires another computer dedicated to unRAID. I've seen mention of VMs running unRAID so I suspect that's the easy route. As long as I can figure out passing a SATA port directly to the VM, as it doesn't appear pre-clear works from USB attached devices.

 

At least it doesn't seem to offer the pre-clear option on any of the USB (and unmounted) devices showing up in UD. Is there a setting to allow pre-clear for USB attached drives?

 

Link to comment
38 minutes ago, AgentXXL said:

Still should be a relatively simple fix to allow the user to check a box indicating to unRAID that the drive was pre-cleared externally. A thought for a future feature request I guess.

Problem is, people in general have no clue how parity works in unraid, and even less of a clue that formatted is NOT clear. If this was implemented I guarantee there would be data loss within the first week, when someone put a freshly formatted drive in, told unraid it was clear, and then had a drive failure.

  • Upvote 3
Link to comment
12 minutes ago, jonathanm said:

Problem is, people in general have no clue how parity works in unraid, and even less of a clue that formatted is NOT clear. If this was implemented I guarantee there would be data loss within the first week, when someone put a freshly formatted drive in, told unraid it was clear, and then had a drive failure.

If the drive is pre-cleared and the user accepts the risk, then it shouldn't be an issue. Besides, adding a pre-cleared drive shouldn't add much overhead to the parity disk as if they accept the risk, unRAID can just add the parity for a zeroed drive of that size - even a drive with reallocated sectors will require minimal calculation to add to the parity set. No need to scan and re-check the drive again.

 

To my understanding, the parity calculation for a pre-cleared drive is very simple, so externally pre-cleared shouldn't be any worse. But I'll accept the fact that I can do it with a VM and SATA pass-through. I'll likely add an eSATA controller to my other PC so I can pre-clear drives using an external eSATA case.

 

 

Link to comment

Adding a pre-cleared drive adds NOTHING to parity - if correctly pre-cleared then parity does not change.  As a result Unraid makes no checks of parity when adding a pre-cleared Disk.   If that assumption turns out to be wrong because a disk was not actually pre-cleared correctly then recovery of any failed disk at a later date will also fail.  That is high risk which is why Unraid will not take a users word that a disk is pre-cleared.

  • Upvote 2
Link to comment
37 minutes ago, itimpi said:

Adding a pre-cleared drive adds NOTHING to parity - if correctly pre-cleared then parity does not change.  As a result Unraid makes no checks of parity when adding a pre-cleared Disk.   If that assumption turns out to be wrong because a disk was not actually pre-cleared correctly then recovery of any failed disk at a later date will also fail.  That is high risk which is why Unraid will not take a users word that a disk is pre-cleared.

I understand and completely agree. If the user accepts the risk, it's their fault if they didn't properly clear the disk. As I said, it's moot as I can spin up a VM on another system and run unRAID in it with the eSATA pass-through as mentioned above. As a last option, why not create a standalone app which is built on Linux (like unRAID) with the specific purpose of pre-clearing drives for unRAID. Make it a Docker container so that's all that happens, isolating it from other influences.

 

This is all related, but my real issue still is what's causing unRAID to experience poor copy performance from the UD mounted, SATA attached drive? If it's not pre-clear and DMA/PCI-e bandwidth, it's some other unusual bottleneck. I want to reboot to see if it's consistent, but I'm only 75% through stage 2 of zeroing the current drive. Again, even the ability to save the state and pause a pre-clear would be great. This would allow a reboot to be performed and would make troubleshooting easier. 

Link to comment

You do realise that pre-clear is not really needed any more in terms of the main Unraid system as Unraid no longer takes the array offline while it does a clear.   This means that one could easily use the drive manufacturers test tools on any system to do the initial stress test of the disk and then just let Unraid go through its clear step when you actually add it to the Unraid system.

  • Like 1
Link to comment
You do realise that pre-clear is not really needed any more in terms of the main Unraid system as Unraid no longer takes the array offline while it does a clear.   This means that one could easily use the drive manufacturers test tools on any system to do the initial stress test of the disk and then just let Unraid go through its clear step when you actually add it to the Unraid system.

Thanks. Did not know that about the array staying online during clear. Is there a specific order to do things to make sure this happens when you add a new drive ?
So off array, add and assingn new drive and start array will fully start array and then do clear separately in background ?
Link to comment
4 minutes ago, itimpi said:

You do realise that pre-clear is not really needed any more in terms of the main Unraid system as Unraid no longer takes the array offline while it does a clear.   This means that one could easily use the drive manufacturers test tools on any system to do the initial stress test of the disk and then just let Unraid go through its clear step when you actually add it to the Unraid system.

Yes, but unless I'm mistaken, that's more time waiting for the drive to be added to the available storage. Pre-testing with a manufacturers or other tool could do the stress test, but unRAID would still have to spend more time doing its clear pass. Might as well do it all under unRAID as after the pre-clear, it's a simple format, stop array, assign disk, start array. 

Link to comment
11 hours ago, AgentXXL said:

At least it doesn't seem to offer the pre-clear option on any of the USB (and unmounted) devices showing up in UD. Is there a setting to allow pre-clear for USB attached drives?

I certainly get offered pre-clear for my USB devices in UD.   I do not have any spare SATA slots on my motherboard/HBA so that is the way I preclear drives.   I do have 'destructive' mode enabled in the UD settings but I am not sure that is a pre-requisite.   It might make a difference that the USB dock I am using exposes the SMART attributes of the drive - I know that many do not.

Edited by itimpi
Link to comment
9 hours ago, itimpi said:

I certainly get offered pre-clear for my USB devices in UD.   I do not have any spare SATA slots on my motherboard/HBA so that is the way I preclear drives.   I do have 'destructive' mode enabled in the UD settings but I am not sure that is a pre-requisite.   It might make a difference that the USB dock I am using exposes the SMART attributes of the drive - I know that many do not.

I also have destructive mode enabled in UD. I've seen temps from the USB attached drives but not sure if they support SMART. Not a major issue, but certainly would make it easier to pre-clear a drive attached via USB 3.x.... easy to pass USB ports to a VM. I'll investigate if any of my USB drives support SMART, but I suspect not if the pre-clear option isn't being offered.

 

Alas now I have another concern. I waited for the pre-clear to finish on the 4TB drive I mentioned a few posts back and then I rebooted. I ran into some weird issue where even though the BIOS saw the USB flash drive as a bootable device, it would constantly check the other attached drives before failing to the BIOS setup screen.  I'm concerned that the USB flash drive may be failing as it had so many issues with the reboot attempts.

 

I have backed up the flash from the unRAID webgui, but I've heard that the backup is only really useful for a USB drive that gets temporarily corrupted but is fine hardware-wise. As I'm now sure that unRAID is the right choice for my needs and I will be buying a Pro license, I'm concerned about ensuring I can retain access to the array. I'll avoid making further reboot attempts as long as the system doesn't lockup while waiting for the slow copy mentioned below to finish.

 

As for the multiple failed reboots, I walked through all of the BIOS settings numerous times, with careful notes on settings changed before each reboot. For some reason, it decided to boot again, but only after I started the system with all the other USB drives disconnected. The only real change from before being that I did find and enable the option to make the motherboard SATA ports hot-swap enabled. I doubt this would have affected the fact that I set the USB flash drive in BIOS to be the 1st and only bootable device.

 

Alas after it was booted and the USB drives re-connected, I'm still seeing relatively slow copy performance from a SATA attached 8TB drive to the unRAID array. That 8TB drive has started throwing CRC errors according to unRAID so I'm hoping it's not a sign of imminent failure. Regardless, it's the drive currently being VERY slowly copied to the array.

 

I also might have one other issue - the 4TB drive pre-clear that was holding up my reboot also may have failed to properly finish the pre-clear script. The report and logs showed success for all 3 stages. However, it took switching between the Main and Dashboard tabs of the unRAID webgui for it to popup the dialog asking if I wanted to anonymously send the pre-clear stats to the script developer. I did click SEND and then nothing happened with the drive.

 

But even though this may be normal, I had to click the red X beside the pre-clear report and log icons to end the pre-clear. That let me mount the drive and format it to XFS. I'll wait for the data copy to finish before I try and stop the array, assign the disk, and then restart the array. Hopefully the pre-clear signature that unRAID looks for was written and that unRAID will be able to add it after the copy finishes (tomorrow at the earliest given current speeds being reported by the Krusader docker app).

 

In any case, the pre-clear issue is less of a concern than both the slow copy performance and the reboot issue. I'm wondering about the other USB drives. When I click on the subscript '+' sign beside a disk icon in UD, it shows an unmounted partion with the option of a red x or a button labelled Insert where Mount and Format usually appear. I'm trying to find out what the red x does - i'm thinking it may be remove the non-mounted parttion. This is likely the 1st partion on modern GPT disks, normally used for EFI when the disk is bootable. I'm wondering if I can remove those partitions and leave it as free space, as those small GPT partitions might be what's causing my reboot issue?

 

Sorry for the lengthy reply. Hope someone can offer suggestions 1st and foremost about ensuring access to the array if the current USB flash drive fails. If removing the small GPT partitions on the USB hard drives is safe, I'll do that too in the hopes that it might simplify and eliminate the boot device issue. Of course secondarily, the slow copy performance and the potential pre-clear failure are less of a concern.

 

Thanks again for the help and pointers!

 

Dale

Link to comment

just my 2 cents...

 

  I always pre-clear my drives, usually on a separate computer, to complete my initial stress testing.  No you do not need a dedicated computer for it, it only needs to be available for the dedicated purpose of running pre-clear on disks as it is pre-clearing disks!

 

  I have a few computers that I have a flash drive next to, that IF I need them to pre-clear a drive, I just stick the USB flash in the computer, hook up the drive(s) I need to pre-clear, boot and start pre-clearing.  When I am done, I shut off the computer, remove the pre-cleared drives, and the USB flash, then I am ready to use the computer again under normal OS uses for the computer.

 

  One word of caution, either unplug the other hard drives in the computer before pre-clearing drives, or MAKE SURE YOU ARE TRIPLE checking you are selecting the correct drives to pre-clear!

 

  The alternative is that I actually run the pre-clear on the machine running unraid that is getting the new drive.  I also find this method ok sometimes, but more frequently limiting as I also need to stop the array first, and shut down the computer.  As long as the drive passes, no problem.  If the drive fails however, which can and does happen with new drives or old drive being re-purposed, I have lost some additional server time with additional needed power downs.  This is why I usually use a seperate computer for pre-clears.

 

  Also, the computers running pre-clear do not need to be as powerful as the one you would normally want to run unraid on now.  All my computers that I run pre-clears on separately are just old P4 computers.  they work very well for pre-clearing drives!

Edited by electron286
Added to avoid a double post about older computers work well for the stand-alone pre-clearing.
  • Upvote 1
Link to comment
2 hours ago, electron286 said:

just my 2 cents...

 

  I always pre-clear my drives, usually on a separate computer, to complete my initial stress testing.  No you do not need a dedicated computer for it, it only needs to be available for the dedicated purpose of running pre-clear on disks as it is pre-clearing disks!

.

.

 

 Also, the computers running pre-clear do not need to be as powerful as the one you would normally want to run unraid on now.  All my computers that I run pre-clears on separately are just old P4 computers.  they work very well for pre-clearing drives!

 

As mentioned above, I'm doing this via a VM running a trial of unRAID on another PC. In fact I did it once already for an older 4TB Hitachi drive that was still fairly lightly used. I pre-cleared the drive on the VM which uses an eSATA connection to an external enclosure for the drives. Made the mistake of formatting the drive with XFS before attaching it to the full unRAID build, so the signature got erased and the array had to do its own clear procedure. Lesson learned. Thanks for your input... at least I'm on the right track now.

 

Link to comment
2 hours ago, AgentXXL said:

formatting the drive with XFS before attaching it to the full unRAID build, so the signature got erased and the array had to do its own clear procedure.

Erasing the signature wasn't the critical part, the format was. Formatting adds the blank file system information to the drive, which means it's no longer clear. Think of a clear hard drive as a completely empty room. The file format would be like the filing cabinets you add to the room to make it capable of holding file folders with files in it. It's the organizational system.

 

Parity emulates the entire room, filing cabinets (file system, XFS in this case) and all. In order to not affect valid parity, the room you add must be completely empty, adding the file system and any files must be done after Unraid has started tracking and synchronizing changes with the parity drive.

  • Like 1
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.