Storage‎ > ‎Storage-disk‎ > ‎

Linux lsscsi - list SCSI devices (or hosts) and their attributes


Thank you for visiting this page, this page has been update in another link Linux lsscsi, list scsi devices or hosts and their attributes


It's a very useful tool, have been using it for a while, but when I started to think have something written down for sharing, I noticed that there is an example link in its man page better than I can do.

NAME
       lsscsi - list SCSI devices (or hosts) and their attributes

SYNOPSIS
       lsscsi  [--classic]  [--device]  [--generic] [--help] [--hosts] [--kname] [--list] [--long] [--protection] [--sysfsroot=PATH] [--trans-
       port] [--verbose] [--version] [H:C:T:L]

DESCRIPTION
       Uses information in sysfs (linux kernel series 2.6 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 interpreted as 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 permit-
       ted (e.g. '[1:0:0]' matches all luns on 1:0:0). May also be used to filter --hosts in which case only the H is active and may be either
       a number or in the form "host<n>" where <n> is a host number.

       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" direc-
       tory.  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.

       Information about this utility including examples can also be found at: http://sg.danny.cz/scsi/lsscsi.html .

Only thing you need to note is that -s option is not available anymore.



# lsscsi -g -ll 6:0:5:10
[6:0:5:10]   disk    IBM      1818      FAStT  0777  /dev/sden  /dev/sg156
  state=running queue_depth=32 scsi_level=6 type=0 device_blocked=0 timeout=30
  iocounterbits=32 iodone_cnt=0x15bd ioerr_cnt=0x0 iorequest_cnt=0x15bd
  queue_type=none

[H:C:T:L]
      H == hostadapter id (first one being 0)
      C == SCSI channel on hostadapter (first one being 0)
      T == ID
      L == LUN (first one being 0)



Comments