1
.TH SG_READ_LONG "8" "August 2004" "sg3_utils-1.08" SG3_UTILS
1
.TH SG_READ_LONG "8" "June 2006" "sg3_utils-1.21" SG3_UTILS
3
sg_read_long \- send the scsi command read long
3
sg_read_long \- calls a READ LONG command on a SCSI device
6
[\fI--correct\fR] [\fI--help\fR] [\fI--lba=<num>\fR] [\fI--out=<name>\fR]
7
[\fI--verbose\fR] [\fI--version\fR] [\fI--xfer_len=<num>\fR]
6
[\fI--16\fR] [\fI--correct\fR] [\fI--help\fR] [\fI--lba=<num>\fR]
7
[\fI--out=<name>\fR] [\fI--verbose\fR] [\fI--version\fR]
8
[\fI--xfer_len=<num>\fR] \fI<scsi_device>\fR
10
10
.\" Add any additional description here
12
12
Send READ LONG command to a Linux SCSI device. The read
13
buffer is output in hex and ASCII to stdout or placed in a file..
13
buffer is output in hex and ASCII to stdout or placed in a file.
14
Note that the data returned includes the logical block data (typically
15
512 bytes for a disk) plus ECC information (whose format is proprietary)
16
plus optionally other proprietary data.
19
attempts a READ LONG(16) SCSI command. The default action is to attempt
20
a READ LONG(10) SCSI command. The READ LONG(10) command has a 32 bit
21
field for the lba while READ LONG(16) has a 64 bit field.
16
24
sets the 'CORRCT' bit in the READ LONG SCSI command. When set the data is
22
30
output the usage message then exit.
24
32
--lba=<num> | -l <num>
25
the logical block address of the sector to read. Defaults to lba 0.
33
the logical block address of the sector to read. Assumed to be in
34
decimal unless prefixed with '0x'. Defaults to lba 0. Only 32 bit
35
lbas currently supported.
27
37
--out=<name> | -o <name>
28
38
instead of outputting ASCII hex to stdout, try to send it to the file
40
50
the transfer length in bytes (default to 520). If the given value (or the
41
51
default) does not match the "long" block size of the device, the
42
52
appropriate xfer_len value is derived from the error response and
53
printed (to stderr). The idea is that the user will retry this utility
54
with the correct transfer length.
56
If a defective block is found and its contents, if any, has been
57
retrieved then "sg_reassign" could be used to map out the defective
58
block. Associated with such an action the number of elements in
59
the "grown" defect list could be monitored (with "sg_reassign --grown")
60
as the disk could be nearing the end of its useful lifetime.
45
62
The lba and xfer_len numerical arguments may be followed by the following
46
63
multiplicative suffixes:
47
c C *1; b B *512; k *1,024; K *1,000; m *1,048,576; M *1,000,000;
48
g *1,073,741,824; and G *1,000,000,000
64
c C *1; w W *2; b B *512; k K KiB *1,024; KB *1,000; m M MiB *1,048,576;
65
MB *1,000,000; g G GiB *1,073,741,824; and GB *1,000,000,000 . Also a suffix
66
of the form "x<n>" multiplies the leading number by <n>.
50
68
Alternatively numerical values can be given in hexadecimal preceded by
51
either "0x" or "0X". When hex numbers are given multipliers cannot be
69
either "0x" or "0X" (or with a trailing "h" or "H"). When hex numbers are
70
given, multipliers cannot be used.
72
As a data point, Fujitsu uses a 54 byte ECC (per block) which is capable
73
of correcting up to a single burst error or 216 bits "on the
74
fly". [Information obtained from MAV20xxrc product manual.]
76
The exit status of sg_read_long is 0 when it is successful. Otherwise see
77
the sg3_utils(8) man page.
54
79
Written by Douglas Gilbert.
55
80
.SH "REPORTING BUGS"
56
81
Report bugs to <dgilbert at interlog dot com>.
58
Copyright \(co 2004 Douglas Gilbert
83
Copyright \(co 2004-2006 Douglas Gilbert
60
85
This software is distributed under the GPL version 2. There is NO
61
86
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
63
.B sg_write_long, sg_dd
88
.B sg_reassign, sg_write_long, sg_dd