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
36
2
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
857
282
63
Whats the make&model of the disk;

Have you formatted this model before to 4096 with sg_format?
 

tcpluess

Member
Jan 22, 2024
36
2
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
36
2
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
316
169
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
36
2
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
36
2
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
36
2
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.?