~ubuntu-branches/ubuntu/oneiric/sg3-utils/oneiric

« back to all changes in this revision

Viewing changes to doc/sg_readcap.8

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2009-11-05 20:42:13 UTC
  • mfrom: (5.2.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091105204213-ug7wrb6m7l9kmvyg
Tags: 1.28-2
* QA upload.
* Add libsgutils2-2.symbols.kfreebsd. Some of the symbols are Linux
  specific causing FTBFS on kfreebsd.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH SG_READCAP "8" "April 2009" "sg3_utils\-1.27" SG3_UTILS
 
1
.TH SG_READCAP "8" "September 2009" "sg3_utils\-1.28" SG3_UTILS
2
2
.SH NAME
3
3
sg_readcap \- sends a SCSI READ CAPACITY command
4
4
.SH SYNOPSIS
22
22
are counted origin zero (i.e. starting at block zero)). This is the source
23
23
of many "off by one" errors.
24
24
.PP
25
 
The READ CAPACITY(16) response shows additional information not found in the
26
 
READ CAPACITY(10) response. This includes protection and thin provisioning
 
25
The READ CAPACITY(16) response provides additional information not found in
 
26
the READ CAPACITY(10) response. This includes protection and thin provisioning
27
27
information, plus the number of logical blocks per physical block. So even
28
28
though the media size may not exceed what READ CAPACITY(10) can show, it may
29
29
still be useful to examine the response to READ CAPACITY(16). Sadly there
34
34
This utility outputs this figure in bytes, MiB (1048576 bytes per MiB)
35
35
and GB (1000000000 bytes per GB).
36
36
.PP
 
37
If sg_readcap is called without the \fI\-\-long\fR option then the 10 byte
 
38
cdb version (i.e. READ CAPACITY (10)) is sent to the \fIDEVICE\fR. If the
 
39
number of blocks in the response is reported as
 
40
0xffffffff (i.e. (2**32 \- 1) ) and the \fI\-\-hex\fR option has not been
 
41
given, then READ CAPACITY (16) is called and its response is output.
 
42
.PP
37
43
This utility supports two command line syntaxes, the preferred one is
38
44
shown first in the synopsis and explained in this section. A later section
39
45
on the old command line syntax outlines the second group of options.
44
50
outputs two hex numbers (prefixed with '0x' and space separated)
45
51
to stdout. The first number is the maximum number of blocks on the
46
52
device (which is one plus the lba of the last accessible block). The
47
 
second number is the size of each block. If the operation fails
 
53
second number is the size in bytes of each block. If the operation fails
48
54
then "0x0 0x0" is written to stdout.
49
55
.TP
50
56
\fB\-h\fR, \fB\-\-help\fR
90
96
\fB\-V\fR, \fB\-\-version\fR
91
97
outputs version string then exits.
92
98
.SH NOTES
93
 
If sg_readcap is called without the \fI\-\-long\fR option then the 10 byte
94
 
cdb version (i.e. READ CAPACITY (10)) is sent to the \fIDEVICE\fR. If the
95
 
number of blocks in the response is reported as
96
 
0xffffffff (i.e. (2**32 \- 1) ) and the \fI\-\-hex\fR option has not been
97
 
given, then READ CAPACITY (16) is called and its response is output.
98
 
.PP
99
99
In the 2.4 series of Linux kernels the \fIDEVICE\fR must be a SCSI
100
100
generic (sg) device. In the 2.6 series block devices (e.g. SCSI disks
101
101
and DVD drives) can also be specified. For example "sg_readcap /dev/sda"