How to reformat HDD & SSD to 512B Sector Size

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

i386

Well-Known Member
Mar 18, 2016
4,222
1,540
113
34
Germany
I tried sg3_utils on windows and could succesfully format 4x HUSMM8020ASS200 (oem branded, probably netapp) from 512 to 4096 byte logical block size.

I put them in a hardware raid 10 and 5 for testing and so far they work without problems.
Had to format the ssds back to 512e. Adaptec software can't create a maxcache device with 4kn ssds...
 
  • Like
Reactions: Samir

Compcons

New Member
Aug 27, 2020
2
0
1
I have some netapp drives and most were reformatted using sg3_utils under Linux without problems. 2 of them got to about 98% then reported that they finished with a hardware error. After that, they don't show up in any scan at all. The devices don;t seem to exist. I actually dropped an HBA into a Windows box to try my luck there and still don;t have the drives.

Any ideas?
 

Fritz

Well-Known Member
Apr 6, 2015
3,372
1,375
113
69
I have some netapp drives and most were reformatted using sg3_utils under Linux without problems. 2 of them got to about 98% then reported that they finished with a hardware error. After that, they don't show up in any scan at all. The devices don;t seem to exist. I actually dropped an HBA into a Windows box to try my luck there and still don;t have the drives.

Any ideas?
Sounds like they died on the operating table.
 

Compcons

New Member
Aug 27, 2020
2
0
1
any ideas on how to recover a dead patient? Maybe some adrenaline shot to the heart or something like that?
 
Last edited:

Fritz

Well-Known Member
Apr 6, 2015
3,372
1,375
113
69
Dunno. If nothing sees them there's not much you can do.

I have several netapp drives I've reformatted with SG_Utils and haven't run into a problem.
 

alexcirce

New Member
Sep 3, 2020
1
0
1
Seriously, thanks a bunch for the post, solved a Wacky IBM/HGST drive that wouldn't initialize, took a good 7 hours for the low level format but did the trick none the less.
 

lpayne

New Member
Sep 13, 2020
1
2
3
Cape Canaveral
Here is how you get the DKS5E-J900SS versions of the ST900MM0006's to work. Even when formatting them to 512b sectors, you cannot write to them. They will produce an error like this:

FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Sense Key : Hardware Error [current]
<<vendor>>ASC=0x81 ASCQ=0x0
CDB: Write(10) 2a 00 34 62 65 28 00 00 d0 00

Trying tricks like others suggested of turning wce on, did nothing to help. You can read from the drive all you want, but you cannot write to the drive.

So, in my exhaustive searching, I came upon this post on reddit:
https://www.reddit.com/r/sysadmin/comments/ge4ngu
He indicated that he was able to get the drives to work by flashing a firmware 0004 to the drives. I have 8 drives, 5 of them come up as the ST900MM0006 drives with firmware 0004, and the other 3 come up as the DKS5E-J900SS with a firmware of 7F0A.

Now, going to Seagate's website, you cannot download firmware for your drives unless you plug in a serial number that has a firmware update for it. All of my drives came up as no firmware available. In that reddit post, he said he searched on ebay for his drive and kept trying serial numbers until he found one that let him download the firmware. I tried that, it only took about 35 serial numbers to finally find one that came up with the download for the firmware version 0004 that I was looking for. (To speed this up, use serial # S0N5HBHA).

When you download the firmware, it also includes the flashing utility. I was doing this on Proxmox box, so here was the command I used from the Seagate download: (from the linux cli tools/seaflashlin folder from the archive)

./seaflashlin_043_64 -m DKS5E-J900SS -f 0004.LOD -d /dev/sg5

You have to set the -m flag to what the drive currently shows it's model number is. On linux, running ./seaflashlin -i will scan your drives and show you the make, device, model, serial#, and firmware versions.

The firmware file was called Lightningbug10K6-STD-0004.LOD in the firmware folder, I just moved it into the linux cli tools/seaflashlin folder and named it 0004.LOD.

After the drive flashed, and reset, it now shows up as a ST900MM0006 drive, and smartctl now shows the details like a normal drive vs before it would only show a few items.

Hope this helps. I successfully flashed all 3 of my drives without issue. Use at your own risk.

Leon
 
Last edited:
  • Like
Reactions: cromualdo and Fritz

Derwood

Member
May 22, 2019
52
1
8
My LSI MegaRAID SAS 9285CV-8e in typical RAID mode cleared fine all the way when connected to an NetApp DS2246 with a full compliment of 450GB 10K SAS (520B) drives, right up until you press [START] to enter the WebBIOS configuration. Just a complete halt until you CTRL-ALT-DEL and this was in part due to the 520Byte sector notion utilised by NetApp.
However connecting the same array to an NetApp HBA, an Ubuntu Live USB install running this command:

sg_format --format --size=512 /dev/sgX (where X is drive number)

Worked out all just fine in the end after being connected to either the NetApp/PMC 111-00341+F2 & B2 HBAs or the LSI MegaRAID SAS 9285CV-8e on various servers I have here, the IBM x3950x5 2-node, R810 & 710, CS24s even an rather old Alienware box.

Some issues which arose to be false positives were in this order.
-IRQ issue, I had it down to that because I had a RAID card, HBA and an HCA in the same x16 riser of a few machines.. Wrong!
-Halt caused possibly by USB > PS2 lagecy issues at the BIOS or UFEI level.. Wrong!
-PCIe versions.. Wrong!
and lastly.. Firmware.. Wrong!

it's all about the bytes folks! I had fun though and you will too!
 

Derwood

Member
May 22, 2019
52
1
8
Oh.. This is a great post.. I should have read it sooner, thanks very much to the creator of this post.
 

opasha

New Member
Aug 13, 2020
5
0
1
If anyone wants to take a crack at it, the key for flashing firmware to drives is the logical and physical sector matching - for example, it needs to be 512 / 512 (logical sectors / physical sectors) and not 512 / ---- .

If anyone knows how to make a SAS drive show physical sectors, that would help. After a flash, the physical sector disappears. Anyone know why or how to bring up a drive's physical sector or modify it? Thanks.
 

Raice

Member
Jul 12, 2017
64
11
8
41
Guangzhou, China
For those who experience
Code:
MODE SELECT command: Data protect, type: sense key; write protected media
Your drive is SED (self-encrypted). You need sedutil to erase it, unfortunately, linux version does not work. You need to use FreeNAS/TrueNAS


Code:
sedutil-cli --yesIreallywanttoERASEALLmydatausingthePSID <PSINODASHED> </dev/device>
Just made it with NETAPP X358 (Samsung PM1633)
 

soccrstar

New Member
Jul 12, 2020
7
0
1
For those who experience
Code:
MODE SELECT command: Data protect, type: sense key; write protected media
Your drive is SED (self-encrypted). You need sedutil to erase it, unfortunately, linux version does not work. You need to use FreeNAS/TrueNAS


Code:
sedutil-cli --yesIreallywanttoERASEALLmydatausingthePSID <PSINODASHED> </dev/device>
Just made it with NETAPP X358 (Samsung PM1633)
I tried and was successful in using the psid. I can format it to current format but I can't change sector size. I get the same error.

I can size 528 all day but 512 errors.

Am I missing something?

Any help appreciated
 

soccrstar

New Member
Jul 12, 2020
7
0
1
Seems like something went wrong



Post output of sedutil-cli and sg_format

Ahh i got it! Thanks!

I needed to add --six

And it worked space went from 822gb to 838gb after going from 528 to 512. A lot of wasted space.

Thanks for your reply!
 

cromualdo

New Member
Nov 30, 2020
1
1
3
Here is how you get the DKS5E-J900SS versions of the ST900MM0006's to work. Even when formatting them to 512b sectors, you cannot write to them. They will produce an error like this:

FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Sense Key : Hardware Error [current]
<<vendor>>ASC=0x81 ASCQ=0x0
CDB: Write(10) 2a 00 34 62 65 28 00 00 d0 00

Trying tricks like others suggested of turning wce on, did nothing to help. You can read from the drive all you want, but you cannot write to the drive.

So, in my exhaustive searching, I came upon this post on reddit:
https://www.reddit.com/r/sysadmin/comments/ge4ngu
He indicated that he was able to get the drives to work by flashing a firmware 0004 to the drives. I have 8 drives, 5 of them come up as the ST900MM0006 drives with firmware 0004, and the other 3 come up as the DKS5E-J900SS with a firmware of 7F0A.

Now, going to Seagate's website, you cannot download firmware for your drives unless you plug in a serial number that has a firmware update for it. All of my drives came up as no firmware available. In that reddit post, he said he searched on ebay for his drive and kept trying serial numbers until he found one that let him download the firmware. I tried that, it only took about 35 serial numbers to finally find one that came up with the download for the firmware version 0004 that I was looking for. (To speed this up, use serial # S0N5HBHA).

When you download the firmware, it also includes the flashing utility. I was doing this on Proxmox box, so here was the command I used from the Seagate download: (from the linux cli tools/seaflashlin folder from the archive)

./seaflashlin_043_64 -m DKS5E-J900SS -f 0004.LOD -d /dev/sg5

You have to set the -m flag to what the drive currently shows it's model number is. On linux, running ./seaflashlin -i will scan your drives and show you the make, device, model, serial#, and firmware versions.

The firmware file was called Lightningbug10K6-STD-0004.LOD in the firmware folder, I just moved it into the linux cli tools/seaflashlin folder and named it 0004.LOD.

After the drive flashed, and reset, it now shows up as a ST900MM0006 drive, and smartctl now shows the details like a normal drive vs before it would only show a few items.

Hope this helps. I successfully flashed all 3 of my drives without issue. Use at your own risk.

Leon
Hi Leon,
I just registered to say thanks for saving my 8 recently bought Seagate 4TB SAS disks (previously DKS2E-H4R0SS and later ST4000NM0023 after firmware downgrade/upgrade) that refused to work with my HBA - could not partition, format, basically use them - console threw constantly the errors you described before. None of my 8 disks' serial's worked in Seagate page in order to find a firmware upgrade available but the serial from the third picture I tried from ebay's units granted me a ticket to firmware download heaven :) for future reference #Z1Z5WH52.
It worked for me but it's not guaranteed it might work for others. Use it at your own risk! ;) Again thank you for this amazing information!
Best regards,
Carlos
 
  • Like
Reactions: Samir

amp88

Member
Jul 9, 2020
59
63
18
Hoping this will help someone as it took me ages to get a working solution...

I couldn't get sg_format to work with my EMC formatted HGST HUS72303CLAR3000 3TB drives, tried all the combinations of command line arguments mentioned here, but nada:

root@ubuntu:~# sg_format --format --size=512 -v /dev/sg2
HITACHI HUS72303CLAR3000 C442 peripheral_type: disk [0x0]
...
00 0MODE SELECT command: Illegal request sense key, apart from Invalid opcode


...but I did have success with the setblocksize util!

I've put together a very slightly modded version of setblocksize here with higher possible and default timeouts (the default is way to low for bigger drives) as well as the instructions on how to compile it etc. etc.

ahouston/setblocksize

So far I've rescued 7 of my EMC 3TB HGST drives, waiting on the last batch to finish up :)
I just wanted to say thank you so much, from the bottom of my wallet. I picked up an EMC KTN-STL3 DAE/disk enclosure with 10 of these exact drives and when they failed to reformat to 512 bytes with the usual sg_format method I despaired. However, your guide has worked perfectly on the first batch of 5 drives, and I've got the second batch formatting now. Thanks, once again! :)
 
  • Like
Reactions: Samir