January 15, 201115 yr A new version of preclear_disk.sh that can now also clear for Advanced Format 4k aligned partitioning is now available. It can be used to clear both advanced-format drive or older non-advanced-format drives. Edit: Feb 1, 2011. Newest 1.3 version of preclear_disk.sh will use the "default' setting you've elected in the unRAID settings screen if you do not select the "-A" or "-a" options. You can override with either "-A" (for sector 64) or "-a" (for sector 63) start position of the partition. It also adds copies the final report to /boot/preclear_reports unless a "-R" option is given to suppress that copy to the /boot/preclear_results subdirectory. It has two new options. They are: -A = force starting sector to be on sector 64 for 4k alignment. -l = list disks and affiliated devices that are potential for clearing. Makes it easier to identify correct device for new unRAID users. If used on versions of unRAID prior to 4.7beta1, do not use the new "-A" option if you intend to have the pre-clear signature on the disk recognized by the older version of unRAID. It will not be recognized, and unRAID will clear the disk prior to formatting it. No harm will be done to the disk, but your server will be off-line while unRAID clears it. You can use the "-A" option on any version of unRAID if you intend on upgrading to 4.7 before assigning the disk to the array. Just do not assign the newly cleared disk to the 4.6 or prior array. (or, if you do, expect it to not be recognized as pre-cleared, and an older non-4k aligned partition starting on sector 63 to be created on the disk when the older version of unRAID clears it itself.) If used without the new "-A" option, the preclear process will create a preclear-signature recognized by any version of unnRAID. The resulting disk will start its partition on sector 63 exactly as it has in all previous versions of unRAID. If you have jumpered an EARS drive, you do NOT want to use the "-A" option or you will force a mis-alignment. (The jumper electrically fixes the mis-alignment of a partition starting on sector 63) If used with the new "-A" option, the preclear-signature will be recognized by by unRAID 4.7beta1 onward as requesting a partition aligned on 4k boundaries and you will get optimal performance from advanced format drives that are NOT jumpered. If you use the older preclear_disk.sh script, or forget to use the "-A" option on the new version, the partition on the cleared drive will start at sector 63 and you may not get the best performance out of a drive using 4k sectors internally. It will still work, and many have disks installed without jumpers in unRAID 4.6 and previous, They just may be slight slower, but still fast enough to serve music/movies, etc. Important: Disks with partitions starting on sector 64 will be considered as unformatted if you revert to an older version of unRAID. DO NOT REVERT, or if you do, expect to see unformatted for the disks you asked to be partitioned starting on sector 64. If you format those drives on the older version of unRAID you will lose the data on that drive. You have been warned... The new preclear_disk.sh script has a simplified report at its completion compared to the old. It only prints SMART parameters that have changed, or have failed, or where the current value is nearing the failure threshold and it ignores values changing from factory initialized values to initial 100 or 200 values. The new preclear_disk.sh script is attached to the end of the first post in this thread: http://lime-technology.com/forum/index.php?topic=2817.0 To use the new script asking for a 4k alignment, for use on version of unRAID 4.7beta1 onward, type: preclear_disk.sh -A /dev/sdX ( where /dev/sdX = the device affiliated with your hard disk ) To use it for disks to be installed in any older version of unRAID, just do not use the "-A" option like this: preclear_disk.sh /dev/sdX Oh yes, there is a new feature in the new preclear_disk.sh script that will help you to identify the "device" affiliated with a drive to be cleared. You can get a list of potential drives by typing: preclear_disk.sh -l The output will look like this: root@Tower:/boot# preclear_disk.sh -l ======================================== Disks not assigned to the unRAID array (potential candidates for clearing) ======================================== /dev/sdc = ata-Maxtor_6Y250P0_Y63KH45E /dev/hdj = ata-QUANTUM_FIREBALLlct15_08_611020017228 Joe L.
January 15, 201115 yr I think I know the answer to this question, but just want to confirm. Is there any problem in using this preclear script to preclear a disk in a pre-4.7 version (e.g., 4.6 or 5.0b2). I know the precleared disks can't be added to an array (or else face being repartitioned and cleared by the earlier version of unRAID), but if someone is planning to to upgrade soon, and has a stack of disks to preclear, any reason they have to wait to preclear them after they upgrade.
January 15, 201115 yr Author I think I know the answer to this question, but just want to confirm. Is there any problem in using this preclear script to preclear a disk in a pre-4.7 version (e.g., 4.6 or 5.0b2). I know the precleared disks can't be added to an array (or else face being repartitioned and cleared by the earlier version of unRAID), but if someone is planning to to upgrade soon, and has a stack of disks to preclear, any reason they have to wait to preclear them after they upgrade. You can use this script to pre-clear a disk for any version of uRAID. However, if you use the new "-A" option on a older version of unRAID the preclear signature will not be recognized by the older version of unRAID and it will proceed to clear the drive on its own if you assign them to the array in that older version. They will be recognized as pre-cleared when you upgrade to 4.7beta1 and beyond. Other than that, it is safe to use on any version. 99 percent of the clearing code is identical., The difference is the starting sector for the newly created partition if you use the -A option. Preclear away. Just remember, a disk cleared with the "-A" option will not be recognized as pre-cleared in 4.6 unRAID and previous and will still end up with a partition on sector 63. The preclear-signature created with the use of the "-A" option will be recognized in unRAID 4.7beta1 and the resulting partition will start on sector 64 when the disk assigned to the array. Joe L.
January 20, 201115 yr How long does this take to run, roughly? I kicked this off on a 1.0 TB 7200 RPM sata II disk last night around 7pm, I got the one email at the beginning but haven't see an another email since. Here's what was in the original email: Pre Read Started on /dev/sde 0% complete. ( 0 of 1,000,204,886,016 bytes read ) Disk Temperature: 23C, Using Block size of 8,225,280 Bytes Next report at 25% ----------------------------------------------------------------- This message sent from unRAID server Tower Just wondering when I should expect it to complete. Thanks for the script!
January 20, 201115 yr how did you kick it off? was it from a telnet session? is the telnet session still open? if you didn't keep the telnet session connected, then the script ended when the telnet session ended. otherwise, you should be able to look at the session where you kicked it off and see the progress where it is at.
January 20, 201115 yr I kicked it off via putty/telnet. I hibernated the machine, so I'm not positive the telnet session is still going. Guess Ill have to hook up my monitor/keyboard and kick it off that way.... Dang that was dumb of me.
January 20, 201115 yr If I started a preclear without the -A option, stopped it, then started again with the -A option. Is there anything else I would need to do?
January 20, 201115 yr I kicked it off via putty/telnet. I hibernated the machine, so I'm not positive the telnet session is still going. Guess Ill have to hook up my monitor/keyboard and kick it off that way.... Dang that was dumb of me. Hibernating the machine or letting it go to sleep will disconnect the telnet session. Look through the Configuration Tutorial for an explanation on how to use "screen". It will allow you to start something through a telnet connection and then disconnect from the server and let the other machine hibernate.
January 20, 201115 yr Author If I started a preclear without the -A option, stopped it, then started again with the -A option. Is there anything else I would need to do? no.
January 21, 201115 yr Thanks for pointing me to screen/unmenu. Kicking preclear off via screen worked for me, its still clearing and Im getting the progress emails now. Thanks much! i love my unraid!
January 21, 201115 yr Quick Question.. You can use the new -A flag for any disk, not just the Advanced formatting ones. Executing it on a 320g IDE hard drive would be just fine?
January 21, 201115 yr Yes, you can select to use sector 64 partition start on non-advanced format drives. I don't know of the performance implications, if any, in doing so.
January 21, 201115 yr Author Yes, you can select to use sector 64 partition start on non-advanced format drives. I don't know of the performance implications, if any, in doing so. There should be absolutely no effect at all, because a sector aligned at a 4k boundary is also aligned at a 512byte boundary. The start on sector 63 was historical to accommodate old MS-DOS and early MS-windows utilities.
January 21, 201115 yr I wasn't certain about performance because I do not know if some old(er) drives might be better aligned on cylinder boundaries or had firmware more tuned towards that than byte boundaries?
January 21, 201115 yr Author I wasn't certain about performance because I do not know if some old(er) drives might be better aligned on cylinder boundaries or had firmware more tuned towards that than byte boundaries? No disk has had a fixed number of sectors probably since the mid 80s. They are all linear addressed with a variable number of sectors per cylinder. Joe L.
January 21, 201115 yr I thought that I read this somewhere...With the newest version of the preclear, does it automatically save the results with the name of the disk? Maybe I was reading something else.
January 23, 201115 yr Author I thought that I read this somewhere...With the newest version of the preclear, does it automatically save the results with the name of the disk? Maybe I was reading something else. It saves the SMART reports to /tmp/smart_start_sdX and /tmp/smart_finish_sdX. (also in /var/log directory ) look in /var/log/syslog for the complete results including the analysis of the two smart reports. Joe L.
January 23, 201115 yr Author Newest version 1.1 of preclear_disk.sh is now attached to the original thread here: http://lime-technology.com/forum/index.php?topic=2817.0 New features are: Edit: Jan 23, 2011 1.1 Added -C 63 option to quickly convert a precleared disk from a sector 64 to sector 63 start Added -C 64 option to quickly convert a precleared disk from a sector 63 to sector 64 start Added display of command line arguments to confirmation screen. Added display of preclear_script.sh version to display screen. Added -W option to skip "preread" and start with "write" of zeros to the drive. Added -V option to skip the "preread" and "clear" and only perform the post-read verify. Some improvement to make sure the logged results in the syslog are more complete. Joe L.
January 23, 201115 yr Nice work as always Joe L. The preclear conversion seemed to work fine on my two experimental drives. Very nice touch on the -V option not needing the -A option and detecting the drive is setup for Sector 64! # preclear_disk.sh -t /dev/sdg Pre-Clear unRAID Disk /dev/sdg ################################################################## 1.1 Device Model: ST32000542AS Serial Number: 5XW1J686 Firmware Version: CC35 User Capacity: 2,000,398,934,016 bytes Disk /dev/sdg: 2000.4 GB, 2000398934016 bytes 255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdg1 64 3907029167 1953514552 0 Empty ######################################################################## ============================================================================ == == DISK /dev/sdg IS PRECLEARED with a starting sector of 64 == ============================================================================ # preclear_disk.sh -V /dev/sdg Pre-Clear unRAID Disk /dev/sdg ################################################################## 1.1 Device Model: ST32000542AS Serial Number: 5XW1J686 Firmware Version: CC35 User Capacity: 2,000,398,934,016 bytes Disk /dev/sdg: 2000.4 GB, 2000398934016 bytes 255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdg1 64 3907029167 1953514552 0 Empty ######################################################################## invoked as /sbin/preclear_disk.sh -V /dev/sdg ######################################################################## This disk will be verified for a traditional partition starting on sector 63. Are you sure you want to verify this drive? (it will not be writen to at all) (Answer Yes to continue. Capital 'Y', lower case 'es'): Yes ================================================================== 1.1 = unRAID server Pre-Clear disk /dev/sdg = cycle 1 of 1, partition start on sector 63 = = invoked as: /sbin/preclear_disk.sh -V /dev/sdg = = = = = = = Step 1 through 9 skipped, verify phase will be performed next = Step 10 of 10 - The MBR is NOT verified cleared . = However, its MBR is verified for 4k-alignment starting on sector 64 = Post-Read in progress: 0% complete. ( 0 of 2,000,398,934,016 bytes read ) Disk Temperature: 22C, Elapsed Time: 0:00:03 ================================================================== 1.1 = unRAID server Pre-Clear disk /dev/sdg = cycle 1 of 1, partition start on sector 64 = = invoked as: /sbin/preclear_disk.sh -V -A /dev/sdg = = = = = = = Step 1 through 9 skipped, verify phase will be performed next = Step 10 of 10 - The MBR is verified cleared DONE = for a partition starting on sector 64. = Post-Read in progress: 0% complete. ( 200,089,600 of 2,000,398,934,016 bytes read ) 105 MB/s Disk Temperature: 23C, Elapsed Time: 0:00:05
January 25, 201115 yr if I have a EARS drive already precleared with the jumper, can I just remove the jumper and use -C 64 to convert it or would I need to preclear it again since I had the jumper on it before? The drive is not part of an array yet. The would with with 4.7 of course. Thanks
January 25, 201115 yr Author if I have a EARS drive already precleared with the jumper, can I just remove the jumper and use -C 64 to convert it or would I need to preclear it again since I had the jumper on it before? The drive is not part of an array yet. The would with with 4.7 of course. Thanks You need to pre-clear it again if you remove the jumper. The conversion will not work since the MBR will not be there to convert. You may also run into other errors... Most have found that when removing the jumper the drive reports an invalid geometry to the OS. You could remove the jumper, then zero out the existing MBR with dd if=/dev/zero count=8 of=/dev/sdX (where sdX = the correct three letter drive designation for your drive) Then re-run the preclear with the "-A" option. In about 30+ hours you'll be able to use the drive. However, unless you are completely anal about things, don't do anything... leave the jumper in place, use the drive with the sector 63 partition, which is actually at sector 64 because of the jumper. You'll get the exact same result with a hardware solution that is backwards compatible with the older versions of unRAID.
January 25, 201115 yr With the newer versions, I believe even the logging and messages were updated. I know I used to run a super old version that did not display the best results, but the new version is awesome. I mean really, can it get any easier to understand than this? Awesome work! No SMART attributes are FAILING_NOW 0 sectors were pending re-allocation before the start of the preclear. 0 sectors are pending re-allocation at the end of the preclear, the number of sectors pending re-allocation did not change. 0 sectors had been re-allocated before the start of the preclear. 0 sectors are re-allocated at the end of the preclear, the number of sectors re-allocated did not change.
January 31, 201115 yr I cant find what is the command to stop current preclear? I cant seam to find it. One of my EARS drives has stopped on 3% of pre-read while other 2 are preclearing..
Archived
This topic is now archived and is closed to further replies.