How to reformat HDD & SSD to 512B Sector Size

thitluoc

New Member
Aug 18, 2018
2
0
1
Hello all, I got the same...

I have 4 100GB Samsung SSD's from an EMC storage formatted at 520B/sector.

I tried all of the commands mentioned here at the forum, but I keep getting the following error:
A FORMAT UNIT will commence in 5 seconds
ALL data on /dev/sg4 will be DESTROYED
Press control-C to abort
format unit cdb: 04 18 00 00 00 00
format unit:
Fixed format, current; Sense key: Illegal Request
Additional sense: Invalid command operation code
Format unit command: Illegal request, invalid opcode sense key
FORMAT UNIT failed

I tried it as mentioned with the option --six but no luck.

does anyone have a good suggestion?
Did you find the way to format them ?
 

sand_storm

New Member
Aug 22, 2018
8
1
3
I have same issue with two NetApp Samsung SSDs - MZ6ER500HAGM and MZ6ER400HAGM- can't format it to 512 block size, both drives are in "not ready" state. May be first in need to change firmware on original Samsung, but I can't find it
 

Wingman5

New Member
Jul 16, 2018
3
0
1
Did you find the way to format them ?
Unfortunatly not yet, I will try the -S flag later this week when I have the time.
And I will try and find myself a non RAID SATA adapter, onboard and or addon card to try again.

We should have some laying around.

Will let you know.
 

Wingman5

New Member
Jul 16, 2018
3
0
1
Ok tried almost everything in my power to do so....
Tried 6 different machines,
AMS-PhenomII on a ASUS board,
Tried a Intel Xeon Server main board
and 2 different (an old Pentium 4 and new with i5 8600K) Supermicro Server board,
and 1 Lenovo Desktop and a Dell Laptop with eSATA.
All controllers in AHCI and or IDE compatible.
even tried 2 External RAID cards 1 Arcera and 1 Asmedia.
And nothing seens to work with any of the commands with or without --six, with or without -S
tried setblocksize -b512 /dev/sg0 (on most machines) and also failed.

All complaining about the invalid opsense key.

I'll put them in my desk but I kind of give up... Sad to see 4x 100GB SSD go to waist. :(
 

Mike Smith3

New Member
Sep 25, 2018
1
0
1
Can anyone advise?

I have about 10x Hitachi HUA723020ALA640

I have attempted to use the directions that I see on page 1 of this thread. Here is the dialogue:

root@Orcrist:/boot# sg_scan -i
/dev/sg17: scsi8 channel=0 id=2 lun=0
NETAPP DS424IOM6 0173 [rmb=0 cmdq=1 pqual=0 pdev=0xd]

root@Orcrist:/boot# sg_format --format --size=512 /dev/sg17
NETAPP DS424IOM6 0173 peripheral_type: enclosure services device [0xd]
Unit serial number: SHJ000000003832
LU name: 500a09800655b6be
This format is only defined for disks (using SBC-2 or RBC) and MO media
sg_format failed: Malformed SCSI command​

using the device designation dev/sdq, I get

root@Orcrist:/boot# sg_format --format --size=512 /dev/sdq
HITACHI HUA723020ALA64SA NA01 peripheral_type: disk [0x0]
<< supports protection information>>
Unit serial number: YFJY5Y8A
LU name: 50000c90004e2a4c
Mode Sense (block descriptor) data, prior to changes:
No block descriptors present
Need to perform MODE SELECT (to change number or blocks or block length)
but (single) block descriptor not found in earlier MODE SENSE
sg_format failed: Malformed SCSI command​

I tried this on a separate machine running Windows 10 in Powershell using the Windows compiles sg_utils

PS C:\sg3ut_mgw64\bin> .\sg_scan.exe
PD3 HITACHI HUA723020ALA640 MK7ONS00 YGJX2A4A

PS C:\sg3ut_mgw64\bin> .\sg_format -v --long --format --fmtpinfo=0 --pfu=0 PD3
HITACHI HUA723020ALA640 MK7O peripheral_type: disk [0x0]
PROTECT=0
Unit serial number: YGJX2A4A
LU name: 5000cc2a24e8f222
mode sense(10) cdb: 5a 10 01 00 00 00 00 00 fc 00
Mode Sense (block descriptor) data, prior to changes:
No block descriptors present​

Any ideas? Is this using a firmware I need to flash? This is used equipment from a data center, though I'm not sure what the base firmware is. The Firmware is listed as MK70NSOO on the HGST WinDFT utility.

One more thought, using instructions here, second post from the bottom. Perhaps the T10-PI is turned on, so:

root@Orcrist:/boot# sg_format -v --long --format --fmtpinfo=3 --pfu=0 /dev/sg17
NETAPP DS424IOM6 0173 peripheral_type: enclosure services device [0xd]
PROTECT=0
Unit serial number: SHJ000000003832
LU name: 500a09800655b6be
This format is only defined for disks (using SBC-2 or RBC) and MO media​
root@Orcrist:/boot# sg_format -v --long --format --fmtpinfo=3 --pfu=0 /dev/sdq

HITACHI HUA723020ALA64SA NA01 peripheral_type: disk [0x0]

PROTECT=1
<< supports protection information>>
Unit serial number: YFJY5Y8A
LU name: 50000c90004e2a4c
mode sense(10) cdb: 5a 10 01 00 00 00 00 00 fc 00
Mode Sense (block descriptor) data, prior to changes:
No block descriptors present

A FORMAT UNIT will commence in 15 seconds
ALL data on /dev/sdq will be DESTROYED
Press control-C to abort

A FORMAT UNIT will commence in 10 seconds
ALL data on /dev/sdq will be DESTROYED
Press control-C to abort

A FORMAT UNIT will commence in 5 seconds
ALL data on /dev/sdq will be DESTROYED
Press control-C to abort
Format unit cdb: 04 d8 00 00 00 00
Format unit:
Fixed format, current; Sense key: Aborted Command
vendor specific ASC=98, ASCQ=05 (hex)
Format unit command: Aborted command, type: sense key, other than protection related (asc=0x10)
FORMAT UNIT failed
This time tried with the --size=512

root@Orcrist:/boot# sg_format -v --long --format --size=512 --fmtpinfo=3 --pfu=0 /dev/sg17​

NETAPP DS424IOM6 0173 peripheral_type: enclosure services device [0xd]
PROTECT=0
Unit serial number: SHJ000000003832
LU name: 500a09800655b6be
This format is only defined for disks (using SBC-2 or RBC) and MO media
root@Orcrist:/boot# sg_format -v --long --format --size=512 --fmtpinfo=3 --pfu=0 /dev/sdq
HITACHI HUA723020ALA64SA NA01 peripheral_type: disk [0x0]
PROTECT=1
<< supports protection information>>
Unit serial number: YFJY5Y8A
LU name: 50000c90004e2a4c
mode sense(10) cdb: 5a 10 01 00 00 00 00 00 fc 00
Mode Sense (block descriptor) data, prior to changes:
No block descriptors present
Need to perform MODE SELECT (to change number or blocks or block length)
but (single) block descriptor not found in earlier MODE SENSE
root@Orcrist:/boot# sg_format -v --long --format --size=512 --fmtpinfo=3 --pfu=0 /dev/sdq
HITACHI HUA723020ALA64SA NA01 peripheral_type: disk [0x0]
PROTECT=1
<< supports protection information>>
Unit serial number: YFJY5Y8A
LU name: 50000c90004e2a4c
mode sense(10) cdb: 5a 10 01 00 00 00 00 00 fc 00
Mode Sense (block descriptor) data, prior to changes:
No block descriptors present
Need to perform MODE SELECT (to change number or blocks or block length)
but (single) block descriptor not found in earlier MODE SENSE​
 
Last edited:

Wahab ahmed

New Member
Sep 26, 2018
2
0
1
Dear Bro,
Thanks for information but issue is i have tried on these below servers but it is not showing hdds on SG3 UTILS
HP PRO G7
DELL R610
IBM WORKSTATION
So now i need to know which server i need to use or any specific raid controller which can read these hdds on sg3-utils i am still stuck on that place kindly help me up !!!
regards,
Wahab ahmed
 

Wahab ahmed

New Member
Sep 26, 2018
2
0
1
My HGST Model: HUC109060CSS600 has same problem of 520 format i have used instruction of Format via sg-format in centos 7 formatted done but when i am going to use on HP G7, HP G6 still not able to initialize on array below error is coming
huc109060css600 a fatal error has occurred command : 12h
 

sand_storm

New Member
Aug 22, 2018
8
1
3
My HGST Model: HUC109060CSS600 has same problem of 520 format i have used instruction of Format via sg-format in centos 7 formatted done but when i am going to use on HP G7, HP G6 still not able to initialize on array below error is coming
huc109060css600 a fatal error has occurred command : 12h
try to set up it on HBA adapter, and test all media for errors. Looks like it does not correctly work with 512b block size
 

john0815

New Member
Oct 17, 2018
1
0
1
I hope it is not a bad question:

Where I can download a centos image for an Usb Stick which is running when the pc is booting over this usb-Stick.
I only found how to create an usb-Stick to install centos
 

kurbler

New Member
Oct 24, 2018
1
0
1
[QUOTE="...........
root@ubuntu:~# sg_format --format --size=512 -v /dev/sg2
HITACHI HUS72303CLAR3000 C442 peripheral_type: disk [0x0]
PROTECT=1
<< supports protection information>>
Unit serial number: YXGMGGTK
LU name: 5000cca046236594
mode sense (10) cdb: 5a 00 01 00 00 00 00 00 fc 00
Mode Sense (block descriptor) data, prior to changes:
Mode sense number of blocks maxed out, set longlba
mode sense (10) cdb: 5a 10 01 00 00 00 00 00 fc 00
Mode Sense (block descriptor) data, prior to changes:
<<< longlba flag set (64 bit lba) >>>
Number of blocks=5770371118 [0x157f0e02e]
Block size=520 [0x208]
mode select (10) cdb: 55 11 00 00 00 00 00 00 22 00
mode select (10):
Descriptor format, current; Sense key: Illegal Request
Additional sense: Parameter list length error
Descriptor type: Information: >> descriptor too short
00 00 00 00 00 00 00 00 00 00
Descriptor type: Sense key specific: Field pointer:
Error in Command: byte 7
Descriptor type: Field replaceable unit code: 0x0
Descriptor type: Block commands: Incorrect Length Indicator (ILI) clear
Descriptor type: Vendor specific [0x80]
f8 20
Descriptor type: Vendor specific [0x81]
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

......[/QUOTE]

many thx, Allan Houston

i had the same problem and with your great hint, it was possible to change the block length from 512 to 520 and now the ethers NAS don't tell me anymore "not supported" not it's present and I can use it. 1000 thx

cheers
Peter
 

Attachments

alyin

New Member
Dec 7, 2016
3
0
1
57
For those who are not familiar with Linux (me included), you can run Sg3 utility in Windows 10 CMD mode with admin right.
 

foogitiff

Member
Jul 26, 2018
95
24
8
Received 4 HGST DKR5D J600SS, already formatted with 512b, but they drop from my array as soon as I try to format them... I wonder if they were 520b before...
 

SG-35

New Member
Dec 20, 2018
1
0
1
[...]
C:\sg3>sg_format --format --size=512 --six -v pd1
[...]
have now signed up to just say "thank you".
The option "--six" helped a lot because I also got the message "illegal request" when setting the 512Byte sector size.
There were used HGST which are branded on NETAPP (Model: HUC109060CSS600 NETAPP PN 108-00221 + A0).
The reason for finding a solution was that the LSI controller from the Fujitsu server refused to set up the SAS HDDs.
Now I have to edit "only" 11 SAS HDDs accordingly ... one hour each ....: D

Hardware-Setup for solution (any other does not work.... however why)

Old Fujitsu P400
Adaptec 1405
SATA-Cable for Adaptec
DELL SAS SATA Adapter UF070
parted magic Stick, Boot at BIOS-Mode, x64 (vers. 01-2018)

Comandline:

Code:
sg_scan -i
sg_format --format --size=512 --six /dev/XXX
XXX = Dev-Name that was shown by sg_scan

Sry for my bad english :)
 

assetmonkey

New Member
Jan 17, 2019
2
0
1
North Carolina
Can this conversion be done on multiple drives at once? we have over 500 that need converting, we have various 24 bay storage units and have a unit that we custom built to handle 75 drives at once - we originally set up 5 desktop PC's running a linux version and ran SG_UTILS for each drive however this was resource nightmare for obvious reasons - any help appreciated.
 

Aestr

Well-Known Member
Oct 22, 2014
897
295
63
Los Angeles
Yes you can run multiple instances at once using your preferred method of multiple commands (screen, multiple terminal windows, etc.)
 

assetmonkey

New Member
Jan 17, 2019
2
0
1
North Carolina
Yes you can run multiple instances at once using your preferred method of multiple commands (screen, multiple terminal windows, etc.)
We are pretty new to Linux and so any help on how we would do that would be appreciated hugely! - In a perfect situation I would like to use our current 50 drive rig (PC with HP Raid card connected to 2 x 25 bay storage units) I can put a new boot drive inside purely for this task.

We have have run SG UTILS in the past but the command would only allow to use one DEVX at a time
 

bash62

New Member
Feb 6, 2019
1
0
1
Hi azev,

I am new to this sit and a beginner, I don't know if this is the way I can contact you.
I read about your instruction for formatting emc ssd
(I have taken off the emc bracket and the little circuit board connected at the back of the ssd to reveal the sata connection)

I used Centos7 in
PC:AMD Phenom 4x
Gigabyte motherboard.

I used sg3_utils but keep getting format failed: Illegal parameter

Tried HDDGURU, trys to format but fails: I/O problem.

In windows admin tools I did initialise and made MBR but cannot format request did not work.

Now when I connect this ssd to any PC bios does not detect anymore but windows does detect it.

Any advise please.

Bash62
 

hjulian

New Member
Feb 23, 2019
6
0
1
Wingman5,
I, too, bought those cheap EMC (Samsung, Model: MZ - 3S92000/0C3, EMC P/N: 118032714 REV A02) SATA SSDs mistakenly thinking they were SAS drives. I have now started my "journey" to see if I can reformat them to 512 bps.
I recall reading in my old IBM Intellistation 9228 manual or my Dell Precision 690 Workstation (not sure anymore which one it was) that if you combine SATA drives together with SAS drives in a SAS RAID controller, the first drive MUST be a SATA drive.
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?

Another idea: I still have the connectors they came with but they are fibre channel adapters (40 pins) and I don't have a server or workstation with that system. Maybe the SATA drives connected to their original fibre channel adapters would take SAS commands?

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. The second workaround will be attempted when I have found out how to get that fibre channel adapter into my system.