~ubuntu-branches/ubuntu/dapper/sg3-utils/dapper-backports

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
.TH SG_READ_LONG "8" "June 2006" "sg3_utils-1.21" SG3_UTILS
.SH NAME
sg_read_long \- calls a READ LONG command on a SCSI device
.SH SYNOPSIS
.B sg_read_long
[\fI--16\fR] [\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.
.TP
--16 | -S
attempts a READ LONG(16) SCSI command. The default action is to attempt
a READ LONG(10) SCSI command. The READ LONG(10) command has a 32 bit
field for the lba while READ LONG(16) has a 64 bit field.
.TP
--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
If a defective block is found and its contents, if any, has been
retrieved then "sg_reassign" could be used to map out the defective
block. Associated with such an action the number of elements in
the "grown" defect list could be monitored (with "sg_reassign --grown")
as the disk could be nearing the end of its useful lifetime.
.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" (or with a trailing "h" or "H"). 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 EXIT STATUS
The exit status of sg_read_long 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 2004-2006 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_reassign, sg_write_long, sg_dd