blob: 40551b3ccaf5dcee7aa780a6a1bbd2a633ccc310 [file] [log] [blame]
.TH SG_DECODE_SENSE "8" "December 2010" "sg3_utils\-1.31" SG3_UTILS
.SH NAME
sg_decode_sense \- decode SCSI sense data
.SH SYNOPSIS
.B sg_decode_sense
[\fI\-\-binary=FN\fR] [\fI\-\-help\fR] [\fI\-\-hex=FN\fR]
[\fI\-\-status=SS\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR]
[\fI\-\-write=WFN\fR] [H1 H2 H3 ...]
.SH DESCRIPTION
.\" Add any additional description here
This utility takes SCSI sense data in binary or as a sequence of
ASCII hexadecimal bytes and decodes it. The primary reference for the
decoding is SPC\-3 ANSI INCITS 408-2005 and the most recent draft
SPC\-4 revision 28 which can be found at http://www.t10.org .
.PP
SCSI sense data is often found in kernel log files as a result of
something going wrong but may just be informative. It is often shown as
a sequence of hexadecimal bytes, starting with 70, 71, 72 or 73.
Sense data could be up to 252 bytes long but typically is much shorter
than that, 18 bytes long is often seen and is usually associated with
the older "fixed" format sense data.
.PP
The sense data can be provided on the command line or in a file. If
given on the command line the sense data should be a sequence of
hexadecimal bytes separated by space. Alternatively a file can be
given with the contents in binary or ASCII hexadecimal bytes. The
latter form can contain several lines each with none, one or more
ASCII hexadecimal bytes separated by space (comma or tab). The
hash symbol may appear and it and the rest of the line is ignored
making it useful for comments.
.SH OPTIONS
Arguments to long options are mandatory for short options as well.
.TP
\fB\-b\fR, \fB\-\-binary\fR=\fIFN\fR
the sense data is read in binary from a file called \fIFN\fR.
.TP
\fB\-h\fR, \fB\-\-help\fR
output the usage message then exit.
.TP
\fB\-H\fR, \fB\-\-in\fR=\fIFN\fR
the sense data is read in ASCII hexadecimal from a file called \fIFN\fR.
The sense data should appear as a sequence of bytes separated by space,
comma, tab or newline. Everything from and including a hash symbol to the
end of that line is ignored.
.TP
\fB\-s\fR, \fB\-\-status\fR=\fISS\fR
where \fISS\fR is a SCSI status byte value, given in hexadecimal. The
SCSI status byte is related to but distinct from sense data.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
increase the degree of verbosity (debug messages).
.TP
\fB\-V\fR, \fB\-\-version\fR
output version string then exit.
.TP
\fB\-w\fR, \fB\-\-write\fR=\fIWFN\fR
writes the sense data out in binary to a file called \fIWFN\fR. If
necessary \fIWFN\fR is created. If \fIWFN\fR exists then it is
truncated prior to writing the sense data to it. This option is
a convenience and may be helpful in converting the ASCII hexadecimal
representation of sense data into the equivalent binary.
.SH NOTES
Unlike most utilities in this package, this utility does not access a
SCSI device (logical unit). This utility accesses a library associated
with this package. Amongst other things the library decodes sense data.
.SH EXIT STATUS
The exit status of sg_decode_sense is 0 when it is successful. Otherwise
see the sg3_utils(8) man page.
.SH AUTHORS
Written by Douglas Gilbert.
.SH "REPORTING BUGS"
Report bugs to <dgilbert at interlog dot com>.
.SH COPYRIGHT
Copyright \(co 2010\-2011 Douglas Gilbert
.br
This software is distributed under a FreeBSD license. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.SH "SEE ALSO"
.B sg_requests(sg3_utils)