Skip to contentSkip to conversation

95fstab-sys: Skip mounted filesystem.

PATCH New Chao Wang 1 participant 2 messages Jul 26, 2012 1 message not in the archive

lore
Share & tools
lore

Chao Wang

author
#0 lore raw

PATCH 1/1 95fstab-sys: Skip mounted filesystem.

---
 modules.d/95fstab-sys/mount-sys.sh | 1 +
 1 file changed, 1 insertion(+)
modules.d/95fstab-sys/mount-sys.sh +1 -0
index a1e5ab1..12711a0 100755
@@ -11,6 +11,7 @@ fstab_mount() {
     info "Mounting from $1"
     while read _dev _mp _fs _opts _dump _pass _rest; do
         [ -z "${_dev%%#*}" ] && continue # Skip comment lines
+        ismounted $_mp && continue # Skip mounted filesystem
         if [ "$_pass" -gt 0 ] && ! strstr "$_opts" _netdev; then
             fsck_single "$_dev" "$_fs" "$_opts"
         fi
Signature · 1 line
1.7.11.2
author
#2 lore raw

PATCH 1/1 90multipath: check() - Regexp fix to match multipath partition.

In reply to a message not in the archive

A multipath partition's uuid will be presented like:

 # cat /sys/dev/block/$_dev/dm/uuid
 part1-mpath-360060e801047103004f2c4b300000008

So in this case, change the match regexp from '^mpath-' to 'mpath-'.

---
 modules.d/90multipath/module-setup.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
modules.d/90multipath/module-setup.sh +1 -1
index 5944d25..6c96441 100755
@@ -11,7 +11,7 @@ check() {
         local _dev
         _dev=$(get_maj_min $1)
         [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
-        [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ ^mpath- ]] && return 0
+        [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ mpath- ]] && return 0
         return 1
     }
 
Signature · 1 line
1.7.11.2