hreinecke / sg3_utils

Deprecated git-svn mirror for sg3_utils
http://sg.danny.cz/sg/sg3_utils.html
Other
154 stars 91 forks source link

sg_format test unit ready fails on Solaris #57

Open zylantha opened 4 years ago

zylantha commented 4 years ago

sg_format's default behaviour is "set IMMED=1 and poll with Test Unit Ready", however on Solaris this "Test Unit Ready" command appears to fail.

This results in sg_format reporting that the format is complete, when in fact it isn't. Using the "--wait" option makes sg_format correctly wait until the operation finishes, however the default behaviour is misleading (and caught me offguard, because it reported the operation had finished when it had not).

Example output where error occurs:

Format unit has started
test unit ready: pass-through os error: Invalid argument
FORMAT UNIT Complete

The 'test unit ready' should be checking for an error in its return code - and in this unknown state when an error is returned, warning the user that the drive may or may not be complete, rather than saying it is complete. It may also be better to default to "--wait" on Solaris rather than "set IMMED=1 with Test Unit Ready", unless the test unit ready command can be fixed.

Note: OS in my instance is SmartOS (Illumos).

doug-gilbert commented 4 years ago

I have just wasted several hours trying to load OmniOS then OpenIndiana into VirtualBox. Both ultimately failed. So unless you tell me exactly where the errors are, they won't be fixed. For the Test Unit Ready problem I would like to see the output of 'sg_turs -vvvvvvvvv '.

zylantha commented 4 years ago

Does this output help?

[root@smartest ~]# sg_turs -vvvvvvvvv /dev/rdsk/c28t5000CCA01336C781d0 open /dev/rdsk/c28t5000CCA01336C781d0 with flags=0x82 test unit ready cdb: [00 00 00 00 00 00] do_scsi_pt: ioctl(USCSICMD) failed with os_err (errno) = 22 test unit ready: pass-through os error: Invalid argument OS error: Invalid argument

doug-gilbert commented 4 years ago

Could you email me directly at dgilbert@interlog.com ? I have a test version of sg_pt_solaris.c that you might try.