• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

lsscsi Command Examples in Linux

by admin

To list the SCSI devices on your system, use a utility that walks the device paths provided by sysfs. One of the most succinct tools is lsscsi. Here’s what you can expect when you run it:

$ lsscsi
[0:0:0:0]    disk    ATA     WDC WD3200AAJS-2  01.0  /dev/sda
[2:0:0:0]    disk    FLASH   Drive UT_USB20    0.00  /dev/sdb

The first column identifies the address of the device on the system, the second describes what kind of device it is, and the last indicates where to find the device file. Everything else is vendor information.

Use yum -y install lsscsi to install the lsscsi package, and enter lsscsi to verify that installation was successful:

# yum -y install lsscsi
# lsscsi

lsscsi Command Examples

1. To list SCSi devices:

# lsscsi

2. To get the classic output:

# lsscsi -c
# lsscsi --classic

3. To get the device name the device node major and minor numbers:

# lsscsi -d
# lsscsi --device

4. To output the scsi generic device file name:

# lsscsi -g
# lsscsi --generic

5. To get the help:

# lsscsi -h
# lsscsi --help

6. To list the SCSI hosts currently attached to the system.

# lsscsi -H
# lsscsi --hosts

7. To Use linux default algorithm for naming devices:

# lsscsi -k
# lsscsi --kname

8. To output additional information in pairs:

# lscsci -L
# lscsci --list

9. To output additional information for each SCSI device:

# lsscsi -l
# lsscsi --long

10. To output additional data integrity (protection) information:

# lsscsi -p
# lsscsi --protection

11. To output transport information:

# lsscsi -t
# lsscsi --transport

12. To get the verbose info:

# lsscsi -v
# lsscsi --verbose

13. To get the version:

# lsscsi -V
# lsscsi --version

14. To assumes sysfs is mounted at PATH instead of the default /sys:

# lsscsi -y
# lsscsi --sysfsroot=PATH

Filed Under: Linux

Some more articles you might also be interested in …

  1. sestatus Command Examples in Linux
  2. CentOS / RHEL : How to prioritize the devices used for swap partition
  3. lastlog Command Examples in Linux
  4. How to Migrate CentOS/RHEL 6 iptables Rules to CentOS/RHEL 7 firewalld
  5. pvck Command Examples in Linux
  6. Magento 2.3.3 Redis cache grows unlimited
  7. How to Configure Separate Port For SSH and SFTP On CentOS/RHEL
  8. mkfs Command Examples in Linux
  9. find Command Examples in Linux
  10. How to List and Set SELinux Context for MySQL Server

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright