Uses information in sysfs (linux kernels 2.6.0 and later) to list
scsi devices (or hosts) currently attached to the system. Options can
be used to control the amount and form of information provided for
each device.
If a <h:c:t:l> argument is given then it acts as a filter and only
devices that match it are listed. The colons don't have to be
present, and '-', '*', '?' or missing arguments at the end are
wildcards. '-' needs to stand alone or else it is taken as the
beginning of an option (e.g. '-:-:-:-' is illegal). '*' needs
to be escaped from the shell. A leading '[' and trailing ']'
are permitted (e.g. '[1:0:0]' matches all luns on 1:0:0).
By default in this utility device node names (e.g. "/dev/sda"
or "/dev/root_disk") are obtained by noting the major and minor
numbers for the listed device obtained from sysfs (e.g. the
contents of /sys/block/sda/dev) and then looking for a match
in the "/dev" directory. This "match by major and minor" will allow
devices that have been given a different name by udev (for example)
to be correctly reported by this utility.
In some situations it may be useful to see the device node name that
linux would produce by default, so the '--kname' option is provided.
An example of where this may be useful is kernel error logs which
tend to report disk error messages using the disk's default kernel
name.
--classic | -c
The output is similar to that obtained from 'cat /proc/scsi/scsi'
--device | -d
After outputting the (probable) scsi device name the the device node
major and minor numbers are shown in brackets (e.g. "/dev/sda[8:0]").
--generic | -g
Output the scsi generic device file name. Note that if the sg driver
is a module it needs to be loaded otherwise '-' will appear
--help | -h
Output the usage message and exit
--hosts | -H
List the SCSI hosts currently attached to the system. If this option is
not given then SCSI devices are listed
--kname | -k
Use linux default algorithm for naming devices (e.g. block major 8,
minor 0 is "/dev/sda") rather than the "match by major and minor"
in the "/dev" directory as discussed above.
--long | -l
Output additional information for each SCSI device (host). Can be
used multiple times for more output in which case the shorter
form is more convenient (e.g. '-lll'). When used three times (i.e. '-lll')
outputs SCSI device (host) attributes one per line; preceded by
two spaces; in the form "<attribute_name>=<value>".
--verbose | -v
outputs directory names where information is found. Use twice for
more output.
--version | -V
outputs version number information and exits
Information for this command is derived from the the sysfs file system
whose mount point is found by examining the contents of /proc/mounts .
SCSI (pseudo) devices that have been detected by the SCSI mid level
will be listed even if the required upper level drivers (i.e. sd, sr,
st, osst or ch) have not been loaded. If the appropriate upper level
driver has not been loaded then the device file name will appear
as '-' rather than something like '/dev/st0'. Note that some
devices (e.g. scanners and medium changers) do not have a primary upper
level driver and can only be accessed via a scsi generic (sg) device
name.