SG_REQUESTS(8) | SG3_UTILS | SG_REQUESTS(8) |
sg_requests - send one or more SCSI REQUEST SENSE commands
sg_requests [--desc] [--help] [--hex] [--maxlen=LEN] [--num=NUM] [--number=NUM] [--progress] [--raw] [--status] [--time] [--verbose] [--version] DEVICE
Send SCSI REQUEST SENSE command to DEVICE and output the parameter data response which is expected to be in sense data format. Both fixed and descriptor sense data formats are supported.
Multiple REQUEST SENSE commands can be sent with the --num=NUM option. This can be used for timing purposes or monitoring the progress indication.
Arguments to long options are mandatory for short options as well.
In SCSI 1 and 2 the REQUEST SENSE command was very important for error and warning processing in SCSI. The autosense capability rendered this command almost superfluous.
However recent SCSI drafts (e.g. SPC-4 rev 14 and SBC-3 rev 14) increase the utility of the REQUEST SENSE command. Idle and standby (low) power conditions can be detected with this command.
The REQUEST SENSE command is not marked as mandatory in SPC-3 (i.e. for all SCSI devices) but is marked as mandatory in SBC-2 (i.e. for disks), SSC-3 (i.e. for tapes) and MMC-4 (i.e. for CD/DVD/HD-DVD/BD drives).
The progress indication is optionally part of the sense data. When a prior command that takes a long time to complete (and typically precludes other media access commands) is still underway, the progress indication can be used to determine how long before the device returns to its normal state.
The SCSI FORMAT command for disks used with the IMMED bit set is an example of an operation that takes a significant amount of time and precludes other media access during that time. The IMMED bit set instructs the FORMAT command to return control to the application client once the format has commenced (see SBC-3). Several long duration SCSI commands associated with tape drives also use the progress indication (see SSC-3).
Early standards suggested that the SCSI TEST UNIT READY command be used for polling the progress indication (see the sg_turs utility). Since SPC-3 the standards suggest that the SCSI REQUEST SENSE command should be used instead.
The DEVICE is opened with a read-only flag (e.g. in Unix with the O_RDONLY flag).
The exit status of sg_requests is 0 when it is successful. Otherwise see the sg3_utils(8) man page.
Written by Douglas Gilbert.
Report bugs to <dgilbert at interlog dot com>.
Copyright © 2004-2016 Douglas Gilbert
This software is distributed under a FreeBSD license. There is NO warranty;
not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
sg_turs (sg3_utils)
February 2016 | sg3_utils-1.43 |