Other SAS Drive 520b to 512b Conversion issues.

Hello fellow freebsd users!
I have a doozy! A friend of mine recently started his own homelab. He acquired a bunch of HGST 1.2TB 2.5" SAS spinning rust drives for his truenas setup. He said he could not figure out how to get them formatted in 512 block size with youtube tutorials, so he tried the following from a freebsd thread via his truenas core shell prompt:

Code:
camcontrol cmd da1 -v -c "15 10 0 0 v:i1 0" 12 -o 12 "0 0 0 8 0 0:i3 0 v:i3" 512
camcontrol format da1 -q -y

He said it worked, and proceeded to to this to the other 15 drives he had! (yeah I know noob error but he is learning!) however, to his horror, when he went to build the array the next day after they all completed, the drives will simply give input/output error if he tried to use the "wipe" command in truenas core.
After a week of forums, working with other options, he gave up and handed the drives over to me to see what I could do.

For my test bench I have a supermicro server board with an LSI 9200 flashed to IT mode with a EMC DAE sas / sata jbod shelf
and dual boot into freebsd (latest) and ubunut (latest)

I took one of these HGST 1.2TB 2.5" SAS drives he attempted to format and popped it in as the only drive in my test jbod. It assigned as da0
In ubunutu I used my standard command for such drives:

Code:
  sg_format -v --format --size=512 /dev/da

it worked fine. however, I too could not partition the drive, I would slam into command line erros the same input/output error. Hmmm, so I am thinking that the drives needed zeroed before changing block size so I did the following in linux:

Code:
sg_format -v --format --size=520 /dev/da0
smartctl showed that I was back to 520 block size. So I ran:
Code:
dd if=/dev/zero of=/dev/da0 bs=1m count=1

it worked fine. however, I too could not partition the drive, I would slam into command line erros the same input/output error. Hmmm, so I am thinking that the drives needed zeroed before changing block size so I did the following in linux:
Code:
sg_format -v --format --size=520 /dev/da0
smartctl showed that I was back to 520 block size. So I ran:
Code:
dd if=/dev/zero of=/dev/da0 bs=1m count=1
It failed. giving the same input/output error. I switched over to freebsd and figured maybe I need to rerun in reverse what he did in camcontrol
So I did the follwing:
Code:
camcontrol cmd da1 -v -c "15 10 0 0 v:i1 0" 12 -o 12 "0 0 0 8 0 0:i3 0 v:i3" 520
camcontrol format da0 -q -y

diskinfo showed that indeed it was at block size 520 and I was seeing a 1.2TB drive.
I attempted to run:
Code:
dd if=/dev/zero of=/dev/ada2 bs=1m count=1
but it failed with input/output error.
So I ran
Code:
sysctl kern.geom.debugflags=0x10 then sysctl kern.geom.debugflags=0x10
and it did not fail.
However, after finishing, I still get input/output error when attempting to wipe / partition etc.. the drive.
Anyone else have this issue??? The SED flag shows not set on the drives, so I am at a loss of why the heck I cannot simply reformat these drives!
thank you!
_DH
 
Two things to help you debug this. What is the current block size? Execute the read capacity (16) command, and decode the output. If I remember right, read capacity (16) has more details than read capacity (10).

And when you say you get IO error: Look at dmesg, and decode the ASC/ASCQ data the drive returned, so you know WHY the drive doesn't want to do the IO.
 
I would suggest manufacturer tool.
They have a Linux version.
 
Last edited:
For my test bench I have a supermicro server board with an LSI 9200 flashed to IT mode with
I am worried about use of the SAS9200 series.
I was messing around with 4kn conversion to 512e and I could only get the drive recognized on SAS3008 and better.
I specifically failed with LSI SAS9212-4I4E and SuperMicro AOC-S2308L controllers.
Succeeded with SAS9300-8i.
 
I am worried about use of the SAS9200 series.
I was messing around with 4kn conversion to 512e and I could only get the drive recognized on SAS3008 and better.
I specifically failed with LSI SAS9212-4I4E and SuperMicro AOC-S2308L controllers.
Succeeded with SAS9300-8i.
Hmm... I will have to look into this! I have never had issues with the LSI 9200 8e running in IT mode. I have for formatting drives in the external jbods.
 
Might be better to check over at servethehome forums. They do that kind of thing all the time.
I have been checking servethehome, however, they all seem to simply get their issue resolved by running sg_format as I described in my post. Frustrating that I have an entire box of drives that I cannot seem to fix!
 
I would suggest manufacturer tool.
The have a Linux version.
Thank you for the info! So I installed hugo on my ubuntu machine. inside of the hugo cli tool I did the following:
Code:
show
then gathered the serial number of the drive I wanted to format, then:
Code:
 f -s (serial number of my drive)  -n max -b 512

I opted not to use the fast format flag so every block would be touched.
It took about 2 hours to format, finished with no issues.

Then running
Code:
mkfs.ext4 -F -L 'thelabel-I-gavemydrive' /dev/sda
It starts formatting and then the dreaded error:
"mkfs.ext4:input/output error while writing out and closing file system '(disks-error-quark,0)"
I am soooo tired of seeing that error I can type it out in my sleep!!!!

This is where I am stuck! I suspect hugo basically does a simple low level format just as I could from the command line using sg_format.
I should also state that I have attempted various re-format options on 9 identical drives in the box of drives I have received from my friend.

I would normally say at this point it is just a dead drive, however, I have tried this so far on 4 drives and running smart on each drive smart reports drives are in perfect working order. I also determined using other tools that SED and write protect are off so I am at a loss.

-J
 
Two things to help you debug this. What is the current block size? Execute the read capacity (16) command, and decode the output. If I remember right, read capacity (16) has more details than read capacity (10).

And when you say you get IO error: Look at dmesg, and decode the ASC/ASCQ data the drive returned, so you know WHY the drive doesn't want to do the IO.
Current Block Size is 512 on all 9 of these drives I am currently trying to get to partition.
I will take a look at dmesg and see what it says, but using mk2fs this is what it gives after running for about 30 sec.
"mkfs.ext4:input/output error while writing out and closing file system '(disks-error-quark,0)"
 
Back
Top