aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/sg3_utils.8117
-rw-r--r--doc/sg_format.811
-rw-r--r--doc/sg_inq.827
-rw-r--r--doc/sg_persist.88
-rw-r--r--doc/sg_raw.86
-rw-r--r--doc/sg_ses.87
-rw-r--r--doc/sg_vpd.812
7 files changed, 171 insertions, 17 deletions
diff --git a/doc/sg3_utils.8 b/doc/sg3_utils.8
index a261e439..ee9a9237 100644
--- a/doc/sg3_utils.8
+++ b/doc/sg3_utils.8
@@ -1,4 +1,4 @@
-.TH SG3_UTILS "8" "February 2010" "sg3_utils\-1.29" SG3_UTILS
+.TH SG3_UTILS "8" "September 2010" "sg3_utils\-1.30" SG3_UTILS
.SH NAME
sg3_utils \- a package of utilities for sending SCSI commands
.SH SYNOPSIS
@@ -70,6 +70,119 @@ and permit copying data at the level of SCSI READ and WRITE commands. sg_dd
is tightly bound to Linux and hence is not ported to other OSes. A more
generic utility (than sg_dd) called ddpt in a package of the same name has
been ported to other OSes.
+.SH LINUX DEVICE NAMING
+Normal disk block devices have names like /dev/sda, /dev/sdb,
+/dev/sdc, etc. SCSI disks in Linux have always had names like that but
+in recent Linux kernels (e.g. lk 2.6 series) it is becoming more common
+for almost all disks to be named like that. Partitions within a disk
+are specified by a number appended to the device name, starting at
+1 (e.g. /dev/sda1 ).
+.PP
+Tape drives are named /dev/st<num> or /dev/nst<num> where <num> starts
+at zero. Additionally one letter from this list: "lma" may be appended to
+the name. CD, DVD and BD readers (and writers) are named /dev/sr<num>
+where <num> start at zero. There are less used SCSI device type names,
+the dmesg and the lsscsi commands may help to find if any are attached to
+a running system.
+.PP
+There is also a SCSI device driver which offers alternate generic access
+to SCSI devices. It uses names of the form /dev/sg<num> where <num> starts
+at zero. The "lsscsi -g" command may be useful in finding these and which
+generic name corresponds to a device type name (e.g. /dev/sg2 may
+correspond to /dev/sda). In the lk 2.6 series a block SCSI generic
+driver was introduced and its names are of the form
+/dev/bsg/<h:c:t:l> where h, c, t and l are numbers. Again see the lsscsi
+command to find the correspondence between that SCSI tuple (i.e. <h:c:t:l>)
+and alternate device names.
+.PP
+Prior to the Linux kernel 2.6 series these utilities could only use
+generic device names (e.g. /dev/sg1 ). In almost all cases in the Linux
+kernel 2.6 series, any device name can be used by these utilities.
+.SH FREEBSD DEVICE NAMING
+SCSI disks have block names of the form /dev/da<num> where <num> is an
+integer starting at zero. The "da" is replaced by "sa" for SCSI tape
+drives and "cd" for SCSI CD/DVD/BD drives. Each SCSI device has a
+corresponding pass-through device name of the form /dev/pass<num>
+where <num> is an integer starting at zero. The "camcontrol devlist"
+command may be useful for finding out which SCSI device names are
+available and the correspondence between between class and pass-through
+names.
+.SH SOLARIS DEVICE NAMING
+SCSI device names below the /dev directory have a form like: c5t4d3s2
+where the number following "c" is the controller (HBA) number, the number
+following "t" is the target number (from the SCSI parallel interface days)
+and the number following "d" is the LUN. Following the "s" is the slice
+number which is related to a partition and by convention "s2" is the whole
+disk.
+.PP
+OpenSolaris also has a c5t4d3p2 form where the number following the "p" is
+the partition number apart from "p0" which is the whole disk. So a whole
+disk may be referred to as either c5t4d3, c5t4d3s2 or c5t4d3p0 .
+.PP
+And these device names are duplicated in the /dev/dsk and /dev/rdsk
+directories. The former is the block device name and the latter is
+for "raw" (or char device) access which is what sg3_utils needs. So in
+OpenSolaris something of the form 'sg_inq /dev/rdsk/c5t4d3p0' should work.
+If it doesn't work then add a '-vvv' option for more debug information.
+Trying this form 'sg_inq /dev/dsk/c5t4d3p0' (note "rdsk" changed to "dsk")
+will result in an "inappropriate ioctl for device" error.
+.PP
+The device names within the /dev directory are typically symbolic links to
+much longer topological names in the /device directory. In Solaris cd/dvd/bd
+drives seem to be treated as disks and so are found in the /dev/rdsk
+directory. Tape drives appear in the /dev/rmt directory.
+.PP
+There is also a sgen (SCSI generic) driver which by default does not attach
+to any device. See the /kernel/drv/sgen.conf file to control what is
+attached. Any attached device will have a device name of the
+form /dev/scsi/c5t4d3 .
+.PP
+Listing available SCSI devices in Solaris seems to be a challenge. "Use
+the 'format' command" advice works but seems a very dangerous way to list
+devices. [It does prompt again before doing any damage.] 'devfsadm -Cv'
+cleans out the clutter in the /dev/rdsk directory, only leaving what
+is "live". The "cfgadm -v" command looks promising.
+.SH WINDOWS DEVICE NAMING
+Storage and related devices can have several device names in Windows.
+Probably the most common in the volume name (e.g. "D:"). There are also
+a "class" device names such as "PhysicalDrive<n>", "CDROM<n>"
+and "TAPE<n>". <n> is an integer starting at 0 allocated in ascending
+order as devices are discovered (and sometimes rediscovered).
+.PP
+Some storage devices have a SCSI lower level device name which starts
+with a SCSI (pseudo) adapter name of the form "SCSI<n>:". To this is added
+sub\-addressing in the form of a "bus" number, a "target" identifier and
+a "lun" (logical unit number). The "bus" number is also known as a "PathId".
+These are assembled to form a device name of the
+form: "SCSI<n>:<bus>,<target>,<lun>". The trailing ",<lun>" may be omitted
+in which case a lun of zero is assumed. This lower level device name cannot
+often be used directly since Windows blocks attempts to use it if a class
+driver has "claimed" the device. There are SCSI device types (e.g.
+Automation/Drive interface type) for which there is no class driver. At
+least two transports ("bus types" in Windows jargon): USB and IEEE 1394 do
+not have a "scsi" device names of this form.
+.PP
+In keeping with DOS file system conventions, the various device names
+can be given in upper, lower or mixed case. Since "PhysicalDrive<n>" is
+tedious to write, a shortened form of "PD<n>" is permitted by all
+utilities in this package.
+.PP
+A single device (e.g. a disk) can have many device names. For
+example: "PD0" can also be "C:", "D:" and "SCSI0:0,1,0". The two volume names
+reflect that the disk has two partitions on it. Disk partitions that are
+not recognised by Windows are not usually given a volume name. However
+Vista does show a volume name for a disk which has no partitions recognised
+by it and when selected invites the user to format it (which may be rather
+unfriendly to other OSes).
+.PP
+These utilities assume a given device name is in the Win32 device namespace.
+To make that explicit "\\\\.\\" can be prepended to the device names mentioned
+in this section. Beware that backslash is an escape character in Unix like
+shells and the C programming language. In a shell like Msys (from MinGW)
+each backslash may need to be typed twice.
+.PP
+The sg_scan utility lists out Windows device names in forms that are
+suitable for other utilities in this package to use.
.SH EXIT STATUS
To aid scripts that call these utilities, the exit status is set to indicate
success (0) or failure (1 or more). Note that some of the lower values
@@ -285,4 +398,4 @@ code, namely sg_lib.[hc], sg_cmds_basic.[hc] and sg_cmds_extra.[hc] are
under a FreeBSD license. There is NO warranty; not even for MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.
.SH "SEE ALSO"
-.B sdparm(sdparm), ddpt(ddpt), mt(1)
+.B sdparm(sdparm), sg_scan(sg3_utils), ddpt(ddpt), lsscsi(lsscsi), dmesg(1), mt(1)
diff --git a/doc/sg_format.8 b/doc/sg_format.8
index 66c59e12..4afefb87 100644
--- a/doc/sg_format.8
+++ b/doc/sg_format.8
@@ -1,4 +1,4 @@
-.TH SG_FORMAT "8" "March 2009" "sg3_utils\-1.27" SG3_UTILS
+.TH SG_FORMAT "8" "September 2010" "sg3_utils\-1.30" SG3_UTILS
.SH NAME
sg_format \- format or resize a SCSI disk (perhaps change its block size)
.SH SYNOPSIS
@@ -322,6 +322,9 @@ The \fICOUNT\fR numeric argument may include a multiplicative suffix or be
given in hexadecimal. See the "NUMERIC ARGUMENTS" section in the
sg3_utils(8) man page.
.SH EXAMPLES
+These examples use Linux device names. For suitable device names in
+other supported Operating Systems see the sg3_utils(8) man page.
+.PP
In the first example below simply find out the existing block count and
size derived from two sources: a block descriptor in a MODE SELECT command
response and from the response of a READ CAPACITY commands. No changes
@@ -369,11 +372,11 @@ Written by Grant Grundler, James Bottomley and Douglas Gilbert.
.SH "REPORTING BUGS"
Report bugs to <dgilbert at interlog dot com>.
.SH COPYRIGHT
-Copyright \(co 2005\-2009 Grant Grundler, James Bottomley and Douglas Gilbert
+Copyright \(co 2005\-2010 Grant Grundler, James Bottomley and 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_turs(8), sg_requests(8), sg_inq(8), sg_modes(8), sg_vpd(8),
-.B sg_reassign(8), sg_readcap(8) [all in sg3_utils], sdparm(8),
-.B scsiformat (old), hdparm(8)
+.B sg_reassign(8), sg_readcap(8), sg3_utils(8) [all in sg3_utils],
+.B sdparm(8), scsiformat (old), hdparm(8)
diff --git a/doc/sg_inq.8 b/doc/sg_inq.8
index 15d457d0..6962da1b 100644
--- a/doc/sg_inq.8
+++ b/doc/sg_inq.8
@@ -1,4 +1,4 @@
-.TH SG_INQ "8" "February 2010" "sg3_utils\-1.29" SG3_UTILS
+.TH SG_INQ "8" "September 2010" "sg3_utils\-1.30" SG3_UTILS
.SH NAME
sg_inq \- sends a SCSI INQUIRY or ATA IDENTIFY (PACKET) DEVICE command
and outputs the response
@@ -324,6 +324,31 @@ Equivalent to '\-\-page=ei' in the main description.
.TP
\fB\-?\fR
output usage message and exit. Ignore all other parameters.
+.SH EXAMPLES
+The examples in this page use Linux device names. For suitable device
+names in other supported Operating Systems see the sg3_utils(8) man page.
+.PP
+To view the standard inquiry response use without options:
+.PP
+ sg_inq /dev/sda
+.PP
+Some SCSI devices include version descriptors indicating the various
+SCSI standards and drafts they support. They can be viewed with:
+.PP
+ sg_inq -d /dev/sda
+.PP
+Modern SCSI devices include Vital Product Data (VPD)pages which can be
+viewed with the SCSI INQUIRY command. To list the supported VPD
+pages (but not their contents) try:
+.PP
+ sg_inq -e /dev/sda
+.PP
+Some VPD pages can be read with the sg_inq utility but a newer utility
+called sg_vpd specializes in showing their contents. The sdparm utility
+can also be used to show the contents of VPD pages.
+.PP
+Further examples of sg_inq together with some typical output can be found
+on http://sg.danny.cz/sg/sg3_utils.html web page.
.SH AUTHOR
Written by Doug Gilbert
.SH "REPORTING BUGS"
diff --git a/doc/sg_persist.8 b/doc/sg_persist.8
index 595f8cf3..fc2be7a6 100644
--- a/doc/sg_persist.8
+++ b/doc/sg_persist.8
@@ -1,4 +1,4 @@
-.TH SG_PERSIST "8" "December 2009" "sg3_utils\-1.29" SG3_UTILS
+.TH SG_PERSIST "8" "September 2010" "sg3_utils\-1.30" SG3_UTILS
.SH NAME
sg_persist \- sends a SCSI PERSISTENT RESERVE (IN or OUT) command
to manipulate registrations and reservations
@@ -324,6 +324,8 @@ it complained if the disk one stopped. The error indicated it wanted
the disk spun up and when that happened, the registration was
successful.
.SH EXAMPLES
+These examples use Linux device names. For suitable device names in
+other supported Operating Systems see the sg3_utils(8) man page.
.PP
Due to the various option defaults the simplest example executes
the 'read keys' sub\-command of the PRIN command:
@@ -390,9 +392,9 @@ Written by Doug Gilbert
.SH "REPORTING BUGS"
Report bugs to <dgilbert at interlog dot com>.
.SH COPYRIGHT
-Copyright \(co 2004\-2009 Douglas Gilbert
+Copyright \(co 2004\-2010 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 scsires(internet)
+.B sg3_utils(sg3_utils), scsires(internet)
diff --git a/doc/sg_raw.8 b/doc/sg_raw.8
index fa9fe6f0..6600de33 100644
--- a/doc/sg_raw.8
+++ b/doc/sg_raw.8
@@ -1,4 +1,4 @@
-.TH SG_RAW "8" "April 2010" "sg3_utils\-1.30" SG3_UTILS
+.TH SG_RAW "8" "September 2010" "sg3_utils\-1.30" SG3_UTILS
.SH NAME
sg_raw \- sends an arbitrary SCSI command to a device
.SH SYNOPSIS
@@ -77,6 +77,8 @@ The ability to send more than a 16 byte CDB (in some cases 12 byte CDB)
may be restricted by the pass-through interface, the low level driver
or the transport. Bidirectional data commands are no yet supported.
.SH EXAMPLES
+These examples use Linux device names. For suitable device names in
+other supported Operating Systems see the sg3_utils(8) man page.
.TP
sg_raw /dev/scd0 1b 00 00 00 02 00
Eject the medium in CD drive /dev/scd0.
@@ -117,5 +119,5 @@ Copyright \(co 2001\-2010 Ingo van Lil
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_inq sg_vpd(sg3_utils), plscsi
+.B sg_inq, sg_vpd, sg3_utils (sg3_utils), plscsi
diff --git a/doc/sg_ses.8 b/doc/sg_ses.8
index 515101b5..e34b2eaa 100644
--- a/doc/sg_ses.8
+++ b/doc/sg_ses.8
@@ -1,4 +1,4 @@
-.TH SG_SES "8" "June 2010" "sg3_utils\-1.30" SG3_UTILS
+.TH SG_SES "8" "SEPTEMBER 2010" "sg3_utils\-1.30" SG3_UTILS
.SH NAME
sg_ses \- send controls and fetch status from a SCSI Enclosure
Services (SES) device
@@ -112,6 +112,9 @@ that support SAF\-TE report "Processor" peripheral device type (0x3) in their
INQUIRY response. See the sg_safte utility in this package or safte\-monitor
on the internet.
.SH EXAMPLES
+These examples use Linux device names. For suitable device names in
+other supported Operating Systems see the sg3_utils(8) man page.
+.PP
To view the supported pages:
.PP
sg_ses /dev/sda
@@ -159,5 +162,5 @@ Copyright \(co 2004\-2010 Douglas Gilbert
This software is distributed under a FreeBSD license. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.SH "SEE ALSO"
-.B sg_inq, sg_safte, sg_senddiag (in sg3_utils package);
+.B sg_inq, sg_safte, sg_senddiag, sg3_utils (in sg3_utils package);
.B safte\-monitor (internet)
diff --git a/doc/sg_vpd.8 b/doc/sg_vpd.8
index 6b16131b..c7b42be4 100644
--- a/doc/sg_vpd.8
+++ b/doc/sg_vpd.8
@@ -1,4 +1,4 @@
-.TH SG_VPD "8" "February 2008" "sg3_utils\-1.26" SG3_UTILS
+.TH SG_VPD "8" "September 2010" "sg3_utils\-1.30" SG3_UTILS
.SH NAME
sg_vpd \- fetches Vital Product Data (VPD) pages using a SCSI INQUIRY command
.SH SYNOPSIS
@@ -114,14 +114,20 @@ device names may be used as well (e.g. "/dev/st0m").
.SH EXIT STATUS
The exit status of sg_vpd is 0 when it is successful. Otherwise see
the sg3_utils(8) man page.
+.SH EXAMPLES
+The examples in this page use Linux device names. For suitable device
+names in other supported Operating Systems see the sg3_utils(8) man page.
+.PP
+Further examples can be found on http://sg.danny.cz/sg/sg3_utils.html
+web page.
.SH AUTHOR
Written by Doug Gilbert
.SH "REPORTING BUGS"
Report bugs to <dgilbert at interlog dot com>.
.SH COPYRIGHT
-Copyright \(co 2006\-2008 Douglas Gilbert
+Copyright \(co 2006\-2010 Douglas Gilbert
.br
This software is distributed under a FreeBSD license. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.SH "SEE ALSO"
-.B sg_inq(sg3_utils), sdparm(sdparm), hdparm(hdparm)
+.B sg_inq(sg3_utils), sg3_utils(sg3_utils), sdparm(sdparm), hdparm(hdparm)