From: Wally Wang Date: Wed, 24 Aug 2011 19:00:37 +0000 (-0700) Subject: LU-608 canonicalize the devices names X-Git-Tag: v1_8_6_81~7 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=a8f9dd59341d949392c92faee57124bc70c91ce3;p=fs%2Flustre-release.git LU-608 canonicalize the devices names Perform a readlink on the device name if path is /dev/disk/by-id... See Oracle bug 24487. Change-Id: I52bc670181606663bfbd746d34f3c2bc710ecc72 Signed-off-by: Wally Wang Reviewed-on: http://review.whamcloud.com/1284 Tested-by: Hudson Reviewed-by: Andreas Dilger Reviewed-by: Brian J. Murrell Tested-by: Maloo --- diff --git a/lustre-iokit/sgpdd-survey/sgpdd-survey b/lustre-iokit/sgpdd-survey/sgpdd-survey index 6d99457..d9ad8ae 100755 --- a/lustre-iokit/sgpdd-survey/sgpdd-survey +++ b/lustre-iokit/sgpdd-survey/sgpdd-survey @@ -62,7 +62,11 @@ if [ "$scsidevs" ]; then fi for d in $scsidevs; do - devs[$i]=`sg_map | awk "{if (\\\$2 == \"$d\") print \\\$1}"` + if [[ -L "$d" ]]; then + echo "Device $d specified by alias. Will 'readlink' for device name" + d=$(readlink -f $d) + fi + devs[$i]=`sg_map | awk "{if (\\\$2 == \"$d\") print \\\$1}"` if [ -z "${devs[i]}" ]; then echo "Can't find SG device for $d, testing for partition" pt=`echo $d | sed 's/[0-9]*$//'`