3 # Show device mapper dependent / underlying devices. This is useful for
4 # looking up the /dev/sd* devices associated with a dm or multipath device.
7 if [ "$1" = "-h" ] ; then
8 echo "Show device mapper dependent (underlying) devices."
12 # shellcheck disable=SC2154
15 # If the VDEV path is a symlink, resolve it to a real device
16 if [ -L "$dev" ] ; then
17 dev
=$
(readlink
"$dev")
22 if [ -d "/sys/class/block/$dev/slaves" ] ; then
23 # ls -C: output in columns, no newlines, two spaces (change to one)
24 # shellcheck disable=SC2012
25 val
=$
(ls -C "/sys/class/block/$dev/slaves" |
tr -s '[:space:]' ' ')