mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
fsadm: use stat to get major:minor pair for non-standard /dev layouts
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).
This commit is contained in:
parent
2879eff86e
commit
6c10d1f3d9
@ -191,6 +191,13 @@ detect_fs() {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user