1SG_READ_LONG(8)                    SG3_UTILS                   SG_READ_LONG(8)
2
3
4

NAME

6       sg_read_long - send a SCSI READ LONG command
7

SYNOPSIS

9       sg_read_long   [--16]   [--correct]   [--help]  [--lba=LBA]  [--out=OF]
10       [--pblock] [--verbose] [--version] [--xfer_len=BTL] DEVICE
11

DESCRIPTION

13       Send SCSI READ LONG command to DEVICE. The read buffer is output in hex
14       and  ASCII  to  stdout or placed in a file. Note that the data returned
15       includes the logical block data (typically 512 bytes for a  disk)  plus
16       ECC  information  (whose  format  is proprietary) plus optionally other
17       proprietary data.
18

OPTIONS

20       Arguments to long options are mandatory for short options as well.
21
22       -S, --16
23              uses a SCSI READ LONG(16) command. The default action is to  use
24              a SCSI READ LONG(10) command. The READ LONG(10) command has a 32
25              bit field for the lba while READ LONG(16) has a 64 bit field.
26
27       -c, --correct
28              sets the 'CORRCT' bit in the SCSI READ LONG  command.  When  set
29              the  data  is corrected by the ECC before being transferred back
30              to this utility. The default is to leave the 'CORRCT' bit  clear
31              in which case the data is not corrected.
32
33       -h, --help
34              output the usage message then exit.
35
36       -l, --lba=LBA
37              where  LBA  is  the logical block address of the sector to read.
38              Assumed to be in decimal unless prefixed with  '0x'  (or  has  a
39              trailing  'h'). Defaults to lba 0. If the lba is larger than can
40              fit in 32 bits then the --16 option should be used.
41
42       -o, --out=OF
43              instead of outputting ASCII hex to stdout, send it in binary  to
44              the  file  called  OF.  If '-' is given for OF then the (binary)
45              output is sent to stdout. Note that all  informative  and  error
46              output is sent to stderr.
47
48       -p, --pblock
49              sets  the  'PBLOCK'  bit in the SCSI READ LONG command. When set
50              the physical block (plus ECC data) containing the requested log‐
51              ical block address is read. The default is to leave the 'PBLOCK'
52              bit clear in which case the logical block (plus any ECC data) is
53              read.
54
55       -v, --verbose
56              increase the level of verbosity, (i.e. debug output).
57
58       -V, --version
59              print the version string and then exit.
60
61       -x, --xfer_len=BTL
62              where  BTL  is the byte transfer length (default to 520). If the
63              given value (or the default) does not  match  the  "long"  block
64              size  of  the  device,  the  appropriate BTL is deduced from the
65              error response and printed (to stderr). The  idea  is  that  the
66              user will retry this utility with the correct transfer length.
67

NOTES

69       If  a  defective  block  is  found  and  its contents, if any, has been
70       retrieved then "sg_reassign" could be used to  map  out  the  defective
71       block.  Associated  with  such  an action the number of elements in the
72       "grown" defect list could be monitored (with "sg_reassign --grown")  as
73       the disk could be nearing the end of its useful lifetime.
74
75       Various  numeric  arguments  (e.g. LBA) may include multiplicative suf‐
76       fixes or be given in hexadecimal. See the "NUMERIC  ARGUMENTS"  section
77       in the sg3_utils(8) man page.
78
79       As  a data point, Fujitsu uses a 54 byte ECC (per block) which is capa‐
80       ble of correcting up to a single burst error or 216 bits "on the  fly".
81       [Information obtained from MAV20xxrc product manual.]
82

EXIT STATUS

84       The  exit  status of sg_read_long is 0 when it is successful. Otherwise
85       see the sg3_utils(8) man page.
86

AUTHORS

88       Written by Douglas Gilbert.
89

REPORTING BUGS

91       Report bugs to <dgilbert at interlog dot com>.
92
94       Copyright © 2004-2007 Douglas Gilbert
95       This software is distributed under the GPL version 2. There is NO  war‐
96       ranty;  not  even  for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR‐
97       POSE.
98

SEE ALSO

100       sg_reassign, sg_write_long, sg_dd
101
102
103
104sg3_utils-1.27                    March 2009                   SG_READ_LONG(8)
Impressum