~ubuntu-branches/ubuntu/intrepid/sg3-utils/intrepid

« back to all changes in this revision

Viewing changes to sg_read_long.8

  • Committer: Bazaar Package Importer
  • Author(s): Luk Claes
  • Date: 2006-11-05 17:23:29 UTC
  • mfrom: (1.1.4 upstream) (3.1.2 edgy)
  • Revision ID: james.westby@ubuntu.com-20061105172329-l4loha00sk36qz6k
* Non-maintainer upload.
* Fix FTBFS due to old syscall usage (Closes: #395512).

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
2
2
.SH NAME
3
 
sg_read_long \- send the scsi command read long
 
3
sg_read_long \- calls a READ LONG command on a SCSI device
4
4
.SH SYNOPSIS
5
5
.B sg_read_long
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]
8
 
\fI<scsi_device>\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
9
9
.SH DESCRIPTION
10
10
.\" Add any additional description here
11
11
.PP
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.
 
17
.TP
 
18
--16 | -S
 
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.
14
22
.TP
15
23
--correct | -c
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.
23
31
.TP
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.
26
36
.TP
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
43
 
printed (to stderr).
 
53
printed (to stderr). The idea is that the user will retry this utility
 
54
with the correct transfer length.
 
55
.PP
 
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.
44
61
.PP
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>.
49
67
.PP
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
52
 
used.
 
69
either "0x" or "0X" (or with a trailing "h" or "H"). When hex numbers are
 
70
given, multipliers cannot be used.
 
71
.PP
 
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.]
 
75
.SH EXIT STATUS
 
76
The exit status of sg_read_long is 0 when it is successful. Otherwise see
 
77
the sg3_utils(8) man page.
53
78
.SH AUTHORS
54
79
Written by Douglas Gilbert.
55
80
.SH "REPORTING BUGS"
56
81
Report bugs to <dgilbert at interlog dot com>.
57
82
.SH COPYRIGHT
58
 
Copyright \(co 2004 Douglas Gilbert
 
83
Copyright \(co 2004-2006 Douglas Gilbert
59
84
.br
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.
62
87
.SH "SEE ALSO"
63
 
.B sg_write_long, sg_dd
 
88
.B sg_reassign, sg_write_long, sg_dd