-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong sector size(s) set when unsupported block size passed to openSeaChest_Format --formatUnit
#156
Comments
Hi @bandogora, Sorry you ran into this weird behavior. On SAS drives you change the sector size by sending a mode select command with the block size set to your desired value as a number of bytes before starting the format unit command. If the drive does not support it, it is supposed to send back a check condition (error) indicating this is not allowed and openSeaChest_Format would have stopped there and reported the error rather than proceed onwards to a long format. Since no error was given the drive accepted the command requesting 4K sector size and continued onwards to the format unit command...but never informed that it would actually format to a smaller sector size than you requested.
This is not possible in most cases on SAS drives due to the way format unit historically works back to older SCSI days and even today. Not all vendors or firmwares even report the supported sizes back to the host. Can you share the output of
This is actually expected behavior. Running format unit commands to change sector sizes does change the physical sector size within the drive. The way the sector size is reported is the logical block size is reported as a number of bytes. The physical sector size is reported as a power of 2 value for how many logical sectors are within the physical sector on the drive so it is always some multiple of the logical size presented to the host.
This would not cause your issue. If the firmware activated (segmented download mode or the deferred activation command was issued) then that firmware was already online and running. |
Thank you for your response, it was very informative! This is my first time working with SAS and SCSI. I didn't relize reporting the supported sizes back to the host was so vendor dependant. Here's the verbose log: |
Thanks for the log! It does not appear this drive supports that page of supported block lengths either (VPD page 84h) to add that additional lookup.
I don't think this is necessarily a Vendor A vs Vendor B, but what the vendor chooses to support in firmware. It could be that the vendor that sponsored this addition to the standard supports it in their firmware and others can choose to do it as well or not. I don't know which vendor made this addition though. There is also another new command and VPD page called "Format with Preset" which is more like how NVMe formatting works. The drive reports descriptors of the formatting it supports (It also allows switching recording types if the firmware supports it: Ex CMR vs SMR) and then in that command software specifies which descriptor to use when formatting. openSeaChest does not currently support this mode of formatting but it is another thing we can look into in the future. I wish I had a better answer for you to this issue! I know it is a pain to go through a long format only to have to start all over again. If you have any other ideas, you think would be helpful from your standpoint, please let me know so I can look into those as well. |
@vonericsen I can only think of one potential improvement if we can't validate supported formats. We could have
I'm not sure exactly how Something along the lines of:
Maybe also give these Toshiba drives as an example. I would have still attempted the format with that warning, but I would have tried it with one drive first and saved some time. I am a novice with SAS and these tools though, so I don't know if this is practical or even particularly useful. |
The Process
I tried to reformat a couple of Toshiba MG07SCA14TE SAS drives with the
--formatUnit
command:The Issue
Unfortunately I assumed
4Kn
was supported and didn't check first.The issue is that openSeaChest_Format didn't complain about the unsupported size and ran a format anyways. It looks like instead of selecting
4Kn
or staying at512e
the tool chose the largest supported size, which ended up being528
.The physical sector size is also reported as changed, which seems strange to me(?).
Before the format:
After the format:
Now I have to reformat the drives (quick format not supported) to go back to full capacity and performance.
Suggested Change
I think the best way of handling this would be for
openSeaChest_Format
to refuse to attempt a format with a size not reported as being supported; and a flag to override if desired.More Info
I update the drive firmware from
0102
to0105
before running the format. I didn't powercycle the system between the firmware update and the format; which was dumb, but probably not the cause of the issue.openSeaChest_Format Version:
3.0.4-6_2_0 X86_64
Full SATInfo:
The text was updated successfully, but these errors were encountered: