Using the Linux lsscsi Command to View SCSI Devices
The lsscsi command is a dedicated Linux utility designed
to scan the sysfs virtual file system and provide a clean,
human-readable summary of all attached SCSI devices and their
attributes. This article explains the primary purpose of the
lsscsi command, how to interpret its default output, and
how to utilize common flags to troubleshoot storage hardware, map device
paths, and inspect storage transport protocols.
Purpose of the lsscsi Command
Modern Linux systems treat a wide range of storage
interfaces—including traditional SCSI, SAS, SATA, USB storage, and Fibre
Channel—as SCSI devices through the kernel's SCSI subsystem. The primary
purpose of lsscsi is to translate the complex directory
structure in /sys/bus/scsi/devices/ into a concise,
organized list.
System administrators rely on lsscsi to quickly answer
critical storage questions:
- Which physical disk corresponds to which
/dev/sd*device node? - What are the SCSI addresses (Host, Channel, Target, LUN) for connected drives?
- Which storage vendor, model, and firmware revisions are active?
- What transport layer (e.g., ATA, FC, SAS) connects the device to the host?
Reading the Default Output
Running the lsscsi command without additional arguments
outputs one line per SCSI device. A typical output resembles the
following:
[0:0:0:0] disk ATA Crucial_CT500MX5 023 /dev/sda
[1:0:0:0] cd/dvd PLDS DVD-RW DH16AFSH BL11 /dev/sr0
[6:0:0:0] disk SanDisk Ultra USB 3.0 1.00 /dev/sdb
The output consists of five primary columns:
- SCSI Address (HCTL Tuple): The bracketed numbers
[Host:Channel:Target:LUN]pinpoint the exact location in the SCSI hierarchy.- Host: The host adapter (HBA) number.
- Channel: The bus channel on the controller.
- Target: The device ID assigned by the controller.
- LUN: The Logical Unit Number within the target.
- Device Type: The SCSI peripheral device type, such
as
disk,cd/dvd, ortape. - Vendor: The manufacturer name reported by the device firmware.
- Model and Revision: The product model string followed by the active firmware revision number.
- Device Node: The Linux device path in the
/devfilesystem used for mounting and partition management.
Essential Command Options
While the standard output is useful for basic inventory,
lsscsi includes specific flags to display extended hardware
details:
- Show Device Capacities (
-s): Appending-sdisplays the storage capacity of any detected disks alongside the device node.lsscsi -s - Inspect Transport Protocols (
-t): The-tflag exposes transport information, revealing target port identifiers, SAS addresses, or World Wide Names (WWNs) for Fibre Channel connections.lsscsi -t - Display Generic SCSI Nodes (
-g): Adding-gshows the associated/dev/sg*(SCSI Generic) device node, which is essential for issuing low-level SCSI commands via tools likesg3_utilsorsmartctl.lsscsi -g - Detailed Sysfs Paths (
-vor-vv): Verbose flags map each device directly to its corresponding directory in/sys, simplifying deep kernel-level troubleshooting.
Why Use lsscsi Over Alternative Commands
Commands like lsblk and fdisk -l excel at
showing block layers, partition tables, and filesystem mount points.
However, they abstract away much of the underlying SCSI topology. The
lsscsi utility focuses entirely on the controller-to-device
relationship, making it the most direct and efficient tool for
diagnosing controller mapping issues, multipath configurations, and
storage fabric connections.