Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PreClear commands

Featured Replies

OK, so a ways back there was the various methods for running preclear and various drives.  Most notably, WD drives with a jumper or without, with -A and without -A

 

It has been some time and I know a lot has changed so before I went assuming things I wanted to confirm the commands I wanted to run.

 

I am adding 3 new drives, a Toshiba 3TB, A Seagate 3TB and a WD EARS 2TB.  I had a 3TB Red as well, but I am not adding it at this time as I want to use it to replace my Parity drive at some point.

 

Regardless, my array is currently set to MBR: 4K-Alligned.  I added some Seagate 3TB drives recently and I believe I just used -A.

 

Before posting I searched some more and found the following from Joe L:

The use of the "-a" or "-A" option is completely ignored with drives over 2.2TB.  They always are aligned on a 4k boundary and do not use an MBR partition except to appease older utilities. Instead, they use a GPT partition. (There is a "protective" partition put into the MBR starting on sector 1. with the full 2.2TB it can define utilized.  Again, this is just so some older utility that reads the drive, such as "fdisk", would think the drive is entirely allocated.)

 

So, with any drive > 2.2TB, there is no 'wrong" way to invoke the preclear script.  The -a or -A options are silently ignored. You can supply either, or neither, and it will work just the same.  Even though the drive says it is an advanced format, it still presents the logical blocks to the OS as 512 byte blocks.  (Some things never change)  The "advanced format" just means they put a checksum on the disk every 4096 bytes instead of every 512 bytes on the disk.  Fewer checksums means more room for data.  (I guess that is the advanced part... the marketing dept makes more of this than the engineering dept.) 

 

Joe L.

 

So, I assume the only real thing to worry about is the 2TB WD and for it I assume no jumper and -A, correct?

 

 

You don't need to use any switches at all.

 

The -A is only needed if you're pre-clearing an advanced format drive using UnRAID v4.7

 

It's NOT needed when you're running v5

 

  • Author

Oh heck, that is even easier.  Thanks.

 

So in v5 all switches are essentially thrown out.  Good to know.

You don't need to use any switches at all.

 

The -A is only needed if you're pre-clearing an advanced format drive using UnRAID v4.7

 

It's NOT needed when you're running v5

NOT true.
  • Author

Joe,  any chance you can elaborate then,  before I start 3 clears for the next 20+ hours

You don't need to use any switches at all.

 

The -A is only needed if you're pre-clearing an advanced format drive using UnRAID v4.7

 

It's NOT needed when you're running v5

NOT true.

 

??  I actually based that on your comments in your pre-clear details here:  http://lime-technology.com/forum/index.php?topic=2817.0

 

Note:  "... If on version 4.7 of unRAID and you are clearing an ADVANCED FORMAT drive that works best with a 4k alignment of its data, use the "-A" option ..."

 

My understanding was that all you had to do with v5.0 was set the appropriate default in UnRAID, and pre-clear would no longer require the -A option.  Is that not correct??

 

 

Joe,

 

... in fact, here's another quote from the pre-clear details I mentioned above:

 

"... If you are running unRAID 4.7 onward, in the absence of either a "-a" or "-A" option specified on the command line, preclear_disk.sh will use the alignment preference you specified in the unRAID settings screen as its default. "

 

Since v5.0 defaults to MBR-4k aligned, that would seem to mean you do NOT need the -A option.    You wrote the script, so I certainly am interested in why you said that's not true !!

 

Joe,

 

... in fact, here's another quote from the pre-clear details I mentioned above:

 

"... If you are running unRAID 4.7 onward, in the absence of either a "-a" or "-A" option specified on the command line, preclear_disk.sh will use the alignment preference you specified in the unRAID settings screen as its default. "

 

Since v5.0 defaults to MBR-4k aligned, that would seem to mean you do NOT need the -A option.    You wrote the script, so I certainly am interested in why you said that's not true !!

You have no idea which setting is in effect in the user's server as their default setting.  Therefore, your original statement is wrong because you did not mention its involvement.

 

IF the user has elected to set the alignment preference to something other 4k-aligned, then the absence of  "-A" would NOT result in a 4k aligned disk.  Earlier 5.X releases did not have the same default alignment, and if an upgrade from one of them had occurred, the user's preference would not have been changed. 

 

Best advice these days, "always use the -A option" 

 

Joe L.

So, I assume the only real thing to worry about is the 2TB WD EARS and for it I assume no jumper and -A, correct?

Correct.    (although I seem t remember the EARS disk that needed a jumper to perform better if partitioned to start the partition on sector 63 was a 1TB drive... )

Yes, I should have confirmed that he hadn't changed the default setting in v5.0 => or, better yet, suggested that he ensured it was set for 4k aligned.

 

I should have quoted your note in the pre-clear documentation that noted:  "... If you are running unRAID 4.7 onward, in the absence of either a "-a" or "-A" option specified on the command line, preclear_disk.sh will use the alignment preference you specified in the unRAID settings screen as its default."

... and made sure he had checked that his system was indeed set for that default.

 

Just to confirm, however, are you sure that pre-clear indeed uses the default set in v5.0?    I know there's a bug in the -l command that will result in listing drives in the array as available for pre-clear unless the array is not only Started, but the Web GUI has also been accessed -- just curious if that may also indicate there are cases where the default alignment won't be used either.

 

If there's any doubt about that, I'd certainly agree that using -A is a good plan (at least for drives that aren't > 2TB).

 

By the way, the 2TB EARS drives did indeed need a jumper.

 

In addition to this -A option I personally use some additional options to provide support for mail notifications and avoiding out-of-memory issues when running multiple pre_clears simultaneously. I use the following command line to start each pre_clear (and yes, I have the 4k aligned setting in effect thus the missing -A):

preclear_disk.sh -r 65536 -w 65536 -b 2000 -M 4 /dev/sdx

Yes, I should have confirmed that he hadn't changed the default setting in v5.0 => or, better yet, suggested that he ensured it was set for 4k aligned.

 

I should have quoted your note in the pre-clear documentation that noted:  "... If you are running unRAID 4.7 onward, in the absence of either a "-a" or "-A" option specified on the command line, preclear_disk.sh will use the alignment preference you specified in the unRAID settings screen as its default."

... and made sure he had checked that his system was indeed set for that default.

 

Just to confirm, however, are you sure that pre-clear indeed uses the default set in v5.0?    I know there's a bug in the -l command that will result in listing drives in the array as available for pre-clear unless the array is not only Started, but the Web GUI has also been accessed -- just curious if that may also indicate there are cases where the default alignment won't be used either.

 

If there's any doubt about that, I'd certainly agree that using -A is a good plan (at least for drives that aren't > 2TB).

 

By the way, the 2TB EARS drives did indeed need a jumper.

 

hi garycase, i can confirm earlier 5.0 rc releases did NOT have the 4k aligned set in settings and thus somebody upgrading will have this set incorrectly, so i would agree with joe about ALWAYS specifying -A, at the end of the day it does no harm to align drives that dont require it, so why not just always specify it eh, at least thats what im doing.

 

Certainly doesn't hurt -- although I can confirm that v5.0 definitely defaults to 4k-aligned => just to confirm I just downloaded a fresh copy, reformatted one of my test flash drives and loaded it on it; and booted.    That's also true on my v5.0 test system, which was created when v5.0 was first released ... and I've made zero changes to it.

 

One easy way to avoid the whole issue is just don't use any small drives  :)

There's really no reason to use anything smaller than 3TB these days -- personally I'll never buy anything smaller than 4TB in the future.

 

 

This whole not needing -A or needing -A when preclearing with version 5 (preclear 1.13) is confusing. I just precleared and 4TB and a 3TB WITHOUT -A option. The script itself stated it would not be set to sector 63 and WOULD NOT BE 4k aligned (perhaps that is just info from 1.12 that was never updated in the script)

 

However things seem to be fine I guess without the -A option for disks bigger then 2.2TB. Perhaps the script can be edited sometime to avoid the confusion ?

ignoring unraid setting for alignment (as its not consistently set correctly for earlier beta/release candidates) and relying on the script to control alignment, the rule for the pre-clear script goes as follows:-

 

if the drive is equal to 2TB or less in capacity AND the drive is marked as "Advanced Format" then you will need to use the -A flag, otherwise you will get performance degradation.

 

as i suggested earlier there is no harm in using the -A flag when pre-clearing ALL drives, whatever size and whether Advanced format or not.

 

please let me know if the above is NOT correct, as this has been my understanding for some time.

As far as I know, it's correct that simply always using -A won't cause any issues.

 

But it's also supposed to be true that if you set the default alignment in UnRAID to 4k-aligned then -A should never be required.    Hopefully Joe L can confirm that this is indeed the case => as I noted earlier there is a bug in the way the script interacts with UnRAID vis-à-vis the -L command when running v5.0 ... hopefully this isn't also true with -A

 

if the drive is equal to 2TB or less in capacity AND the drive is marked as "Advanced Format" then you will need to use the -A flag, otherwise you will MAY get performance degradation.

 

as i suggested earlier there is no harm in using the -A flag when pre-clearing ALL drives, whatever size and whether Advanced format or not.

 

please let me know if the above is NOT correct, as this has been my understanding for some time.

Many advanced format drives work perfectly fine regardless of where their partition starts.  It was only those early WD EARS drives that in SOME tests with small files had performance degraded.  At the same time, there were many users of those same drives who used them for media playback (large files) and never noticed any issue. 

 

So, you MAY have performance degradation, but, it might not affect you at all..

Joe =>  Are there any issues with the script properly noting the default alignment setting in v5.0 [similar to the issues with the -L parameter] ??

 

Joe =>  Are there any issues with the script properly noting the default alignment setting in v5.0 [similar to the issues with the -L parameter] ??

none I am aware of.
  • Author

Thanks guys for the feedback,  most helpful indeed.  -A for all.

 

Anyone want to break down henris,  preclear command?

 

I am simply running - A without all the extra stuff.  He mentioned potential memory issues when running multiple clears.  I currently running 3, so am very curious.

Anyone want to break down henris,  preclear command?

 

I am simply running - A without all the extra stuff.  He mentioned potential memory issues when running multiple clears.  I currently running 3, so am very curious.

The recommendation is taken from the wiki: http://lime-technology.com/wiki/index.php/Configuration_Tutorial#Preclearing_With_Screen

 

Personally I have never experienced out-of-memory (OOM) problems even running four simultaneous preclears without those options. But I have at least 4GB memory on all my servers. There have been posts about OOM so it can happen. This is the recommendation and since I'm using the screen with multiple preclears, I'm also adhering to it.

 

I was unable to find the post or wiki entry where the -M 4 option is explained, it wasn't on the main preclear thread where I thought it would be. Perhaps someone else can point to it? It will in any case send out emails in certain intervals and you need to have mail/smtp installed.

I have a preclear station (ASUS P5Q-EM MB with Q6600 and 4GB Mem) running free unRAID.  I can only preclear 2 3TB drives or less on it before memory errors start - sorry it has been so long I don't remember what I got.  I believe it was the OOM killing off unused processes like emhttp and unMenu but I could be wrong.  When doing more than 2 3TB+ drives I add the -w, -r & -b command to reduce the memory foot print of preclear but that increases the time since I tend to be quite conservative with the parameters.

 

My desktop that has 8GB of memory that I sometimes use to preclear drives has done 4 3TB drives and no -w, -r & -b parameters without a problem.  Not sure how many I could do as I don't use it much.

  • Author

Where would the oom errors appear,  in the syslog?  Also,  does the preclear just fail when this happens?

Where would the oom errors appear,  in the syslog?  Also,  does the preclear just fail when this happens?

You can see the OOM errors in the syslog.  The preclear would keep running until it too was killed by OOM I believe.  But that happened to me a LOOONG time ago and I don't really remember much about it I just remember the preclear appeared to have failed.  I couldn't access the GUI or unMENU and there was a problem with the console sessions that were running preclear - that is the part that I don't remember.  Since it didn't have an array on it I didn't need to worry about that so I just rebooted it.  Since the drives were the first 3TB drives I owned and I wanted to see how long a cycle took - I made it a point to check on it frequently until it finished the first cycle.  Some time after that it died but I have no idea when it could have been in cycle 2 or 3.  I might have been able to tell from the log but at the time I didn't think about that.  I ended up running one more complete cycle just to make sure it got 3 total.  It is possible it was a hardware problem too but I've never had any other problems and I haven't changed anything on it other than the drives being precleared.  To be safe and not waist time having to redo a preclear over again I always use the parameters on that box or clear the drives 1 or 2 at a time when using drives > 2TB (which is most drives nowadays). 

 

 

Edit:  I have 3 3TB Seagates coming first of next week that I can try this again.  Not in a particular hurry so if it dies again no big deal.  I can also capture the syslog with the keeplogs script I downloaded a while back if I can find it.  If it runs then it was just a hardware glitch.  If it dies I will have a log I can upload.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.