Commit 8ae347a5 authored by Kristian Feldsam's avatar Kristian Feldsam

Enhanced discover and flush lun scripts

Replaced readlink by dmsetup ls
Signed-off-by: Kristian Feldsam's avatarKristián Feldsam <feldsam@gmail.com>
parent 73587639
......@@ -139,7 +139,7 @@ function discover_lun {
exit 1
fi
DM_HOLDER=\$($BASENAME \`$READLINK \$DEV\`)
DM_HOLDER=\$($SUDO $DMSETUP ls -o blkdevname | grep -Po "(?<=3$WWN\s\()[^)]+")
DM_SLAVE=\$(ls /sys/block/\${DM_HOLDER}/slaves)
# Wait a bit for mapping's paths
COUNTER=1
......@@ -160,7 +160,7 @@ function remove_lun {
WWN="$1"
cat <<EOF
DEV="/dev/mapper/3$WWN"
DM_HOLDER=\$($BASENAME \`$READLINK \$DEV\`)
DM_HOLDER=\$($SUDO $DMSETUP ls -o blkdevname | grep -Po "(?<=3$WWN\s\()[^)]+")
DM_SLAVE=\$(ls /sys/block/\${DM_HOLDER}/slaves)
$(multipath_flush "\$DEV")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment