Using dmsetup to get device WWID and name as "mpath_get_name" does not exist on EL 5
Since "mpath_get_name" and "kpartx_get_name" only exist on EL4, you can not using them to get device WWID nor name on EL5.
1, To get the uuid with major and minor device number
- # To get the wwid from the dm device (Should be equal to $3 ?) is null for partition
wwid=`mpath_get_name $1 $2` (on EL4)
Workaround on EL5:
# dmsetup info -c --noheadings -o uuid -j <major> -m <minor>|awk -F'-' '{print $2}'
E.g:
# dmsetup info -c --noheadings -o uuid -j 253 -m 0|awk -F'-' '{print $2}'
149455400000000000000000002000000201300000c000000
2, To get Partition name
-# Partition name (null for non-partition) (on EL4)
- # To get the wwid from the dm device (Should be equal to $3 ?) is null for partition
wwid=`mpath_get_name $1 $2` (on EL4)
Workaround on EL5:
# dmsetup info -c --noheadings -o uuid -j <major> -m <minor>|awk -F'-' '{print $2}'
E.g:
# dmsetup info -c --noheadings -o uuid -j 253 -m 0|awk -F'-' '{print $2}'
149455400000000000000000002000000201300000c000000
2, To get Partition name
-# Partition name (null for non-partition) (on EL4)
0