LSI's lsiutil command has a menu option to map os device names to physical enclosure slot...unfortunately this doesn't seem to work with LSI SAS 2008 based controllers (come on LSI get on the stick).
In order to know which physical drive I need to swap in a failure situation, I first keep track of exactly which serial number I put in each drive enclosure location...then use the code below to create a mapping between device name and serial number:
Requires: smartctl
In order to know which physical drive I need to swap in a failure situation, I first keep track of exactly which serial number I put in each drive enclosure location...then use the code below to create a mapping between device name and serial number:
Code:
# sh diskserial.sh
c0t1d0 JK1174YAHMGUSW
c0t2d0 JK1175YAHWZLKX
c0t3d0 JK1131YAHE8T4V
c0t4d0 JK1174YAHMGUAW
c0t9d0 JK1175YBHX0XWH
c0t10d0 JK1175YAHWL26X
c0t11d0 JK1131YAHE8J1V
c0t12d0 JK1174YAHLJ0BW
c0t14d0 JK1175YAHWL00X
c0t15d0 JK1131YAHE8R8V
c0t16d0 JK1131YAHE8SPV
c0t26d0 9XW01R7V
c1d0
c2d0
Code:
# cat diskserial.sh
#!/bin/sh
/usr/sbin/zpool status > /tmp/zpoolstatus.$$
for DISK in `/usr/sbin/format < /dev/null | /usr/bin/egrep "[0-9]+\." | /usr/bin/awk '{print $2}'`
do
/usr/bin/egrep -s -e "${DISK}" /tmp/zpoolstatus.$$
if [ $? -ne 0 ]; then
/usr/bin/echo "${DISK}" >> /tmp/unuseddisks.$$
fi
SERIAL=`/opt/csw/sbin/smartctl -a -d scsi /dev/rdsk/${DISK}s0 2>/dev/null | /usr/bin/egrep -e '^Serial' | /usr/bin/awk '{print $3}'`
/usr/bin/echo "${DISK}\t${SERIAL}"
done
if [ -s /tmp/unuseddisks.$$ ]; then
/usr/bin/echo
/usr/bin/echo
/usr/bin/echo "Drives which do not appear to be a part of any pool."
/usr/bin/echo "PLEASE VERIFY BEFORE MAKING ANY CHANGES."
/usr/bin/cat /tmp/unuseddisks.$$
else
/usr/bin/echo
/usr/bin/echo
/usr/bin/echo "All drives appear to be in use by some pool."
/usr/bin/echo "PLEASE VERIFY BEFORE MAKING ANY CHANGES."
fi
if [ -f /tmp/zpoolstatus.$$ ]; then
/usr/bin/rm /tmp/zpoolstatus.$$
fi
if [ -f /tmp/unuseddisks.$$ ]; then
/usr/bin/rm /tmp/unuseddisks.$$
fi
Requires: smartctl