Developers Guide

Useful tools
51 Dell EMC SC Series with Red Hat Enterprise Linux 7x | CML1071
This script applies the scsi_id command and correlates Linux device names (/dev/sdX) to their respective
WWID values.
#!/bin/bash
SCSIID=/usr/lib/udev/scsi_id
#OSMajor=`cat ${ReleaseFile} | awk '{print $7}' | cut -d. -f1`
OSMajor=`uname -r | awk -F. '{print $4}'`
echo "INFO: OS Major Rev. ${OSMajor} detected!"
if [ "${OSMajor}" = "el7" o "${OSMajor}" = "el6" ]; then
{
if [ "${OSMajor}" = "el6" ]; then
{
SCSIID=/sbin/scsi_id
}
for i in `cat /proc/partitions | awk {'print $4'} | grep sd`
do
echo "Device: $i WWID: `${SCSIID} --page=0x83 --whitelisted --
device=/dev/$i`"
done
} | sort -k4 $1
elif [ "${OSMajor}" = "el5" ]; then
{
for i in `cat /proc/partitions | awk {'print $4'} | grep sd`
do
echo "Device: $i WWID: `${SCSIID} -g -u -s /block/$i`"
done
} | sort -k4 $1
else
echo "WARN: OSMajor parameter of unknown value, Exiting"
exit 1
fi
Sample output from this script is shown as follows.
# ./get_WWID.sh
INFO: OS Major Rev. el7 detected!
[snip]
Device: sdd WWID: 36000d3100000650000000000000017f2
Device: sdf WWID: 36000d3100000650000000000000017f2
Device: sdj WWID: 36000d3100000650000000000000017f2
Device: sdl WWID: 36000d3100000650000000000000017f2
[snip]