diff --git a/cmd/vdev_id/vdev_id b/cmd/vdev_id/vdev_id index c7d962045b..a2cba086ee 100755 --- a/cmd/vdev_id/vdev_id +++ b/cmd/vdev_id/vdev_id @@ -237,7 +237,7 @@ sas_handler() { PHY=`ls -d $port_dir/phy* 2>/dev/null | head -1 | awk -F: '{print $NF}'` if [ -z "$PHY" ] ; then - return + PHY=0 fi PORT=$(( $PHY / $PHYS_PER_PORT )) @@ -262,6 +262,10 @@ sas_handler() { "phy") SLOT=`cat $end_device_dir/phy_identifier 2>/dev/null` ;; + "port") + d=$(eval echo \${$i}) + SLOT=`echo $d | sed -e 's/^.*://'` + ;; "id") i=$(($i + 1)) d=$(eval echo \${$i}) diff --git a/man/man5/vdev_id.conf.5 b/man/man5/vdev_id.conf.5 index 4fea83157f..eff8c27cc4 100644 --- a/man/man5/vdev_id.conf.5 +++ b/man/man5/vdev_id.conf.5 @@ -90,7 +90,7 @@ internally uses this value to determine which HBA or switch port a device is connected to. The default is 4. .TP -\fIslot\fR +\fIslot\fR Specifies from which element of a SAS identifier the slot number is taken. The default is bay. @@ -98,6 +98,8 @@ taken. The default is bay. \fIphy\fR - read the slot number from the phy identifier. +\fIport\fR - use the SAS port as the slot number. + \fIid\fR - use the scsi id as the slot number. \fIlun\fR - use the scsi lun as the slot number.