]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- check for LVM tools version and load only needed modules
authorArtur Frysiak <artur@frysiak.net>
Mon, 8 Mar 2004 14:04:36 +0000 (14:04 +0000)
committerArtur Frysiak <artur@frysiak.net>
Mon, 8 Mar 2004 14:04:36 +0000 (14:04 +0000)
- fix case when /var is RO and LVM2 is activated

svn-id: @3424

rc.d/rc.sysinit

index cab6ee4cc24c2966304ae5910cd991ec5b80f46a..1fef2c9a283095191dc5928b8f86d48b64f56e32 100755 (executable)
@@ -451,11 +451,23 @@ if [ -x /sbin/evms_activate ]; then
 fi
 # LVM
 if is_yes "$EVMS_LVM" || [ -x /sbin/vgscan -a -x /sbin/vgchange ]; then
-       modprobe -s -k lvm-mod >/dev/null 2>&1
-       # device mapper (2.5+ and patched 2.4)
-       modprobe -s -k dm-mod >/dev/null 2>&1
-       run_cmd "Scanning for LVM volume groups" /sbin/vgscan && \
-       run_cmd "Activating LVM volume groups" /sbin/vgchange -a y
+       lvmversion=$(/sbin/vgchange --version 2>/dev/null|head -n 1|awk '{gsub("vgdisplay: Logical Volume Manager ",""); gsub("LVM version:     ",""); gsub(/\..*/,"");print $1}')
+       if [ "$lvmversion" = "1" ] ; then
+               modprobe -s -k lvm-mod >/dev/null 2>&1
+               lvmignorelock=""
+       elif [ "$lvmversion" = "2" ] ; then
+               modprobe -s -k dm-mod >/dev/null 2>&1
+               lvmignorelock="--ignorelockingfailure"
+       else
+           modprobe -s -k lvm-mod >/dev/null 2>&1
+           # device mapper (2.5+ and patched 2.4)
+           modprobe -s -k dm-mod >/dev/null 2>&1
+           lvmignorelock=""
+       fi
+                       
+    
+       run_cmd "Scanning for LVM volume groups" /sbin/vgscan $lvmignorelock && \
+       run_cmd "Activating LVM volume groups" /sbin/vgchange -a y $lvmignorelock
 fi
 
 # Add raid devices
This page took 0.041377 seconds and 4 git commands to generate.