If we're using non-standard /dev layout so we can't get the dm-X name
easily, we can't also look at the /sys/blocl/dm-X/dev to get the major:minor
pair. Use "stat" in this case even though it triggers automounts
(but there's no better way for now).
read </sys/block/${RVOLUME#/dev/}/dm/name SYSVOLUME 2>&1 && VOLUME="$DM_DEV_DIR/mapper/$SYSVOLUME"
read </sys/block/${RVOLUME#/dev/}/dev MAJORMINOR 2>&1 || error "Cannot get major:minor for \"$VOLUME\""
;;
+ *)
+ STAT=$(stat --format "MAJOR=%t MINOR=%T" ${RVOLUME}) || error "Cannot get major:minor for \"$VOLUME\""
+ eval $STAT
+ MAJOR=$((0x${MAJOR}))
+ MINOR=$((0x${MINOR}))
+ MAJORMINOR=${MAJOR}:${MINOR}
+ ;;
esac
# use null device as cache file to be sure about the result
# not using option '-o value' to be compatible with older version of blkid