Jump to content

Re: preclear_disk.sh - a new utility to burn-in and pre-clear disks for quick add


Recommended Posts

I was using 1.7, but saw the note in the first post, so grabbed the latest at 1.9.  It still says "No un-assigned disks detected."

 

The main page of unMenu clearly shows that the drive has no partitions and is not mounted.  lsof shows that no processes are accessing it.  fdisk confirms there are no partitions.

 

It persists through reboots, too.

Can you post the contents of

/tmp/preclear_assigned_disks1

It has a summary of what unMENU thinks you have assigned or are using on your array.

Basically it is using a combination of what it finds in

/boot/config/disk.cfg

and (if it exists)

/var/local/emhttp/disks.ini

vs the available disks in the output of this command

ls --time-style='+%Y-%m-%d %I:%M%p' /dev/disk/by-id/* -l | grep -v -- "-part" | cut -c62-

Link to comment

Ok I screwed up and I can't watch the progress of my preclear but I know it is running!  Is there any results written via file at the end of the process so I can make sure everything looks kosher?  I can not reconnect to my telnet session unfortunately :(

yes, a summary reoprt is written to /boot/preclear_reports directory and to the system log.

 

If it is in the "write" phase you can follow along somewhat by typing

tail -f /tmp/zerosdX

 

where sdX = the three letter device name for your disk.   Press Control-C to stop the "tail" command.

 

Joe L.

 

The tail didn't work it said no such file and I don't have the directory preclear_reports ?

 

I know the process is still running because I see DD running with preclear.sh running as well?

Link to comment

root@Storage:/# tail -f /tmp/zerosdi

953397+1 records in

953397+1 records out

1999419203584 bytes (2.0 TB) copied, 26129 s, 76.5 MB/s

953680+1 records in

953680+1 records out

2000012697600 bytes (2.0 TB) copied, 26140.4 s, 76.5 MB/s

dd: writing `/dev/sdi': No space left on device

953864+1 records in

953863+1 records out

2000396836864 bytes (2.0 TB) copied, 26148.9 s, 76.5 MB/s

 

 

This a good sign?

Link to comment

root@Storage:/# tail -f /tmp/zerosdi

953397+1 records in

953397+1 records out

1999419203584 bytes (2.0 TB) copied, 26129 s, 76.5 MB/s

953680+1 records in

953680+1 records out

2000012697600 bytes (2.0 TB) copied, 26140.4 s, 76.5 MB/s

dd: writing `/dev/sdi': No space left on device

953864+1 records in

953863+1 records out

2000396836864 bytes (2.0 TB) copied, 26148.9 s, 76.5 MB/s

 

Yes, it is past the end of the "write" phase.  It is now in the post-read phase.

You can only look in the output of

ps -a | grep "dd"

to track how far it has gotten.  (based on the "skip" value and block size you can figure out the percentage so far.)

 

 

 

 

This a good sign?

Link to comment

root@Storage:/tmp# ps -a | grep "dd"

8672 pts/0    00:00:00 dd

 

 

That first number is growing so I don't know what it means :)

I guess you need to type

ps -af | grep "dd"

or

ps -ef | grep "dd"

to see the full command.  ( I typically use "ps -ef" )

 

The first number is the process ID.  It is just a unique number identifier of all the processes active on the server at a given point in time.  Typically it is a number between 2 and 32768 and it wraps around as it needs to get a unique number for each new process.  It indicates the "dd" command is being invoked again and again as the script reads each set of blocks in turn.  (and that is expected)

 

Joe L.

Link to comment

I was using 1.7, but saw the note in the first post, so grabbed the latest at 1.9.  It still says "No un-assigned disks detected."

 

The main page of unMenu clearly shows that the drive has no partitions and is not mounted.  lsof shows that no processes are accessing it.  fdisk confirms there are no partitions.

 

It persists through reboots, too.

Can you post the contents of

/tmp/preclear_assigned_disks1

It has a summary of what unMENU thinks you have assigned or are using on your array.

Basically it is using a combination of what it finds in

/boot/config/disk.cfg

and (if it exists)

/var/local/emhttp/disks.ini

vs the available disks in the output of this command

ls --time-style='+%Y-%m-%d %I:%M%p' /dev/disk/by-id/* -l | grep -v -- "-part" | cut -c62-

 

Contents of /tmp/preclear_assigned_disks1

|C|parity=pci-0000:01:00.0-scsi-1:0:0:0
sda|C|disk1=pci-0000:02:00.0-scsi-0:0:0:0
|C|disk2=pci-0000:01:00.0-scsi-0:0:0:0
sdd|I|device="sdd"
sdf|I|device="sdf"
sde|I|device="sde"
sdb|I|device="sdb"

 

Note here that my data drives are sde/sdf, and parity is sdd.  sdb is flash, sdc is a manually mounted device, and sda is the disk in question that I'd like to preclear.  If it helps, here are the outputs of the commands you mentioned make up the above output.

 

cat /boot/config/disk.cfg

# Disk configuration
spindownDelay=3
queueDepth=1
spinupGroups=yes
defaultFormat=2
md_num_stripes_default=1280
md_write_limit_default=768
md_sync_window_default=288
parity=pci-0000:01:00.0-scsi-1:0:0:0
disk1=pci-0000:02:00.0-scsi-0:0:0:0
disk2=pci-0000:01:00.0-scsi-0:0:0:0
diskSpindownDelay.0=-1
diskSpindownDelay.1=-1
diskSpindownDelay.2=-1
diskSpinupGroup.0=host3
diskSpinupGroup.1=host1
diskSpinupGroup.2=host2

 

cat /var/local/emhttp/disks.ini

[parity]
idx="0"
name="parity"
device="sdd"
id="WDC_WD20EARS-00MVWB0_WD-WCAZA2122977"
size="1953514552"
status="DISK_OK"
temp="32"
numReads="105"
numWrites="44"
numErrors="0"
format="MBR: 4K-aligned"
color="green-on"
fsStatus="-"
desc="WDC_WD20EARS-00MVWB0_WD-WCAZA2122977 (sdd) 1953514552"
spindownDelay="-1"
spinupGroup="host3"
deviceSb=""
idSb="WDC_WD20EARS-00MVWB0_WD-WCAZA2122977"
sizeSb="1953514552"
[disk1]
idx="1"
name="disk1"
device="sdf"
id="WDC_WD20EARS-00MVWB0_WD-WMAZA0280726"
size="1953514552"
status="DISK_OK"
temp="31"
numReads="26914"
numWrites="38"
numErrors="0"
format="MBR: 4K-aligned"
color="green-on"
fsStatus="Mounted"
desc="WDC_WD20EARS-00MVWB0_WD-WMAZA0280726 (sdf) 1953514552"
spindownDelay="-1"
spinupGroup="host1"
deviceSb="md1"
idSb="WDC_WD20EARS-00MVWB0_WD-WMAZA0280726"
sizeSb="1953514552"
fsFree="470382984"
fsSize="1953454928"
fsType="reiserfs"
[disk2]
idx="2"
name="disk2"
device="sde"
id="WDC_WD20EARS-00MVWB0_WD-WMAZA0613072"
size="1953514552"
status="DISK_OK"
temp="30"
numReads="546"
numWrites="9"
numErrors="0"
format="MBR: 4K-aligned"
color="green-on"
fsStatus="Mounted"
desc="WDC_WD20EARS-00MVWB0_WD-WMAZA0613072 (sde) 1953514552"
spindownDelay="-1"
spinupGroup="host2"
deviceSb="md2"
idSb="WDC_WD20EARS-00MVWB0_WD-WMAZA0613072"
sizeSb="1953514552"
fsFree="466424200"
fsSize="1953454928"
fsType="reiserfs"
[flash]
idx="22"
name="flash"
device="sdb"
id="USB Flash Device"
size="3915744"
status="DISK_OK"
temp="*"
numReads="2669"
numWrites="53"
numErrors="0"
format=""
color="green-on"
fsStatus="Mounted"
fsFree="3516708"
fsSize="3907564"
fsType="vfat"

 

ls --time-style='+%Y-%m-%d %I:%M%p' /dev/disk/by-id/* -l | grep -v -- "-part" | cut -c62-

ata-ST31000333AS_9TE11S5T -> ../../sda
ata-ST3120827AS_5MT2Y99S -> ../../sdc
ata-WDC_WD20EARS-00MVWB0_WD-WCAZA2122977 -> ../../sdd
ata-WDC_WD20EARS-00MVWB0_WD-WMAZA0280726 -> ../../sdf
ata-WDC_WD20EARS-00MVWB0_WD-WMAZA0613072 -> ../../sde
scsi-SATA_ST31000333AS_9TE11S5T -> ../../sda
scsi-SATA_ST3120827AS_5MT2Y99S -> ../../sdc
scsi-SATA_WDC_WD20EARS-00_WD-WCAZA2122977 -> ../../sdd
scsi-SATA_WDC_WD20EARS-00_WD-WMAZA0280726 -> ../../sdf
scsi-SATA_WDC_WD20EARS-00_WD-WMAZA0613072 -> ../../sde
usb-Lexar_JD_FireFly_AAXXZJG7JLRW21HB-0:0 -> ../../sdb
wwn-0x5000c500109b16e9 -> ../../sda
wwn-0x50014ee057be9fb9 -> ../../sdf
wwn-0x50014ee2052a2bcb -> ../../sdd
wwn-0x50014ee600670826 -> ../../sde

Link to comment

I am running 1.7 and I noticed 1.9 is out?!  Can I replace the script while it is being ran for one drive so I have the latest for the other?  Is 1.9 a significant update?  Is there a changelog anywhere?

 

Can I rename 1.9 to preclear_disk1.sh and run that in addition if I can't replace the existing one?

 

Thanks!

Link to comment

I got two more drives cooking in another server.  No one ever answered my question about the script 1.7 vs. 1.9?

 

See about two or three comments higher.

 

Thanks,

 

Neil

 

The comments describing the revisions are all at the top of the file itself.

# Version .1 - initial attempt at preclear.  Joe L.

# Version .5 - fixed hard-coded device name.

# Version .6 - added verification test of bytes cleared in first 512 byte block.

# Version .7 - fixed sfdsisk vs blockdev mismatch on size.

# Version .8 - replaced sfdisk partitioning with awk script, re-did

#              progress display, added disk pre/post read. Joe L.

# Version .9 - added -t option to test for pre-cleared signature

# Version .9.1 - modified "read" loop to not abort on read failure

# Version .9.2 - Added support for send staus through e-mail. Needs mail configured correctly

# Version .9.3 - Added sub-shell for background read of disk, to work around 4096 "wait" bug in bash.

# Version .9.4 - Enable SMART monitoring, just in case it is disabled on a drive.

# Version .9.5 - Added disk temperature display and disk read speed display.

# Version .9.6 - Enhanced the mail reporting to include some statistics (time, MB/s temp .. ect)

#              - Fixed a bug with using zero.txt and concurrent tests. Each test will use it's own file.

#              - Changed read block size to be bigger than 1,000,000 if smaller, to improve read/write speed

# Version .9.7 - Added verify of zeros read from entire disk in postread phase.

# Version .9.8 - Added ability to set read and write block sizes with -w and -r options.

#              - Added ability to set number of blocks to read at a time with -b option.

# Version .9.9 - Changes to not perform pre-read in multi-cycles of use immediately after post-read

#              - added "-l" option to list device names of disks not in the array.

#              - modifications to final output report for easier interpretation

#              - modification to name the temp files after the disks being cleared.

#              - Added ability to start partition at sector 64 with -A option.

 

# Version .9.9a - improvements to analysis report

# Version .9.9b - more improvements to analysis report

#              - fixed bug when parsing config/disk.cfg for existing assigned disks.

# Version .9.9c - fixed bug where date format change in 5.0 unRAID changed and

#                caused "-l" option to not work as expected.

#              - more improvements to analysis report

# Version .9.9d - more improvements to analysis report

# Version 1.1  - added -C 64 and -C 63 options to convert precleared drives from

#                sector 63 start to sector 64 start.

#              - added display of command line arguments to initial confirmation screen

#              - added -W option to skip pre-read phase and start with "write" phase.

#              - added -V option to skip pre-read and "clear" and only

#                perform the post-read verify.

# Version 1.2  - fixed "-l" option to not exclude disks with only a "scsi-" entry in /dev/disk/by-id

# Version 1.3  - Added logic to read desired "default" Partition Type from /boot/config.

#              - Added logic to save dated copies of the final preclear and SMART reports to a

#                "preclear_reports" subdirectory on the flash drive.

#              - Added "-R" option to suppress the copy of final reports to a "preclear_reports"

#                directory on the flash drive. (they are always in /tmp until you reboot)

# Version 1.4  - Added "-D" option to suppress use of "-d ata" on smartctl commands

#                Added "-d device_type" to allow use of alternate device_types as arguments to smartctl.

#                Added "-z" option to zero the MBR and do nothing else. (remainder of the drive will not

#                be cleared)

# Version 1.5  - Added Model/Serial number of disk to output report.

#                Fixed default argument to smartctl when "-d" and "-D" options not given.

#                Added intermediate report of sectors pending re-allocation.

# Version 1.6  - Fixed logic to prevent use on disk assigned to array

# Version 1.7  - Again fixed logic to deal with change in disk.cfg format.

# Version 1.8  - Changes to range of random blocks read to not read past last block on disk.

# Version 1.9  - fixed parse of default partition type from config

#                    fixed parse of assigned disks

 

Link to comment

Crap I was afraid you would say that.  I mean being 24 hours in to whats another 30 hours :(

If you think it was near the end you can use the "-V" option

It will skip to the verification phase. (the post read phase)

 

 

= Step 1 through 9 skipped, verify phase will be performed next

= Step 10 of 10 - The MBR is NOT verified un-aligned cleared.

= However, its MBR is verified cleared for 4k-alignment

= starting on sector 64

= Post-Read in progress: 0% complete. 

(  1,645,056,000  of  2,000,398,934,016  bytes read ) 104 MB/s

Disk Temperature: 34C, Elapsed Time:  0:00:18

 

 

So I don't know if this is ok or not?  Any thoughts?  I wasn't sure if the -V would tell me if everything was kosher?

Link to comment

Crap I was afraid you would say that.  I mean being 24 hours in to whats another 30 hours :(

If you think it was near the end you can use the "-V" option

It will skip to the verification phase. (the post read phase)

 

 

= Step 1 through 9 skipped, verify phase will be performed next

= Step 10 of 10 - The MBR is NOT verified un-aligned cleared.

= However, its MBR is verified cleared for 4k-alignment

= starting on sector 64

= Post-Read in progress: 0% complete. 

(  1,645,056,000  of  2,000,398,934,016  bytes read ) 104 MB/s

Disk Temperature: 34C, Elapsed Time:  0:00:18

 

 

So I don't know if this is ok or not?  Any thoughts?  I wasn't sure if the -V would tell me if everything was kosher?

It will when it finishes.  It shows you have a MBR with a verified 4k-aligned signature and a partition starting on sector 64, and now it is verifying the disk was properly zeroed by repeating the "post-read" phase.  It should be done in 8 or 10 hours or so.  (perhaps even sooner if it can maintain the 100+ MB/s read rate)
Link to comment

Joe, let me know if I can help provide any more info to help determine why my drive isn't showing up in the potential pre-clear list.  I've tried changing some things around and rebooting, and nothing seems to have any effect.  I'm not sure why it's doing it, but it is persistent.  I'd be happy to help test or debug any suggestions you might have.

Link to comment

Joe, let me know if I can help provide any more info to help determine why my drive isn't showing up in the potential pre-clear list.  I've tried changing some things around and rebooting, and nothing seems to have any effect.  I'm not sure why it's doing it, but it is persistent.  I'd be happy to help test or debug any suggestions you might have.

What I would need is a listing of the output of:

ls --time-style='+%Y-%m-%d %I:%M%p' -ld /dev/disk/by-path/*

and

ls --time-style='+%Y-%m-%d %I:%M%p' /dev/disk/by-id/* -l | grep -v -- "-part" | cut -c62-

and

mount

Link to comment

Joe, let me know if I can help provide any more info to help determine why my drive isn't showing up in the potential pre-clear list.  I've tried changing some things around and rebooting, and nothing seems to have any effect.  I'm not sure why it's doing it, but it is persistent.  I'd be happy to help test or debug any suggestions you might have.

What I would need is a listing of the output of:

ls --time-style='+%Y-%m-%d %I:%M%p' -ld /dev/disk/by-path/*

and

ls --time-style='+%Y-%m-%d %I:%M%p' /dev/disk/by-id/* -l | grep -v -- "-part" | cut -c62-

and

mount

 

I had that middle one in my post above, but I've included it again here along with the additional information you requested.  Hopefully it gives some clue as to what is going on.  Thanks for looking into this.

 

ls --time-style='+%Y-%m-%d %I:%M%p' -ld /dev/disk/by-path/*

lrwxrwxrwx 1 root root  9 2011-04-08 12:07AM /dev/disk/by-path/pci-0000:00:1d.0-usb-0:1.5:1.0-scsi-0:0:0:0 -> ../../sdb
lrwxrwxrwx 1 root root 10 2011-04-08 12:07AM /dev/disk/by-path/pci-0000:00:1d.0-usb-0:1.5:1.0-scsi-0:0:0:0-part1 -> ../../sdb1
lrwxrwxrwx 1 root root  9 2011-04-08 12:07AM /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 -> ../../sdd
lrwxrwxrwx 1 root root 10 2011-04-08 12:07AM /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0-part1 -> ../../sdd1
lrwxrwxrwx 1 root root  9 2011-04-08 12:07AM /dev/disk/by-path/pci-0000:00:1f.2-scsi-1:0:0:0 -> ../../sde
lrwxrwxrwx 1 root root 10 2011-04-08 12:07AM /dev/disk/by-path/pci-0000:00:1f.2-scsi-1:0:0:0-part1 -> ../../sde1
lrwxrwxrwx 1 root root  9 2011-04-08 12:07AM /dev/disk/by-path/pci-0000:00:1f.2-scsi-4:0:0:0 -> ../../sdf
lrwxrwxrwx 1 root root 10 2011-04-08 12:07AM /dev/disk/by-path/pci-0000:00:1f.2-scsi-4:0:0:0-part1 -> ../../sdf1
lrwxrwxrwx 1 root root  9 2011-04-08 12:07AM /dev/disk/by-path/pci-0000:02:00.0-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root  9 2011-04-08 12:07AM /dev/disk/by-path/pci-0000:02:00.0-scsi-1:0:0:0 -> ../../sdc
lrwxrwxrwx 1 root root 10 2011-04-08 12:07AM /dev/disk/by-path/pci-0000:02:00.0-scsi-1:0:0:0-part1 -> ../../sdc1

 

ls --time-style='+%Y-%m-%d %I:%M%p' /dev/disk/by-id/* -l | grep -v -- "-part" | cut -c62-

ata-ST31000333AS_9TE11S5T -> ../../sda
ata-ST3120827AS_5MT2Y99S -> ../../sdc
ata-WDC_WD20EARS-00MVWB0_WD-WCAZA2122977 -> ../../sdd
ata-WDC_WD20EARS-00MVWB0_WD-WMAZA0280726 -> ../../sdf
ata-WDC_WD20EARS-00MVWB0_WD-WMAZA0613072 -> ../../sde
scsi-SATA_ST31000333AS_9TE11S5T -> ../../sda
scsi-SATA_ST3120827AS_5MT2Y99S -> ../../sdc
scsi-SATA_WDC_WD20EARS-00_WD-WCAZA2122977 -> ../../sdd
scsi-SATA_WDC_WD20EARS-00_WD-WMAZA0280726 -> ../../sdf
scsi-SATA_WDC_WD20EARS-00_WD-WMAZA0613072 -> ../../sde
usb-Lexar_JD_FireFly_AAXXZJG7JLRW21HB-0:0 -> ../../sdb
wwn-0x5000c500109b16e9 -> ../../sda
wwn-0x50014ee057be9fb9 -> ../../sdf
wwn-0x50014ee2052a2bcb -> ../../sdd
wwn-0x50014ee600670826 -> ../../sde

 

mount

proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
/dev/sdb1 on /boot type vfat (rw,noatime,nodiratime,umask=0,shortname=mixed)
/dev/md2 on /mnt/disk2 type reiserfs (rw,noatime,nodiratime)
/dev/md1 on /mnt/disk1 type reiserfs (rw,noatime,nodiratime)
shfs on /mnt/user type fuse.shfs (rw,nosuid,nodev,noatime,allow_other,default_permissions)
/dev/sdc1 on /mnt/disk/downloads type reiserfs (rw)

 

Link to comment

The basic issue is that the config/disk.cfg file identified disk1 as:

disk1=pci-0000:02:00.0-scsi-0:0:0:0

 

when I do a listing of /dev/disk/by-id on your system it sees that device as disk "sda":

lrwxrwxrwx 1 root root  9 2011-04-08 12:07AM /dev/disk/by-path/pci-0000:02:00.0-scsi-0:0:0:0 -> ../../sda

 

According to your system, disk1 = /dev/sda and it is assigned to your array.

 

Joe L.

Link to comment

The basic issue is that the config/disk.cfg file identified disk1 as:

disk1=pci-0000:02:00.0-scsi-0:0:0:0

 

when I do a listing of /dev/disk/by-id on your system it sees that device as disk "sda":

lrwxrwxrwx 1 root root  9 2011-04-08 12:07AM /dev/disk/by-path/pci-0000:02:00.0-scsi-0:0:0:0 -> ../../sda

 

According to your system, disk1 = /dev/sda and it is assigned to your array.

 

Joe L.

 

Hmm... I believe that one of the data disks was in fact on this port and assigned sda, but it hasn't been like that since I upgraded to 5.0.  If the disk.cfg is actually calling out the wrong disk as being part of the array, how is the server even functioning properly?  It's like that file is out of sync with the actual state of the system.  I would think that either something else would be messed up (array not starting, etc.), or unRaid isn't using the disk.cfg to assign the disks to the array.

 

Because while disk1 is pointing to the incorrect drive, as you note, if you look in my disk.cfg at parity and disk2 they have IDs that don't even exist.

 

How can I resolve this?  Should I post in the beta 6 announce thread?  I don't suppose manually changing the disk.cfg to point to the correct disks is a good idea.

Link to comment

The basic issue is that the config/disk.cfg file identified disk1 as:

disk1=pci-0000:02:00.0-scsi-0:0:0:0

 

when I do a listing of /dev/disk/by-id on your system it sees that device as disk "sda":

lrwxrwxrwx 1 root root  9 2011-04-08 12:07AM /dev/disk/by-path/pci-0000:02:00.0-scsi-0:0:0:0 -> ../../sda

 

According to your system, disk1 = /dev/sda and it is assigned to your array.

 

Joe L.

 

Hmm... I believe that one of the data disks was in fact on this port and assigned sda, but it hasn't been like that since I upgraded to 5.0.  If the disk.cfg is actually calling out the wrong disk as being part of the array, how is the server even functioning properly?  It's like that file is out of sync with the actual state of the system.  I would think that either something else would be messed up (array not starting, etc.), or unRaid isn't using the disk.cfg to assign the disks to the array.

 

Because while disk1 is pointing to the incorrect drive, as you note, if you look in my disk.cfg at parity and disk2 they have IDs that don't even exist.

 

How can I resolve this?  Should I post in the beta 6 announce thread?  I don't suppose manually changing the disk.cfg to point to the correct disks is a good idea.

Post it as a bug in the 5.0beta6a forum announcement.  It might be that the disk.ini file is now being used in the most recent 5.0 series.

 

To go forward, delete the entry in the disk.cfg file (or make it say anything other than what it currently does for the device)

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.

×
×
  • Create New...