# Tested on RHEL 5, 6 & 7
# Check devices currently known to the SCSI subsystem
# ------------------------------------------------------------------------------------------
cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 01 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
# NOTE: 'lsscsi' command can be used to display disks attached to server
# Identify a disk using 'scsi_id' command
# ------------------------------------------------------------------------------------------
# 'scsi_id' queries a SCSI device via the SCSI INQUIRY vital product data (VPD)
# page 0x80 or 0x83 and uses the resulting data to generate a value that is
# unique across all SCSI devices that properly support page 0x80 or page 0x83.
# It may be useful, for instance, to identify a disk shared by two nodes:
hostA:/#> scsi_id --page=0x83 --whitelisted --device=/dev/sdd
36000c290d59b294f402f949a10afd541
hostB:/#> scsi_id --page=0x83 --whitelisted --device=/dev/sde
36000c290d59b294f402f949a10afd541
# Depending on RHEL version, parameters and command location may vary slightly.
# More information about command usage:
# https://sites.google.com/site/syscookbook/rhel/rhel-scsi-identifier-show
# Add a SCSI disk to the system
# ------------------------------------------------------------------------------------------
# On this server we have: Host=0 (scsi0), Channel=0, Id=[0|1] and Lun=0 For a new disk
# we have to use, then, path 0.0.2.0 - SCSI(0:2).
# Once new disk has been attached/added to server, run following command to discover it:
echo "0 2 0" > /sys/class/scsi_host/host0/scan
# NOTE: We may know that host0 is the one to be used taking a look to the contents