How to reformat HDD & SSD to 512B Sector Size

frogtech

Well-Known Member
Jan 4, 2016
1,440
247
63
34
HP/HGST 400 ГБ 2.5" 12Gb/s SAS SSD HUSML 4040ASS600 (520)
what should I do? I don't understand the code....



ubuntu@ubuntu:~$ sudo sg_scan -i
/dev/sg0: scsi9 channel=0 id=0 lun=0 [em]
iODD External HDD [rmb=0 cmdq=0 pqual=0 pdev=0x0]
/dev/sg1: scsi9 channel=0 id=0 lun=1 [em]
iODD Virtual CD-Rom [rmb=1 cmdq=0 pqual=0 pdev=0x5]

ubuntu@ubuntu:~$ sudo sg_format --format --size=512 --fmtpinfo=0 /dev/sd0
error opening device file: /dev/sd0: No such file or directory

ubuntu@ubuntu:~$ sudo sg_format --format --size=512 --fmtpinfo=0 /dev/sg0 -v
iODD External HDD peripheral_type: disk [0x0]
PROTECT=0
Unit serial number: S25WJ9CB612866
LU name: 60024e920573a2750000000000000000
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=625142448 [0x2542eab0]
Block size=512 [0x200]

A FORMAT UNIT will commence in 5 seconds
ALL data on /dev/sg0 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

sg_scan -i
sg_scan: Error opening /dev/sg0 : Permission denied
/dev/sg1: scsi9 channel=0 id=0 lun=1 [em]
iODD Virtual CD-Rom [rmb=1 cmdq=0 pqual=0 pdev=0x5]
I'd probably just try directly connecting it instead of using what to me appears to be you housing the drive inside an enclosure that also has some emulation firmware that runs on top of it for booting from ISOs stored on the disk. You'd even need a SAS backplane or a breakout cable that has the entire SAS interface (/w power) on it.
 
  • Like
Reactions: Samir

Sergy

New Member
Jan 15, 2022
3
2
3
It seems to me that - ubuntu 18 live - just does not see my controler -Dell TXCMC ASR-8405 SAS/SATA 12Gb/s - although it is connected in HBA mode directly. ubuntu 18 live - shows only CD and SATA .It is necessary to mount the controller to begin with.
 
  • Like
Reactions: Samir

KablammoNick

New Member
Jan 24, 2022
1
2
3
Please excuse the stream-of-consciousness post. Not sure how best to get all the information in one spot...

Got some 200Gb SSD’s in an EMC2 enclosure.
Drives P/N: MZ3S9200XACP-000C3.
They appear to be SATA drives (as missing the joined connector bit usually seen for SAS drives)

The Interposers are 250-136-903C, as per https://www.reddit.com/r/homelab/comments/bxx24u it sort of says they’re SAS, but the connector has me confused.

Can’t seem to format them to 512b.

Tried Ubuntu live USB and sg3utils as per 10TB for $70! How to format 520b sector SAS drives to 512b - EMC, Netapp, HP, Dell, etc. - YouTube 1
“sg_format --format --size=512 --fmtpinfo=0 /dev/sg0”

  • Added -6 and -v
  • Errors with “Illegal request, Invalid opcode, type: sense key + asc,ascq”
Tried FreeBSD live USB and camcontrol as per da0: invalid sector size 520 and Repurposing netapp disk trays with FreeBSD and ZFS – Sysop.ca
“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”

  • Fails with error (can’t recall it now but can drop back into FreeBSD to get it specifically if someone wants it)
Have tried both sets of commands with:

  • Drive connected to SATA port on motherboard
  • Drive connected to HBA via SAS connector
  • Drive connected in disk shelf via SAS connector (to the ‘bottom’ port as described https://www.reddit.com/r/homelab/comments/7kumy8 and a few other posts)
  • HBA is an LSI 9200-8i, identifies as IBM 6Gb Perf HBA on firmware 15.00.00.00-IT.
 
  • Like
Reactions: yukas and Samir

dopalgangr

New Member
Jan 24, 2022
1
1
1
Anyone else come across these drives, I'm beginning to think they cannot be changed? I've tried almost everything and keep getting errors. LSI 2108 (Dell H200 flashed to IT-mode).

Seagate ST1600FM0013 DOM 6/27/18 Sector size locked to 528
Seagate XS1600ME70014 DOM 5/30/19 Sector size locked to 528

I reinstalled Centos 8 and unlike Ubuntu I found that the drivers for the LSI HBA were not installed since the lshw showed the card as unclaimed. I then found ar video on that issue and was able to get the card driver installed as seen below. But alas in the end it still errors out. I can format it by keeping the sector size at 528k (however this 1.6TB says complete in about 50sec??) but when changing that syntax to another number I get the error below again. What do you think is wrong here?

Again, I appreciate your time,
Glen

[root@localhost glen]# lsscsi -g
[0:0:0:0] disk Generic STORAGE DEVICE 9833 /dev/sdc /dev/sg2
[1:0:0:0] disk IBM-SSG SSVJ1P6 6214 /dev/sda /dev/sg0
[1:0:1:0] disk IBM-SSG SSIJ1P6 E403 /dev/sdb /dev/sg1
[2:0:0:0] disk ATA CT250BX100SSD1 MU02 /dev/sdd /dev/sg3
[7:0:0:0] cd/dvd PLDS DVD-RW DH16ACSH JL3B /dev/sr0 /dev/sg4
[root@localhost glen]# sg_readcap /dev/sg0
Read Capacity results:
Last LBA=3030911575 (0xb4a80a57), Number of logical blocks=3030911576
Logical block length=528 bytes
Hence:
Device size: 1600321312128 bytes, 1526185.3 MiB, 1600.32 GB
[root@localhost glen]# rpm -qf /bin/sg_readcap
sg3_utils-1.44-5.el8.x86_64
[root@localhost glen]# yum list installed sg3_utils
Installed Packages
sg3_utils.x86_64 1.44-5.el8 @anaconda
[root@localhost glen]# sg_format --format --size=512 /dev/sg0
IBM-SSG SSVJ1P6 6214 peripheral_type: disk [0x0]
Unit serial number: ZAL1669W0000822150Z3
LU name: 5000c500bb35c61c
Mode Sense (block descriptor) data, prior to changes:
Number of blocks=3030911576 [0xb4a80a58]
Block size=528 [0x210]
Try MODE SELECT again with SP=0 this time
MODE SELECT command: Illegal request
try '-v' for more information
sg_format failed: Illegal request
[root@localhost glen]# sg_format --format --size=5 /dev/sg0
IBM-SSG SSVJ1P6 6214 peripheral_type: disk [0x0]
Unit serial number: ZAL1669W0000822150Z3
LU name: 5000c500bb35c61c
Mode Sense (block descriptor) data, prior to changes:
<<< longlba flag set (64 bit lba) >>>
Number of blocks=3030911576 [0xb4a80a58]
Block size=528 [0x210]
Try MODE SELECT again with SP=0 this time
MODE SELECT command: Illegal request
try '-v' for more information
sg_format failed: Illegal request
[root@localhost glen]# sg_format --format --size=528 /dev/sg0
IBM-SSG SSVJ1P6 6214 peripheral_type: disk [0x0]
Unit serial number: ZAL1669W0000822150Z3
LU name: 5000c500bb35c61c
Mode Sense (block descriptor) data, prior to changes:
Number of blocks=3030911576 [0xb4a80a58]
Block size=528 [0x210]

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

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

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

Format unit has started
FORMAT UNIT Complete
[root@localhost glen]# sg_format --format --size=512 /dev/sg0
IBM-SSG SSVJ1P6 6214 peripheral_type: disk [0x0]
Unit serial number: ZAL1669W0000822150Z3
LU name: 5000c500bb35c61c
Mode Sense (block descriptor) data, prior to changes:
Number of blocks=3030911576 [0xb4a80a58]
Block size=528 [0x210]
Try MODE SELECT again with SP=0 this time
MODE SELECT command: Illegal request
try '-v' for more information
sg_format failed: Illegal request
 
  • Like
Reactions: Samir

Parvaz

New Member
Feb 24, 2022
3
1
3
Hello
I need help have following setup but the HBA is not recognizing the drive

Controller:
LSI SAS9211-8I - TI mode flashed

Drive:

HPE Model# HKCF0600S5xeN015
Firmware# 3P00

HPE Model# STHB1800S5xeN010
Firmware# 3P00

Thank You
 
  • Like
Reactions: Samir

Fritz

Well-Known Member
Apr 6, 2015
2,961
990
113
68
Trying to format a NetApp 4TB SAS drive to 512 sectors and have run into this problem.

NetAppNoGo.PNG

This is as far as it will go. HD Sentinel says drive is 100% health. Any ideas?
 
  • Like
Reactions: Samir

sick1655

New Member
Mar 16, 2021
9
2
3
Hello everyone, Im trying to format my disk from size 528 to 512 but can't succeed. I have not formatted many of my disks before, but I cannot change the size of the disk you see in the picture. here i will write the methods i tried.

the problem i faced : illegal request type sense key apart from invalid opcode

ı have a HP Qlogic QLE2562 - 489191-001 - PCIe 8GB Dual Port FC HBA

Home · ahouston/setblocksize Wiki (I tried, it didn't work)

sg_format --format --size=512 /dev/sg2 ( I tried, it didn't work)

GitHub - Drive-Trust-Alliance/sedutil: DTA sedutil Self encrypting drive software (I tried, it didn't work)

GÖRSEL.jpeg
WhatsApp Image 2022-04-13 at 7.45.01 PM.jpeg
 
  • Like
Reactions: Samir

bandit8623

Member
May 25, 2021
51
12
8
Hello everyone, Im trying to format my disk from size 528 to 512 but can't succeed. I have not formatted many of my disks before, but I cannot change the size of the disk you see in the picture. here i will write the methods i tried.

the problem i faced : illegal request type sense key apart from invalid opcode

ı have a HP Qlogic QLE2562 - 489191-001 - PCIe 8GB Dual Port FC HBA

Home · ahouston/setblocksize Wiki (I tried, it didn't work)

sg_format --format --size=512 /dev/sg2 ( I tried, it didn't work)

GitHub - Drive-Trust-Alliance/sedutil: DTA sedutil Self encrypting drive software (I tried, it didn't work)

View attachment 22488
View attachment 22489
those may be psid locked? try seatools gui or try parted magic and use the unlocker tool. otherwise try a lsi sas3 raid card you can run a secure erase from there.
 

ioan

New Member
Nov 2, 2016
13
2
3
62
I have a NetApp's samsung pm1635a 1714 6.4tb sas ssd (MZILS6T4HMLS)
Can't even read it capacity (seems due to firmware):

### smartctl --all /dev/sdb
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-90-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor: SAMSUNG
Product: MZILS6T4HMLS-0G5
Revision: MS01
Compliance: SPC-4
LU is resource provisioned, LBPRZ=1
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
Logical Unit id: 0x5002538a0740c8f0
Serial number: S3GXNA0J401111
Device type: disk
Transport protocol: SAS (SPL-3)
Local Time is: Fri May 13 13:56:53 2022 UTC

device Test Unit Ready [medium or hardware error (serious)]
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

### sg_readcap /dev/sdb
read capacity(10):
Descriptor format, current; Sense key: Hardware Error
Additional sense: Logical unit failure
Descriptor type: Sense key specific: Actual retry count: 0
Descriptor type: Field replaceable unit code: 0x0
Descriptor type: Vendor specific [0x80]
00 24 3e 01
pass-through requested 8 bytes (data-in) but got 0 bytes
READ CAPACITY (10) failed: Medium or hardware error
sg_readcap failed: Medium or hardware error

### sg_format -v --format --size=512 /dev/sdb

SAMSUNG MZILS6T4HMLS-0G5 MS01 peripheral_type: disk [0x0]
PROTECT=1
<< supports protection information>>
Unit serial number: S3GXNA0J401111
LU name: 5002538a0740c8f0
mode sense(10) cdb: 5a 00 01 00 00 00 00 00 fc 00
mode sense(10):
Descriptor format, current; Sense key: Hardware Error
Additional sense: Logical unit failure
Descriptor type: Sense key specific: Actual retry count: 0
Descriptor type: Field replaceable unit code: 0x0
Descriptor type: Vendor specific [0x80]
00 24 3e 01
pass-through requested 252 bytes (data-in) but got 0 bytes

MODE SENSE (10) command: Medium or hardware error, type: sense key (plus blank check for tape)

--------------

Is anything can be made for use it with LSI 9300 controller ?
 

bandit8623

Member
May 25, 2021
51
12
8
I have a NetApp's samsung pm1635a 1714 6.4tb sas ssd (MZILS6T4HMLS)
Can't even read it capacity (seems due to firmware):

### smartctl --all /dev/sdb
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-90-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor: SAMSUNG
Product: MZILS6T4HMLS-0G5
Revision: MS01
Compliance: SPC-4
LU is resource provisioned, LBPRZ=1
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
Logical Unit id: 0x5002538a0740c8f0
Serial number: S3GXNA0J401111
Device type: disk
Transport protocol: SAS (SPL-3)
Local Time is: Fri May 13 13:56:53 2022 UTC

device Test Unit Ready [medium or hardware error (serious)]
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

### sg_readcap /dev/sdb
read capacity(10):
Descriptor format, current; Sense key: Hardware Error
Additional sense: Logical unit failure
Descriptor type: Sense key specific: Actual retry count: 0
Descriptor type: Field replaceable unit code: 0x0
Descriptor type: Vendor specific [0x80]
00 24 3e 01
pass-through requested 8 bytes (data-in) but got 0 bytes
READ CAPACITY (10) failed: Medium or hardware error
sg_readcap failed: Medium or hardware error

### sg_format -v --format --size=512 /dev/sdb

SAMSUNG MZILS6T4HMLS-0G5 MS01 peripheral_type: disk [0x0]
PROTECT=1
<< supports protection information>>
Unit serial number: S3GXNA0J401111
LU name: 5002538a0740c8f0
mode sense(10) cdb: 5a 00 01 00 00 00 00 00 fc 00
mode sense(10):
Descriptor format, current; Sense key: Hardware Error
Additional sense: Logical unit failure
Descriptor type: Sense key specific: Actual retry count: 0
Descriptor type: Field replaceable unit code: 0x0
Descriptor type: Vendor specific [0x80]
00 24 3e 01
pass-through requested 252 bytes (data-in) but got 0 bytes

MODE SENSE (10) command: Medium or hardware error, type: sense key (plus blank check for tape)

--------------

Is anything can be made for use it with LSI 9300 controller ?
just one drive? or multiple? seems like you possibly have bad drives. the medium or hardware error usually is not good.

could try the https://semiconductor.samsung.com/resources/user-manual/Samsung_DCToolkit_V2.1_User_Guide.pdf
samsung dc toolkit and try to format with that.
 

DouglasteR

Active Member
Dec 19, 2015
119
25
28
Just bought another 4 for my RAID and......... they are 520B , dammit. :(

My LSi 9361-16i does detect them, but as "unsupported" because of the 520B block format:

D2.PNG

Tried to change it with the SG_format but it only detects my Raid Controller:

D4.PNG

I also tried to sanitize the drivers, but it gives me an error whatever the option i choose:

D5.PNG

Any ideas ?

I have a spare HBA solely for the Tape drive and will try to use it to format the drives, well see. (as soon i gather the courage to open the case again :( )
 

BerryJP

New Member
May 20, 2022
5
0
1
Hi all,
I found this thread and made an account just to ask you legends about this:
I've been scrolling through here and couldn't find them, but have the opportunity to buy some Netapp 3.8TB Samsung SSDs with caddies for the shelf I use. It's an absolute bargain but I'm worried I won't be able to reformat to 512 to use them for ZFS.
MZILT3T8HALS-000G3
The Netapp part number is X357-a.

Does anyone have any experience before I buy these things?

I have about 12 hours to decide.
 

DouglasteR

Active Member
Dec 19, 2015
119
25
28
It's the same 3.84TB SAS SSD that we all know.

IF they come formatted in 520B, you will need a compatible HBA and sg_format to convert them.
 

BerryJP

New Member
May 20, 2022
5
0
1
It's the same 3.84TB SAS SSD that we all know.

IF they come formatted in 520B, you will need a compatible HBA and sg_format to convert them.
Thank you!

Oh brilliant. So there isn't some kind of firmware lock, then.

What would be a compatible HBA? Just a SAS one in IT mode or is there a known model that works well?
I might be getting 9 of them for about 300USD from a Netapp shelf.
 

DouglasteR

Active Member
Dec 19, 2015
119
25
28
Thank you!

Oh brilliant. So there isn't some kind of firmware lock, then.

What would be a compatible HBA? Just a SAS one in IT mode or is there a known model that works well?
I might be getting 9 of them for about 300USD from a Netapp shelf.
MAYBE there is, but it's really difficulty (it was common on very old drives AFAIK)

I sucessfully used a SAS 3008 fury to format mine.