blob: eec7d3b1e3db3de313761e68238bb73e0917c59c [file] [log] [blame]
.TH SG_READ_LONG "8" "March 2005" "sg3_utils-1.13" SG3_UTILS
.SH NAME
sg_read_long \- send the scsi command read long
.SH SYNOPSIS
.B sg_read_long
[\fI--correct\fR] [\fI--help\fR] [\fI--lba=<num>\fR] [\fI--out=<name>\fR]
[\fI--verbose\fR] [\fI--version\fR] [\fI--xfer_len=<num>\fR]
\fI<scsi_device>\fR
.SH DESCRIPTION
.\" Add any additional description here
.PP
Send READ LONG command to a Linux SCSI device. The read
buffer is output in hex and ASCII to stdout or placed in a file.
Note that the data returned includes the logical block data (typically
512 bytes for a disk) plus ECC information (whose format is proprietary)
plus optionally other proprietary data.
.P
--correct | -c
sets the 'CORRCT' bit in the READ LONG SCSI command. When set the data is
corrected by the ECC before being transferred back to this utility. The
default is to leave the 'CORRCT' bit clear in which case the data is
not corrected.
.TP
--help | -h
output the usage message then exit.
.TP
--lba=<num> | -l <num>
the logical block address of the sector to read. Assumed to be in
decimal unless prefixed with '0x'. Defaults to lba 0. Only 32 bit
lbas currently supported.
.TP
--out=<name> | -o <name>
instead of outputting ASCII hex to stdout, try to send it to the file
called <name>. If '-' is given as the <name> then the (binary) output
is sent to stdout. Note that all informative and error output is
sent to stderr.
.TP
--verbose | -v
increase the level of verbosity, (i.e. debug output).
.TP
--version | -V
print the version string and then exit.
.TP
--xfer_len=<num> | -x <num>
the transfer length in bytes (default to 520). If the given value (or the
default) does not match the "long" block size of the device, the
appropriate xfer_len value is derived from the error response and
printed (to stderr). The idea is that the user will retry this utility
with the correct transfer length.
.PP
The lba and xfer_len numerical arguments may be followed by the following
multiplicative suffixes:
c C *1; w W *2; b B *512; k K KiB *1,024; KB *1,000; m M MiB *1,048,576;
MB *1,000,000; g G GiB *1,073,741,824; and GB *1,000,000,000 . Also a suffix
of the form "x<n>" multiplies the leading number by <n>.
.PP
Alternatively numerical values can be given in hexadecimal preceded by
either "0x" or "0X". When hex numbers are given multipliers cannot be
used.
.PP
As a data point, Fujitsu uses a 54 byte ECC (per block) which is capable
of correcting up to a single burst error or 216 bits "on the
fly". [Information obtained from MAV20xxrc product manual.]
.SH AUTHORS
Written by Douglas Gilbert.
.SH "REPORTING BUGS"
Report bugs to <dgilbert at interlog dot com>.
.SH COPYRIGHT
Copyright \(co 2004-2005 Douglas Gilbert
.br
This software is distributed under the GPL version 2. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.SH "SEE ALSO"
.B sg_write_long, sg_dd