• 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

scsi_id Command Examples in Linux

by admin

scsi_id is the command used for finding out the WWN numbers for the external LUNS attached to the host via a FC cable and can’t be used for finding out UUID of devices. scsi_id is primarily for use by other utilities such as udev that require a unique SCSI identifier. By default all devices are assumed black listed, the –whitelisted option must be specified on the command line or in the config file for any useful behavior.

Output from blkid command shows the UUID of devices as shown below.

/dev/sdbh: UUID="r1PHiD-EMu0-oMBa-zzX7-1MT5-YK7R-hJrsjJ" TYPE="LVM2_member" 
/dev/sdbi: UUID="cNTqqN-JRW7-sEWz-fEmw-yWeu-fMEe-0It4ey" TYPE="LVM2_member" 
/dev/mapper/testdevice: UUID="0h3qmS-y1Gk-pEZE-KbfN-gZ7u-Da8O-FkUHJS" TYPE="LVM2_member" 
/dev/mapper/9af08d4e--f055--4200--ad79--d66185ed32fb-master: UUID="1abc78f9-a153-4d9d-b0c4-c8f274bad46a" TYPE="ext3" 

Output of the scsi_id command will give the WWN number of the External storage attached to the server as shown below.

# scsi_id --whitelisted --device=/dev/sda
3600508e000000000d6580ba0eaf2e107

scsi_id Command Examples

1. To retrieve and generate a unique SCSI identifier:

# scsi_id 

2. To Send SG_IO commands to device:

# scsi_id --device=device /dev/sdc 

4. To treat the device as black listed, and do nothing unless a white listed device is found:

# scsi_id --blacklisted 

5. To read configuration and black/white list entries from config-file:

# scsi_id --config=config-file 

6. To treat the device as white listed:

# scsi_id --whitelisted 

7. To use SCSI INQUIRY VPD page code 0x80, 0x83, or pre-spc3-83:

# scsi_id --page=0x80|0x83|pre-spc3-83 

8. To reformat the output:

# scsi_id --replace-whitespace 

9. To export all data in KEY= format used to import in other programs:

# scsi_id --export 

10. To generate verbose debugging output:

# scsi_id --verbose 

11. To display the version:

# scsi_id --version 

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to Disable or set SELinux to Permissive mode
  2. file: command not found
  3. halt: command not found
  4. Linux OS Service ‘avahi-daemon’
  5. mkfs: command not found
  6. nc: command not found
  7. mkfs.xfs: command not found
  8. Why Does “/var/log/messages” Report Martian Packets
  9. “comm” Command in Linux with Examples
  10. sort: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright