From: Wally Wang Date: Wed, 20 Jul 2011 03:50:18 +0000 (-0700) Subject: LU-515 canonicalize the devices names X-Git-Tag: 2.1.51~17 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=f14d2b5feae5213ed243fb63702aa1eed7e0a8b1 LU-515 canonicalize the devices names Perform a readlink on the device name if path is /dev/disk/by-id... See Oracle bug 24487. Change-Id: I964b224d764677d60064901f4238ae77b9cfb5ea Signed-off-by: Wally Wang Signed-off-by: Niu Yawei Reviewed-on: http://review.whamcloud.com/1120 Tested-by: Maloo Reviewed-by: Li Wei Reviewed-by: Oleg Drokin --- 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]*$//'`