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.

ycp

Member
Jun 22, 2014
229
17
18
Hello,
I have 2 drives Netapp Hitachi 10TB drives that are formated to 520B. THe model numbers are X377_STATE10TA07
I am using sg_Utils to format them back to 512B.
Both disks are not finishing the reformat process.
1st disk stops at Format Unit Complete at 2.61%
2nd disk stops at Format Unit Complete at 83.15%

I have tried multiple times with the same issue and stops around at the same percentage.
What could be the problem?
 

hjulian

New Member
Feb 23, 2019
6
0
1
Could that be a reason why the SATA drive is not taking SAS commands, because it's not connected to the first port in the RAID controller?
...
I will try with the CentOS Live DVD (or USB drive) and one single EMC (Samsung) SATA SSD connected to the first port of my RAID controller in IT mode and let you know if that works.
Just wanted to get back with some feedback. There was no change after connecting one single SATA SSD to the first SCSI port of my RAID controller in IT mode. I modified an original Dell PERC H310 RAID card into IT mode. I used the CentOS 6.10 Live DVD (USB actually, burned ISO image to USB using Rufus). The sg3 utils package had to be installed extra. (the same with an Ubuntu Live DVD)
I also opened the SSD itself, hoping to find some write protect jumper with no success.

So if anyone has any idea how to flash a different firmware to these Samsung SATA SSDs (F/W VCC16C3Q) or bypass the "sense key" error or apparent write protected state, let us know.
 

Anri Hakobyan

New Member
Feb 28, 2019
1
1
1
This is GREAT. Thank you for the post. Helped a lot!

In case anyone is wondering. It is possible to run multiple formats at the same time.

I have 8 hard drives (2tb each), each drive takes about 9 hours to format. I opened multiple SSH instances and ran the command for each drive simultaneously. Everything went smooth, all drives are formatted just fine and work.

Thanks again!
 
  • Like
Reactions: Samir

Sorin Bidian

New Member
Jan 13, 2016
20
3
3
53
Can't reformat . I try in many adapters and servers. Can use them if attached to sas controler in IT mode, only in esxi. This are 3GB not 6GB as described.
 

laxduke

New Member
Jul 29, 2018
2
0
1
Can't reformat . I try in many adapters and servers. Can use them if attached to sas controler in IT mode, only in esxi. This are 3GB not 6GB as described.
Ok i understand. So basically since the firmware is the obstacle for communicating with rest of the drive, only VMware ESXI has the multi miniport driver who can do 512e on everything. I will try it on Monday i reply here about my findings. Thank you.
 

hjulian

New Member
Feb 23, 2019
6
0
1
There is a command in the sg3-utils website, "sg_emc_trespass", that nobody has mentioned here.
It's not included in the Windows executables (or at least I didn't see it). Anybody know if this command could help in any way to format these EMC SATA SSDs?
 

hjulian

New Member
Feb 23, 2019
6
0
1
Alright, I just tried it: no success. "Permission denied" I know these are old SSDs and it probably isn't worth anybody's time but it keeps me entertained. :)
I'll keep on looking.
 

naeyeth

New Member
Apr 15, 2019
1
0
1
I have 8 of the EMC 2tb drives that were 520 and I was able to make them 512 by the following commands flawlessly.

sudo chmod 777 /dev/sg1
sg_format --format --size=512 --six -v /dev/sg1

It appears the chmod 777 command is the key as my drives will never format to 512 block size without it.
 

hjulian

New Member
Feb 23, 2019
6
0
1
I have 8 of the EMC 2tb drives that were 520 and I was able to make them 512 by the following commands flawlessly.

sudo chmod 777 /dev/sg1
sg_format --format --size=512 --six -v /dev/sg1

It appears the chmod 777 command is the key as my drives will never format to 512 block size without it.
Thanks for that but it didn't work. It seems these EMC SSD drives (Model: MZ - 3S92000/0C3, F/W VCC16C3Q) are hopelessly locked. I would imagine they can only be used with 520 block size software as mentioned above and that the firmware will not be compatible with a 512 block size format.
I also doubt it that there would be any other firmware for these drives. They were most probably purpose made for running 520 block size format software.
Thanks anyways.
 

mrkairo

New Member
Apr 24, 2019
2
0
1
Dear colleagues, I have followed all the messages of this thread with attention since I share the suffering of all of you, have a good amount of IBM 600gb 15k 12gb SAS SFF disks belonging to an IBM DS8000 storage that would be happy to reuse for more basic purposes of standard servers.
These disks are 528k block but that is not a problem, with SG_FORMAT change old NETAPP disk block sizes without any problem even if the protection flag is "1"

The big problem is the current disc models that belong to modern storage systems ...

In consultation with a colleague who is dedicated to data recovery in HDD which has made an investment in equipment and time for their specialty confirmed that currently the HDD belonging to the most modern storage systems have features that make them literally unusable for other purposes than its specific function, for example, the ROM they have has adaptive parameters with respect to the system area that is in random sectors on the surface of the physical disk which rules out the possibility in case of finding a default firmware of the model can work, even if they replace the logic board from one disk to another of the same family does not work as it will not find the system area that appears in its ROM

As you see the guys from IBM, HP, Dell and other companies decided to protect their products right now ..., which does not allow us to recycle these discs.

However as a "cabeza dura" i will continue investing time in this matter, I do not resign to waste these discs that I own ..., if I achieve some progress I will publish in this post.

Best regards from Argentina!
 

Attachments

arglebargle

H̸̖̅ȩ̸̐l̷̦͋l̴̰̈ỏ̶̱ ̸̢͋W̵͖̌ò̴͚r̴͇̀l̵̼͗d̷͕̈
Jul 15, 2018
657
244
43
As you see the guys from IBM, HP, Dell and other companies decided to protect their products right now ..., which does not allow us to recycle these discs.

However as a "cabeza dura" i will continue investing time in this matter, I do not resign to waste these discs that I own ..., if I achieve some progress I will publish in this post.

Best regards from Argentina!
One question for you, and a follow-on request.

Have you checked to see if the drive is a SED (Self Encrypting Drive) and if it's locked because it's encrypted as part of the storage array it was removed from? I had similar problems way back in the day with an Intel SSD that I tried to ATA Secure Erase using a USB/SATA bridge -- the bridge passed the secure lock command in a messed up way that left the drive permanently security locked. I got similar responses from the drive when I tried to do anything to it.

Anyway, it could be that your drive is security locked due to encryption as part of the storage array it was removed from and there may be a way to unlock it on the machine it came from if that's the case. I'd try a `smartctl -x -dscsi /dev/sgX` and see what information is presented, that should tell you if the drive has any security lock or encryption present.

Second, if the firmware is indeed refusing to reformat sector sizes because of IBM's firmware would you mind taking a picture of the drive label and uploading it so others don't buy these drives and have the same problem? :D
 

voodooFX

Active Member
Jan 26, 2014
247
52
28
Hi,

I have some 'Micron P410m SAS Enterprise SSD' wich are formatted with 520 bytes block size and I'm trying to re-format them with 512 but getting the following error

Code:
# sg_map -x -i
...
/dev/sg3  0 0 2 0  0  /dev/sdb  SATA-MIC  P410M400 CLAR400  0337
...
Code:
# sg_format -v --format --size=512 /dev/sg3
    inquiry cdb: 12 00 00 00 24 00
    SATA-MIC  P410M400 CLAR400  0337   peripheral_type: disk [0x0]
      PROTECT=0
    mode sense (10) cdb: 5a 00 01 00 00 00 00 00 fc 00
    mode sense (10): pass-through requested 252 bytes but got 28 bytes
Mode Sense (block descriptor) data, prior to changes:
  Number of blocks=769230720 [0x2dd98780]
  Block size=520 [0x208]
    mode select (10) cdb: 55 11 00 00 00 00 00 00 1c 00
mode select (10):  Fixed format, current;  Sense key: Illegal Request
 Additional sense: Invalid field in parameter list
  Field replaceable unit code: 15
  Sense Key Specific: Error in Data byte 15 bit 0
bad field in MODE SELECT (10)

I have also tryied with --six...
Code:
[root@durand10 ~]#
[root@durand10 ~]#
[root@durand10 ~]# sg_format -v --format --size=512 --six /dev/sg3
    inquiry cdb: 12 00 00 00 24 00
    SATA-MIC  P410M400 CLAR400  0337   peripheral_type: disk [0x0]
      PROTECT=0
    mode sense (6) cdb: 1a 00 01 00 fc 00
    mode sense (6): pass-through requested 252 bytes but got 24 bytes
Mode Sense (block descriptor) data, prior to changes:
  Number of blocks=769230720 [0x2dd98780]
  Block size=520 [0x208]
    mode select (6) cdb: 15 11 00 00 18 00
mode select (6):  Fixed format, current;  Sense key: Illegal Request
 Additional sense: Invalid field in parameter list
  Field replaceable unit code: 15
  Sense Key Specific: Error in Data byte 11 bit 0
bad field in MODE SELECT (6)
Looks like the disk does not accept the 512 bytes block size


Here is the smartctl output, maybe can help spot some info I have missed
Code:
# smartctl /dev/sdb -a
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-3.10.0-957.el7.x86_64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Vendor:               SATA-MIC
Product:              P410M400 CLAR400
Revision:             0337
User Capacity:        399,999,974,400 bytes [399 GB]
Logical block size:   520 bytes
Rotation Rate:        Solid State Device
Form Factor:          2.5 inches
Logical Unit id:      0x500a0751038e1718
Serial number:        P410m400-MTFDEAK400MAS         1180330801342038E1718        0337
Device type:          disk
Transport protocol:   SAS (SPL-3)
Local Time is:        Wed Jun 19 07:02:01 2019 CEST
SMART support is:     Available - device has SMART capability.
SMART support is:     Enabled
Temperature Warning:  Disabled or Not Supported
=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK
Percentage used endurance indicator: 0%
Current Drive Temperature:     28 C
Drive Trip Temperature:        <not available>
Manufactured in week    of year    
Specified cycle count over device lifetime:  0
Accumulated start-stop cycles:  0
Specified load-unload count over device lifetime:  0
Accumulated load-unload cycles:  0
Vendor (Seagate) cache information
  Blocks sent to initiator = 48
  Blocks received from initiator = 0
  Blocks read from cache and sent to initiator = 15
  Number of read and write commands whose size <= segment size = 0
  Number of read and write commands whose size > segment size = 0
Vendor (Seagate/Hitachi) factory information
  number of hours powered up = 46013.17
  number of minutes until next internal SMART test = 592
Error counter log:
           Errors Corrected by           Total   Correction     Gigabytes    Total
               ECC          rereads/    errors   algorithm      processed    uncorrected
           fast | delayed   rewrites  corrected  invocations   [10^9 bytes]  errors
read:          0        0         0         0          0          0.000           0
write:         0        0         0         0          0          0.000           0
Non-medium error count:        5
SMART Self-test log
Num  Test              Status                 segment  LifeTime  LBA_first_err [SK ASC ASQ]
     Description                              number   (hours)
# 1  Default           Completed                   -     102                 - [-   -    -]
# 2  Default           Completed                   -     102                 - [-   -    -]
# 3  Default           Completed                   -      54                 - [-   -    -]
# 4  Default           Completed                   -      54                 - [-   -    -]
# 5  Default           Completed                   -      42                 - [-   -    -]
# 6  Default           Completed                   -      42                 - [-   -    -]
Long (extended) Self Test duration: 3 seconds [0.1 minutes]
 

voodooFX

Active Member
Jan 26, 2014
247
52
28
uh, it's even failing to format with 520 bytes :confused:

Code:
# sg_format --format --size=520 -v -v /dev/sg3
open /dev/sg3 with flags=0x802
    inquiry cdb: 12 00 00 00 24 00
    SATA-MIC  P410M400 CLAR400  0337   peripheral_type: disk [0x0]
      PROTECT=0
    mode sense (10) cdb: 5a 00 01 00 00 00 00 00 fc 00
    mode sense (10): pass-through requested 252 bytes but got 28 bytes
Mode Sense (block descriptor) data, prior to changes:
  Number of blocks=769230720 [0x2dd98780]
  Block size=520 [0x208]

A FORMAT will commence in 10 seconds
    ALL data on /dev/sg3 will be DESTROYED
        Press control-C to abort
A FORMAT will commence in 5 seconds
    ALL data on /dev/sg3 will be DESTROYED
        Press control-C to abort
    format cdb: 04 18 00 00 00 00
    format parameter list:
        00 02 00 00
format unit:  Fixed format, current;  Sense key: Illegal Request
 Additional sense: Invalid field in cdb
  Field replaceable unit code: 14
  Sense Key Specific: Error in Command byte 1 bit 5
 Raw sense data (in hex):
        70 00 05 00 00 00 00 0a  04 26 07 00 24 00 0e cd
        00 01                                           
Format command, illegal parameter
FORMAT failed
 

ecosse

Active Member
Jul 2, 2013
463
111
43
Hoping this will help someone as it took me ages to get a working solution...

...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 :)
This did the trick for me - thanks!
 

hjulian

New Member
Feb 23, 2019
6
0
1
ecosse, thanks for telling us about your experience. I went ahead and tried it but still no success.
This is what I got:
First, my "SAS" SSD to be formatted. (Not sure if this device can actually receive SCSI commands.)

SCSI ID : 1
LUN : 0
Connected to: Host1 / Channel0
Manufacturer: ATA
Model : SS160512
Device type : Disk

Next, the last part of the output:
===============================================================================
Do you really want to reformat this device [y/n]? y

Prepare command ...
Done.
Send MODE SELECT command ...
Done.
Check status ...
Error: Check Condition
[valid=0] Info fld=0x0, Current sense key: Illegal Request
Additional sense indicates: Invalid field in cdb
Raw sense data (in hex):
70 00 05 00 00 00 00 0a 00 00 00 00 24 00 00 00
plus...: Driver_status=0x08 (DRIVER_SENSE,SUGGEST_OK)
Command NOT succesful!


real 0m31,024s
user 0m0,001s
sys 0m0,000s
root@ubuntu:/root/setblocksize#
------------------------------------------------------------------------
If anyone has any idea what could be added or changed to the commands, let me know.
 

sfbayzfs

Active Member
May 6, 2015
259
143
43
SF Bay area
Avoid these HP branded Seagate 4TB SAS SEDs:
Seagate model: st4000nm0063
HP P/N 746841-004
HP Model SMEG4000S5xnF7.2
These are HP 3PAR drives, with firmware 3P00 on them

They sg_format fine to their native 520, but will not take 512, responding with Sense key: Illegal Request
...and the -6, -S options do not help

I tried flashing Seagate stock and Dell firmware onto them, using both SeaChest linux and seaflashlin, but both were rejected.

If anyone figures out how to format them, please ping me!