diff options
Diffstat (limited to 'cmd/vdev_id')
-rwxr-xr-x | cmd/vdev_id/vdev_id | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/cmd/vdev_id/vdev_id b/cmd/vdev_id/vdev_id index 9fa2d672c..4c7b270a8 100755 --- a/cmd/vdev_id/vdev_id +++ b/cmd/vdev_id/vdev_id @@ -276,6 +276,23 @@ sas_handler() { d=$(eval echo \${$i}) SLOT=`echo $d | sed -e 's/^.*://'` ;; + "ses") + # look for this SAS path in all SCSI Enclosure Services + # (SES) enclosures + sas_address=`cat $end_device_dir/sas_address 2>/dev/null` + enclosures=`lsscsi -g | \ + sed -n -e '/enclosu/s/^.* \([^ ][^ ]*\) *$/\1/p'` + for enclosure in $enclosures; do + set -- $(sg_ses -p aes $enclosure | \ + awk "/device slot number:/{slot=\$12} \ + /SAS address: $sas_address/\ + {print slot}") + SLOT=$1 + if [ -n "$SLOT" ] ; then + break + fi + done + ;; esac if [ -z "$SLOT" ] ; then return |