How to use SSD with locked 520 bytes block?

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

richard.dzavoronok

Active Member
Jun 23, 2021
158
81
28
I hope you all are doing great.

Few days ago I made quite stupid purchase and did not read specs carefully. I purchased 12 pieces of Micron p400m 200gb SSDs quite cheap. It was pretty good deal and in a fear of missing out I made haste purchase. MTFDDAK400MAN-2S1AA is what I have and is locked 520 and I was checking wrong datasheet for MTFDDAK400MAN-1S1AA which is 512.
I wanted to use them in my hp dl380p gen8.
Long story short, it seems this drive cannot be formatted to 512 bytes at all as it is locked because of physical block size is 520.

This are data from smartctl:
Device Model: P400m200-MTFDDAK200MAN
Sector Size: 520 bytes logical/physical

So my questions are:
Is my unability to use my drives hardware or OS?
Does it exist piece of hardware that translates byte sector size like special interposer?
Do I need SAN solution?
What cheap solution does support these drives?

Thanks!

Edit: sg3-utils cannot format these drives
Edit2: more questions
 
Last edited:
  • Like
Reactions: Bert

JackAss

New Member
Mar 24, 2020
11
2
3
Hi,
I have some of them too and same problem...

I tried without success the sg_format, the blocksize util, scu, dd, camcontrol and probably some other that I don't remember, I tried in windows and linux, I can try also in solaris but I don't know well the system so I cannot install the utility to use (on a dell R620 I installed solaris 10 but it cannot see the network and I don't know how to pass the files, I need to try usb drive or to fix the network, if someoen can help I will try)

The next thing I can try is to install the 512b version of the firmware but I cannot find it anywhere, if someone can provide me the firmware I will happlily try...

Thanks
 

richard.dzavoronok

Active Member
Jun 23, 2021
158
81
28
You tried a lot I see. Certainly more than I tried.
I did give up and returned the drives. The guy was nice enough to accept return.
Shame that it can't be done, I got them for 8 euros each.
 

RolloZ170

Well-Known Member
Apr 24, 2016
5,159
1,549
113
AFAIK what i under stood: the SSD must zero'ed first.
make a SSD/HDD usable
1) init drive struct.
2) create partitions
3) format

if you format only without clearing the drive struct it fails.

but hoho, maybe there are hints i did'nt see.
 
Last edited:

JackAss

New Member
Mar 24, 2020
11
2
3
I think that here the problem is in the first point, seems that the firmware does not allow to init the drive struct changing the sector size from 520b to 512b.

Can you provide instruction on how to init drive struct and zero the SSD?

I think you are referring to the "sg_format -v --format --size=512 /dev/sgX" that I already tried (also with the --six option without success) but if you know other tool/command please let me know and I will try.

Thanks!
 

JackAss

New Member
Mar 24, 2020
11
2
3
Ohh you are referring to the link above, sorry I did not understand this, I already tried everything in that link post and in the comments and unfortunately nothing worked, I can repeat everything taking logs if needed to help to achieve a solution
 

RolloZ170

Well-Known Member
Apr 24, 2016
5,159
1,549
113
I already tried everything in that link post and in the comments and unfortunately nothing worked,
he makes two thinks first that not worked like you, if you just apply the code chronologic it will not work.
read the text, you have to zero the ssd first.


sg_format to the rescue!
code...
So we can use this to format to 512 bytes, right? Usually… but…
code...

Oh noooo it wont format will it require something arcane? Nah. This is just the drives way of telling you that it is destructive. Different kinds of drives require different massage here. You might have to do something like

dd if=/dev/zero of=/dev/sg??? bs=104857600

to zero the device. Or just us sg_format to zero the drive with 520 byte sectors:

code
 

JackAss

New Member
Mar 24, 2020
11
2
3
Hi,
I re-executed everything in that link:

Drive recognition and info:

Bash:
[  143.737644] scsi 0:0:3:0: Direct-Access     ATA      P400m200-MTFDDAK 0239 PQ: 0 ANSI: 6
[  143.737654] scsi 0:0:3:0: SATA: handle(0x000b), sas_addr(0x500056b37789abf0), phy(16), device_name(0x0000000000000000)
[  143.737657] scsi 0:0:3:0: enclosure logical id (0x500056b36789abff), slot(1)
[  143.737879] scsi 0:0:3:0: atapi(n), ncq(y), asyn_notify(n), smart(y), fua(y), sw_preserve(y)
[  143.737900] scsi 0:0:3:0: qdepth(32), tagged(1), scsi_level(7), cmd_que(1)
[  143.739534] sd 0:0:3:0: Attached scsi generic sg1 type 0
[  143.739672] sd 0:0:3:0: Power-on or device reset occurred
[  143.739754]  end_device-0:0:3: add: handle(0x000b), sas_addr(0x500056b37789abf0)
[  143.740109] sd 0:0:3:0: [sdb] Unsupported sector size 520.
[  143.741555] sd 0:0:3:0: [sdb] 0 512-byte logical blocks: (0 B/0 B)
[  143.741567] sd 0:0:3:0: [sdb] 520-byte physical blocks
[  143.744611] sd 0:0:3:0: [sdb] Write Protect is off
[  143.744621] sd 0:0:3:0: [sdb] Mode Sense: 7f 00 10 08
[  143.745092] sd 0:0:3:0: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA
[  143.798158] sd 0:0:3:0: [sdb] Unsupported sector size 520.
[  143.803497] sd 0:0:3:0: [sdb] Attached SCSI disk


root@PowerEdge-R620:~# smartctl --all /dev/sg1
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.11.0-43-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     P400m200-MTFDDAK200MAN         118032957
Serial Number:    13060367798F
LU WWN Device Id: 5 00a075 10367798f
Firmware Version: 0239
User Capacity:    200.049.647.720 bytes [200 GB]
Sector Size:      520 bytes logical/physical
Rotation Rate:    Solid State Device
Form Factor:      2.5 inches
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-2 T13/2015-D revision 3
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Thu Dec 23 15:58:44 2021 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled



root@PowerEdge-R620:~# sg_scan -v -i /dev/sg1
/dev/sg1: scsi0 channel=0 id=3 lun=0
    ATA       P400m200-MTFDDAK  0239 [rmb=0 cmdq=1 pqual=0 pdev=0x0]


Command on that link execution:

Bash:
root@PowerEdge-R620:~# sg_format /dev/sg1
    ATA       P400m200-MTFDDAK  0239   peripheral_type: disk [0x0]
      Unit serial number: 13060367798F
      LU name: 500a07510367798f
Mode Sense (block descriptor) data, prior to changes:
  Number of blocks=0 [0x0]
  Block size=512 [0x200]
Read Capacity (10) results:
   Number of logical blocks=384710861
   Logical block size=520 bytes
  Warning: mode sense and read capacity report different block sizes [512,520]
           Probably needs format
No changes made. To format use '--format'. To resize use '--resize'


root@PowerEdge-R620:~# sg_format -v --format --size=512 /dev/sg1
    ATA       P400m200-MTFDDAK  0239   peripheral_type: disk [0x0]
      PROTECT=0
      Unit serial number: 13060367798F
      LU name: 500a07510367798f
    mode sense(10) cdb: 5a 00 01 00 00 00 00 00 fc 00
Mode Sense (block descriptor) data, prior to changes:
  Number of blocks=0 [0x0]
  Block size=512 [0x200]

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

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

A FORMAT UNIT will commence in 5 seconds
    ALL data on /dev/sg1 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 field in cdb
Format unit command: Illegal request, type: sense key, apart from Invalid opcode
FORMAT UNIT failed


root@PowerEdge-R620:~# dd if=/dev/zero of=/dev/sg1 bs=104857600
dd: error writing '/dev/sg1': Cannot allocate memory
1+0 records in
0+0 records out
0 bytes copied, 0,0509513 s, 0,0 kB/s


root@PowerEdge-R620:~# sg_format -v --format --size=520 /dev/sg1
    ATA       P400m200-MTFDDAK  0239   peripheral_type: disk [0x0]
      PROTECT=0
      Unit serial number: 13060367798F
      LU name: 500a07510367798f
    mode sense(10) cdb: 5a 00 01 00 00 00 00 00 fc 00
Mode Sense (block descriptor) data, prior to changes:
  Number of blocks=0 [0x0]
  Block size=512 [0x200]
    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 cdb
Try MODE SELECT again with SP=0 this time
    mode select(10) cdb: 55 10 00 00 00 00 00 00 1c 00

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

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

A FORMAT UNIT will commence in 5 seconds
    ALL data on /dev/sg1 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 field in cdb
Format unit command: Illegal request, type: sense key, apart from Invalid opcode
FORMAT UNIT failed


root@PowerEdge-R620:~# sg_format -F -F -F --size=512 /dev/sg1

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

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

A FORMAT UNIT will commence in 5 seconds
    ALL data on /dev/sg1 will be DESTROYED
        Press control-C to abort
Format unit command: Illegal request
FORMAT UNIT failed
    try '-v' for more information
sg_format failed: Illegal request


root@PowerEdge-R620:~# printf '\0\0\0\10\0\0\0\0\0\0\2\0' | sg_raw --send=12 /dev/sg1 15 11 00 00 0c 00
SCSI Status: Check Condition

Sense Information:
Fixed format, current; Sense key: Illegal Request
Additional sense: Invalid field in cdb
I have also tried the camcontrol command from a truenas installation (I don't have the log saved here) and still not working.
 

RolloZ170

Well-Known Member
Apr 24, 2016
5,159
1,549
113
root@PowerEdge-R620:~# dd if=/dev/zero of=/dev/sg1 bs=104857600
dd: error writing '/dev/sg1': Cannot allocate memory
1+0 records in
0+0 records out
0 bytes copied, 0,0509513 s, 0,0 kB/s

your zero drive cmd does not worked
 

RolloZ170

Well-Known Member
Apr 24, 2016
5,159
1,549
113
as described in the link-text you have to zero the drive first.
the code shown is NOT in chronological order.
if zero drive for you not work that way, try secure erase tools i.e.
 

JackAss

New Member
Mar 24, 2020
11
2
3
Hi,
yes I understand this, can you help with the correct command?

Trying dd with 512b sector and using /dev/sg1 and /dev/sdb:
Bash:
root@PowerEdge-R620:~# dd if=/dev/zero of=/dev/sg1 bs=512 count=384710861
dd: error writing '/dev/sg1': Numerical argument out of domain
2+0 records in
1+0 records out
512 bytes copied, 0,000564141 s, 908 kB/s

root@PowerEdge-R620:~# dd if=/dev/zero of=/dev/sdb bs=512 count=384710861
dd: error writing '/dev/sdb': No space left on device
1+0 records in
0+0 records out
0 bytes copied, 0,000485376 s, 0,0 kB/s
Trying dd with 520b sector and using /dev/sg1 and /dev/sdb:
Bash:
root@PowerEdge-R620:~# dd if=/dev/zero of=/dev/sg1 bs=520 count=384710861
dd: error writing '/dev/sg1': Numerical argument out of domain
2+0 records in
1+0 records out
520 bytes copied, 0,000543753 s, 956 kB/s

root@PowerEdge-R620:~# dd if=/dev/zero of=/dev/sdb bs=520 count=384710861
dd: error writing '/dev/sdb': No space left on device
1+0 records in
0+0 records out
0 bytes copied, 0,000491742 s, 0,0 kB/s
Trying sg_dd with 512b sector and using /dev/sg1 and /dev/sdb:
Bash:
root@PowerEdge-R620:~# sg_dd bs=512 if=/dev/zero of=/dev/sg1 time=1 verbose=2 count=384710861
 >> Input file type: other (perhaps ordinary file)
        open input, flags=0x0
 >> Output file type: SCSI generic (sg) device
        open output(sg_io), flags=0x802
    inquiry cdb: 12 00 00 00 24 00
    /dev/sg1: ATA       P400m200-MTFDDAK  0239  [pdt=0]
writing: Host_status=0x0b [DID_SOFT_ERROR]
sg_write failed, seek=0
time to transfer data: 0.283406 secs at 0.23 MB/sec
Some error occurred,  remaining block count=384710861
128+0 records in
0+0 records out
1 unrecovered error(s)

root@PowerEdge-R620:~# sg_dd bs=512 if=/dev/zero of=/dev/sdb time=1 verbose=2 count=384710861
 >> Input file type: other (perhaps ordinary file)
        open input, flags=0x0
 >> Output file type: block device
        create output, flags=0x41
sg_dd: writing, seek=0 : No space left on device
time to transfer data: 0.000032 secs at 2048.00 MB/sec
Some error occurred,  remaining block count=384710861
128+0 records in
0+0 records out
Trying with 520b sector and using /dev/sdb:
Bash:
root@PowerEdge-R620:~# sg_dd bs=520 if=/dev/zero of=/dev/sdb time=1 verbose=2 count=384710861
 >> Input file type: other (perhaps ordinary file)
        open input, flags=0x0
 >> Output file type: block device
        create output, flags=0x41
sg_dd: writing, seek=0 : No space left on device
time to transfer data: 0.000037 secs at 1798.92 MB/sec
Some error occurred,  remaining block count=384710861
128+0 records in
0+0 records out
The only command that does not immediatly error out is:
Bash:
root@PowerEdge-R620:~# sg_dd bs=520 if=/dev/zero of=/dev/sg1 time=1 verbose=2 count=384710861
 >> Input file type: other (perhaps ordinary file)
        open input, flags=0x0
 >> Output file type: SCSI generic (sg) device
        open output(sg_io), flags=0x802
    inquiry cdb: 12 00 00 00 24 00
    /dev/sg1: ATA       P400m200-MTFDDAK  0239  [pdt=0]
time to transfer data: 842.017062 secs at 237.58 MB/sec
384710861+0 records in
384710861+0 records out
which seems to zero the disk but even after this I still receive the same error on every command that should change the sector size to 512b
 

RolloZ170

Well-Known Member
Apr 24, 2016
5,159
1,549
113
have checked the MTFDDAK400MAN-2S1AA
you have to change the firmware if possible, the current FW is locked to 520b which is very rare on those drives thought.
 

JackAss

New Member
Mar 24, 2020
11
2
3
have checked the MTFDDAK400MAN-2S1AA
you have to change the firmware if possible, the current FW is locked to 520b which is very rare on those drives thought.
That's what I was thinking but I cannot find anywhere the firmware of the 512b version (MTFDDAK400MAN-1S1AA) if anybody can provide it I try to install it