diff --git a/cmd/vdev_id/vdev_id b/cmd/vdev_id/vdev_id index 3cf1b58285..713ff98658 100755 --- a/cmd/vdev_id/vdev_id +++ b/cmd/vdev_id/vdev_id @@ -179,8 +179,10 @@ sas_handler() { return fi - # Get the raw scsi device name from multipath -l. - DEV=`multipath -l $DM_NAME |awk '/running/{print $3 ; exit}'` + # Get the raw scsi device name from multipath -l. Strip off + # leading pipe symbols to make field numbering consistent. + DEV=`multipath -l $DM_NAME | + awk '/running/{gsub("^[|]"," "); print $3 ; exit}'` if [ -z "$DEV" ] ; then return fi