March 30, 201412 yr I wont get into why but I have a bunch of 4K drives that are unaligned and a mix of jumpers and no jumpers. I wish to convert all these drives to blank, jumperless, reiser (unRAID compatible) aligned drives. The drives are not in arrays. I have an idea of the best way to approach this but I wanted a peer review and sanity check: Step 1: Confirm drive is not in array. Step 2: Confirm drive has no jumper Step 3: Use dd to break the formatting of the drive so that... Step 4: ...preclear sees it as new. Run preclear Step 5: Format manually Perhaps I don't need to preclear since the drives are well used? I need to work out the best dd options or maybe preclear can be forced to work with an already formatted drive? I need to work out the exact command line version of unRAID 4K aligned format Anyone got any thoughts on this?
March 30, 201412 yr I wont get into why but I have a bunch of 4K drives that are unaligned and a mix of jumpers and no jumpers. I wish to convert all these drives to blank, jumperless, reiser (unRAID compatible) aligned drives. The drives are not in arrays. I have an idea of the best way to approach this but I wanted a peer review and sanity check: Step 1: Confirm drive is not in array. Step 2: Confirm drive has no jumper Step 3: Use dd to break the formatting of the drive so that... Step 4: ...preclear sees it as new. Run preclear Step 5: Format manually Perhaps I don't need to preclear since the drives are well used? I need to work out the best dd options or maybe preclear can be forced to work with an already formatted drive? I need to work out the exact command line version of unRAID 4K aligned format Anyone got any thoughts on this? To list drives not assigned to array: ./preclear_disk.sh -l To test if a drive is cleared: ./preclear_disk.sh -t /dev/??? To covert an already pre-cleared drive from using a start sector of 63 to a start sector of 64. ./preclear_disk.sh -C 64 /dev/??? To zero only the MBR of a disk (first 512 bytes) ./preclear_disk.sh -z /dev/??? To not do pre and post read for a preclear with start at 64 ./preclear_disk.sh -n -A /dev/???
March 30, 201412 yr Author I am glad I asked. When I was thinking about the correct procedure to take I read the preclear forum post but after your reply I went to look at the tool itself. Far easier to see what it can do and it is more powerful than I remembered. The only thing that seems missing now is how to replicate unRAID formatting the disk without actually adding it to an array. Technically I can get away with not knowing this as I will use a free unraid license and a dedicated box to do this but I am interested to see if it could actually be done. preclear_disk.sh version: 1.13 Usage: /boot/preclear_disk.sh [-t] [-n] [-N] [-W] [-R] [-m e-mail-addr] [-M 1|2|3|4] [-c count] [-A|-a] /dev/??? To test if a drive is cleared: /boot/preclear_disk/preclear_disk.sh -t /dev/??? To covert an already pre-cleared drive from using a start sector of 63 to a start sector of 64. /boot/preclear_disk/preclear_disk.sh -C 64 /dev/??? To covert an already pre-cleared drive from using a start sector of 64 to a start sector of 63. /boot/preclear_disk/preclear_disk.sh -C 63 /dev/??? To zero only the MBR of a disk (first 512 bytes) /boot/preclear_disk/preclear_disk.sh -z /dev/??? To run the post-read-verify only on a drive. /boot/preclear_disk/preclear_disk.sh -V [-A|-a] /dev/??? To run only the writing of zeros and post-read-verify phases (skipping the pre--read) /boot/preclear_disk/preclear_disk.sh -W [-A|-a] /dev/??? To list device names of drives not assigned to the unRAID array: /boot/preclear_disk/preclear_disk.sh -l where = hda, hdb, sda, sdb, etc... -n = Do NOT perform preread and postread of entire disk that would allow SMART firmware to identify bad blocks. -N = Do not perform read validation during postread. (skip this step) (basic test to check if values read are all zero as expected. Skipping this test will save a few miniutes, but possibly not detect a drive that returns non-zero values when zeros were expected as bad.) -c count = perform count preread/clear/postread cycles where count is a number from 1 through 20 If not specified, default is 1 cycle. For large disks, 1 cycle can take 30 or more hours -t = Test if disk has pre-clear signature. This option may NOT be combined with the -c or -n options. The test does not write to the disk. It makes no changes to a disk at all. It only reads the first 512 bytes of the disk to verify a pre-clear signature exists. Note: "-t" does not read the entire disk to verify it it pre-cleared as that could take hours for a large disk. since the pre-clear-signature is written *after* a disk is entirely filled with zeros, if it exists, we assume the disk is cleared. -w size = write block size in bytes -r size = read block size in bytes -b count = number of blocks to read at a time -D disable "-d ata" used as argument to smartctl -d device_type = supply "-d device_type" to smartctl used to get device status -z = Zero the MBR (first 512 bytes) of the disk. Do nothing else. -a = start partition on sector 63. (default when on unRAID 4.X) -A = start partition on sector 64. (not compatible with unRAID 4.6 and prior) On unRAID 4.7 and subsequent, the -a or -A default is set based on the value set on the Settings page in the unRAID web-management console. -C 63 = convert an existing pre-cleared disk to use sector 63 as a starting sector. -C 64 = convert an existing pre-cleared disk to use sector 64 as a starting sector. -W = skip pre-read, start with "write" of zeros to clear the disk. useful if disk has already been completely read to locate bad sectors. -v = print version of /boot/preclear_disk/preclear_disk.sh -m [email protected] = optional recipient address. If blank and -M option is used, it will default to default e-mail address of "root" -M 1 = Will send an e-mail message at the end of the final results (default if -m is used, but no other -M option given) -M 2 = Will send an e-mail same as 1 plus at the end of a cycle (if multiple cycles are specified) -M 3 = Will send an e-mail same as 2 plus at the start and end of the pre-read, zeroing, post-read -M 4 = Will send an e-mail same as 3 plus also at intervals of 25% during the long tests The -m, -M options requires that a valid working mail command is installed. -R = supress the copy of the output reports to the flash drive A dated output report, the start and finish SMART reports are saved in a subdirectory named /boot/preclear_reports if the "-R" is NOT given. (The reports are always available in /tmp until you reboot, even if "-R" is specified) -S = name the saved output reports by their linux device instead of by the serial number of the disk. Unless the -n option is specified the disk will first have its entire set of blocks read, then, the entire disk will be cleared by writing zeros to it. Once that is done the disk will be partitioned with a special signature that the unRAID software will recognize when the drive is added to the array. This special signature will allow the unraid software to recognize the disk has been pre-cleared and to skip an initial "clearing" step while the server remains off-line. The pre-read and post-read phases try their best to exercise the disk in a way to identify a drive prone to early failure. It performs reads of random blocks of data interspersed with reads of sequential blocks on the disk in turn. This program also uses non-buffered reads of the first and last cylinders on the disk, the goal is to perform those reads in between the others, and to keep the disk head moving much more than if it just read each linear block in turn.
March 30, 201412 yr The command emhttp uses to format the drive is simply: mkreiserfs -q %s |& logger I suspect the parameters passed to it is simply the device name [ /dev/sdx1 ]
March 30, 201412 yr Author The command emhttp uses to format the drive is simply: mkreiserfs -q %s |& logger I suspect the parameters passed to it is simply the device name [ /dev/sdx1 ] A quick Google shows various logs people have posted on this forum that seem to confirm it really is this vanilla a command "Aug 21 03:30:33 Tower emhttp: shcmd (44): mkreiserfs -q /dev/md1 2>&1 | logger" I honestly expected all sort of variables especially such as --block-size N, --journal-size N and --format 3.5|3.6 I will need to confirm the defaults on unRAID havent been tweaked somewhere so that implicitly we are setting a bunch of stuff without realizing it.
April 4, 201412 yr Author Just an update. I have requested this information directly from Tom as it is important it is absolutely correct. Will update when I receive a reply.
April 4, 201412 yr An easy way to format a drive is to zero the MBR, stop the array, and assign the disk to the cache slot. Start the array (may need to use maintenance mode), and click the button to format the unformatted. After it's formatted, you can put your cache drive back and start up normally.
April 5, 201412 yr Author An easy way to format a drive is to zero the MBR, stop the array, and assign the disk to the cache slot. Start the array (may need to use maintenance mode), and click the button to format the unformatted. After it's formatted, you can put your cache drive back and start up normally. Very clever idea, I like it. Will still wait to hear from Tom as I would like to at least pretend to be able to do this outwith unRAID although your way is safer.
Archived
This topic is now archived and is closed to further replies.