SAS drive medium format corrupted

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

tcpluess

Member
Jan 22, 2024
78
8
8
Hi,
so I have some SAS hard disks. I started formatting them, using sg_format. Like so:

sg_format --format --size=4096 --verbose /sev/sgX

however, by accident, I rebooted my machine before sg_format was complete, as I let it run in the background.
After I realised my mistake, I checked and indeed found that my drives report a size of 0. And I cannot access them.
In "dmesg" I can see the error "cannot read partition table: medium format corrupted".

So I just tried sg_format once again. And this time let it complete.
Unfortunately, the sg_format utility, after it has reached 100%, reports "an error occured: device reset during format", however I did not do any manual device resets, I really let everything just sit there and let it format.
Still dmesg reports "medium format corrupted".
I tried sg_format again....... and of course I get the same result. At least now under lsblk my drive is reported as 12TB, which is good, but still I cannot use it ("cannot read partition table" and "I/O error" are common errors I get when I try to access this disk).

I don't think the disk is actually bad, as I could access it before, but it had some elements in the grown defect list and I read that I can clear the grown defect list and force a complete surface check when a sg_format is issued. So that was the reason I did this. It hat 1 element in the grown defect list, and before using the disk for my valuable data, I wanted to make sure that there were not more defects. So this was the initial reason for doing this.

Did I just brick the disk, or is it somehow possible to recover? I mean, every time I run sg_format, it runs through without problems, it's just the disk don't let me access. Also I cannot run smartctl, this one claims "the device is not ready". I decided today I will let it sit there for the whole day, powered on, to see if it somehow recovers.

For one other disk I was able to fix this: it also had 2 or 3 elements in the grown defect list, then I let sg_format run, the grown defect list was set to zero, and then I let badblocks run. Took me almost one week, but it reported zero errors, the background medium scan also reports zero errors and the grown defect list stays so far at 0 elements, so I would say this particular disk can be used. But the other one seems to be bricked somehow.

Any possibility to recover?

one indicator that the disk is probably good is, that sg_logs reports zero errors, like no ECC recovered, no uncorrectable errors and so on. It's just that Linux reports it cannot read the partition table (which is true because the disk is formatted and therefore there is no partition table) and that the medium format is corrupted, which should not be true as sg_format completed......
 

CyklonDX

Well-Known Member
Nov 8, 2022
1,177
404
83
Whats the make&model of the disk;

Have you formatted this model before to 4096 with sg_format?
 

tcpluess

Member
Jan 22, 2024
78
8
8
The disk is an Ultrastar DC HC530.

Yes, I have formatted it before with 4096, and this was when I accidentally rebooted.
 

tcpluess

Member
Jan 22, 2024
78
8
8
This is the output from sg_format:

Code:
...
Format unit in progress, 99.85% done
Format unit in progress, 99.94% done
test unit ready:
Fixed format, current; Sense key: Unit Attention
Additional sense: Device internal reset
FORMAT UNIT Complete
but I don't understand why there is this reset when sg_format completes.
 

Whaaat

Active Member
Jan 31, 2020
362
190
43
try to reformat to a non standard sector size first, 4160 and then revert to 4096. It may take a while but drive will be forced to actually do something instead of just filling sectors with zeros without making any changes to the damaged layout.
 

tcpluess

Member
Jan 22, 2024
78
8
8
try to reformat to a non standard sector size first, 4160 and then revert to 4096. It may take a while but drive will be forced to actually do something instead of just filling sectors with zeros without making any changes to the damaged layout.
ok thanks, will try. Funny enough, the previous attempt to format took like ~24h, so it looked like the drive was doing something.
 

tcpluess

Member
Jan 22, 2024
78
8
8
Just use wdckit with --fastformat option, and download to drive lastest fw LDGNC400
I found the firmware LDGNC400 and was able to download it to the drive. I used

Code:
sg_write_buffer -vvvvv -m 5 --in LDGNC400.bin /dev/sg0
to download it to the drive. I don't know if this is the "right" way of doing it, but I found this here in the forum


and the drive accepted it after approx. 13 seconds of download time. Now my drive reports as C400 firmware version in smartctl, neat!

I am now running the full format using wdckit. Like so

wdckit format /dev/sg0 -b 4096

I started yesterday evening, today in the morning it was at 45% so I guess tonight it will be finished and I will report. I hope my drives can be fixed in this way. What do you think, if it formats without errors, and the grown defect list does not increase, shall I run badblocks on it? would you trust this drive your valuable data? I mean the drives were for free, I could really use the 14TB and I use ZFS, so I see no problem with data corruption.

One thing that puzzles me slightly is that one of the drives already had some items in the grown defect list. After sg_format, the grown defect list was cleared (0 items) and I let badblocks run over the drive. It runs now for 5 days almost and has found zero problems, so I wonder if formatting really clears bad sectors. In that case I would say the drive can be used again.

Power on hours for all drives I got is around 30k hours, so basically nothing for this kind of drive. The only reason they were replaced is that they are from 2019, so the 5yr warranty has ended.
 

tcpluess

Member
Jan 22, 2024
78
8
8
I never used badblocks, i just using dd read to null, and if grown defect list non zero, i using wdckit with --merge option to merge g-list to p-list.
this is a phantastic idea! thanks for this. Will try if it works. So if I understand you correctly you also would use the drive without hesitating.?
 

4920441

New Member
Oct 10, 2019
13
2
3
Hi,

is there also a program for a seagate sas hdd as well?

I got a ST8000NM0065 which is from a Dell storage system and got the same Issue as the OP.... after a reset while formatting it with 4096 byte sectors I dont' get the device working again - shows 0 Byte

Code:
sg_readcap  /dev/sda
read capacity(10):
Descriptor format, current; Sense key: Medium Error
Additional sense: Medium format corrupted
  Descriptor type: Field replaceable unit code: 0x0
  Descriptor type: Vendor specific [0x80]
    00 00 00 00 00 00 00 00 00 00 00 00 00 00
    read capacity(10): pass-through requested 8 bytes (data-in), got  got 0 bytes
READ CAPACITY (10) failed: Medium or hardware error
sg_readcap failed: Medium or hardware error

I also tried to format it again, but two other things happen.... it takes about 6 days to format it with sg_format, you dont' get an correct percentage of the process and at the end, I also get the a drive reset and everything is back to start.....

Since it is 8TB I am not giving up right now throwing it in the trash:)

Any Hints?

Thanks a lot!

Cheers

4920441
 

4920441

New Member
Oct 10, 2019
13
2
3
Is there a way to "FastFormat" the drive, so I can already see if it is 8 TB again (and not 0 bytes?) because, with the standard


Code:
./SeaChest_Format_x86_64-alpine-linux-musl_static -d  /dev/sg0 --fastFormat 1 --formatUnit 4096  --confirm this-will-erase-data
I tried that a couple of weeks ago, too, but it took almost a week until (also) the following happened:

Code:
==========================================================================================
 SeaChest_Format - Seagate drive utilities - NVMe Enabled
 Copyright (c) 2014-2023 Seagate Technology LLC and/or its Affiliates, All Rights Reserved
 SeaChest_Format Version: 3.0.4-6_2_0 X86_64
 Build Date: Dec  1 2023
 Today: Wed Oct  2 18:35:06 2024    User: root
==========================================================================================
One or more of the options provided will perform a low-level format that cannot
be interrupted once started. All background software should be stopped, any filesystems
that are currently mounted should first be unmounted in order to reduce the risk of
interruption. Do not attempt these operations on multiple devices at the same time
to ensure the best possible outcome. Many controllers/drivers/HBAs cannot handle these
operations running in parallel without issuing a device reset.
Not all background activities can be stopped. Some are managed by the OS and are not
configurable. It is recommended that a format change is done from a live/bootable
environment to reduce the risk of these interuptions. If the OS is unable to complete
certain commands for it's background polling of the device, it may trigger a device
reset and interrupt the format, leaving the drive inoperable if it cannot be recovered.
        There is a risk when performing a low-level format/fast format that may
        make the drive inoperable if it is reset at any time while it is formatting.
        WARNING: Any interruption to the device while it is formatting may render the
                 drive inoperable! Use this at your own risk!
        WARNING: Set sector size may affect all LUNs/namespaces for devices
                 with multiple logical units or namespaces.
        WARNING (SATA): Do not interrupt this operation once it has started or
                 it may cause the drive to become unusable. Stop all possible background
                 activity that would attempt to communicate with the device while this
                 operation is in progress
        WARNING: It is not recommended to do this on USB as not
                 all USB adapters can handle a 4k sector size.
        WARNING: Disable any out-of-band management systems/services/daemons
                 before using this option. Interruptions can be caused by these
                 and may prevent completion of a sector size change.
        WARNING: It is recommended that this operation is done from a bootable environment
                 (Live USB) to reduce the risk of OS background activities running and
                 triggering a device reset while reformating the drive.

If you wish to cancel this operation, press CTRL-C now to exit the software.

 0

/dev/sg0 - ST8000NM0065 - ZAxxxx - PE47 - SCSI
Format Unit
Performing SCSI drive format.
Depending on the format request, this could take minutes to hours or days.
Do not remove power or attempt other access as interrupting it may make
the drive unusable or require performing this command again!!




Format Unit Failed!


$->


The strange thing is, the drive did do somehing (you could feel moving heads (slowly) all the time, from track to track, but no progressbar and I don't think after that amount of time only a timeout was the reason for "Format Unit Failed"


My first step would be to let the drive know it has 8TB again..... If the medium is corrupted, that doest not matter for the first step.

Thanks a lot!

Cheers

4920441