How to check SCSI device's storage path with the tool lsscsi?

Solution Unverified - Updated

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7

Issue

  • How do I know a SCSI device's LUN ID (or storage path)?

Resolution

  • If you're using Red Hat Enterprise Linux 5, 6 or 7, you can install the lsscsi package and use the lsscsi command to view SCSI devices' storage path.
    [root@hostname]# lsscsi
    [1:0:0:0]    storage IET      Controller       0001  -
    [1:0:0:1]    disk    IET      VIRTUAL-DISK     0001  /dev/sdb

In the outputs, "[1:0:0:1]" is in the format of [H:B:T:L]. H is the Host ID, B is the Bus ID, T is the Target ID, and L is the LUN ID. Please refer to Understanding  SCSI addressing on Red Hat Enterprise Linux if you want to know more deatails about SCSI addressing.

Below is the usage of lsscsi:

[root@hostname ~]# lsscsi -h
Usage: lsscsi   [--classic] [--device] [--generic] [--help] [--hosts]
                [--kname] [--long] [--verbose] [--version]
                [<h:c:t:l>]
        --classic|-c  alternate output similar to 'cat /proc/scsi/scsi'
        --device|-d   show device node's major + minor numbers
        --generic|-g  show scsi generic device name
        --help|-h     this usage information
        --hosts|-H    lists scsi hosts rather than scsi devices
        --kname|-k    show kernel name instead of device node name
        --long|-l     additional information output
        --verbose|-v  output path names where data is found
        --version|-V  output version string and exit
        <h:c:t:l>  filter output list (def: '- - - -' (all))
SBR
Components
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.