1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

Scan also 'mount' output for mounted filesystem.

As util-linux package seems to give all the time different names,
try harder to figure out, where is the given lv possible mounted
and scan /proc/mounts and if not found there, test also 'mount' output.

/dev/dm-xxx
/dev/mapper/vg-lv
/dev/vg/lv

All of them could be used different combination in /proc/mount and mount output.

Patch fixes regression for older systems where new detection code failed to
find valid combination.
This commit is contained in:
Zdenek Kabelac 2010-11-10 10:03:07 +00:00
parent eb82bd0525
commit b500eddad1

View File

@ -199,6 +199,10 @@ detect_mounted() {
# for empty string try again with real volume name # for empty string try again with real volume name
test -z "$MOUNTED" && MOUNTED=$($GREP ^"$RVOLUME" $PROCMOUNTS) test -z "$MOUNTED" && MOUNTED=$($GREP ^"$RVOLUME" $PROCMOUNTS)
# for systems with different device names - check also mount output
test -z "$MOUNTED" && MOUNTED=$($MOUNT | $GREP ^"$VOLUME")
test -z "$MOUNTED" && MOUNTED=$($MOUNT | $GREP ^"$RVOLUME")
# cut device name prefix and trim everything past mountpoint # cut device name prefix and trim everything past mountpoint
# echo translates \040 to spaces # echo translates \040 to spaces
MOUNTED=${MOUNTED#* } MOUNTED=${MOUNTED#* }