]> git.pld-linux.org Git - packages/systemd.git/blobdiff - pld-storage-init.sh
Release: 12. Using vgscan --cache on startup.
[packages/systemd.git] / pld-storage-init.sh
index d3487352684b882da3163381a817b7ff1ecc394e..7673c5933fe9b4a6f3b850ae99186ae7f6df2f12 100644 (file)
@@ -3,10 +3,10 @@
 # Read functions
 . /lib/rc-scripts/functions
 
-if [ -x /sbin/multipath ] && ! is_no "$DM_MULTIPATH"; then
+if ! is_no "$DM_MULTIPATH" && [ -x /sbin/multipath ]; then
        modprobe -s dm-mod >/dev/null 2>&1
        modprobe -s dm-multipath >/dev/null 2>&1
-       /sbin/multipath -u -v 0
+       /sbin/multipath -v 0
        [ -x /sbin/kpartx ] && /sbin/dmsetup ls --target multipath --exec '/sbin/kpartx -u -a -p p'
 fi
 
@@ -22,16 +22,20 @@ if [ -x /sbin/dmraid ]; then
                        /sbin/dmraid -ay -i --rm_partitions -p "$dmname"
                        [ -x /sbin/kpartx ] && /sbin/kpartx -u -a -p p "/dev/mapper/$dmname"
                done
-                IFS=$oldIFS
+               IFS=$oldIFS
        fi
 fi
 
 # Start any MD RAID arrays that haven't been started yet
-[ -r /proc/mdstat ] && [ -r /dev/md/md-device-map ] && /sbin/mdadm -IRs
+[ -r /proc/mdstat ] && /sbin/mdadm -As --auto=yes --run 2>&1
 
 if ! is_no "$LVM2" && [ -x /sbin/lvm ]; then
        modprobe -s dm-mod >/dev/null 2>&1
-       run_cmd "Scanning for LVM volume groups" /sbin/lvm vgscan --ignorelockingfailure
+       # --cache to initiate direct device scan and update lvmetad appropriately (if running).
+       # See http://lists.pld-linux.org/mailman/pipermail/pld-devel-pl/2016-January/157230.html
+       run_cmd "Scanning for LVM volume groups" /sbin/lvm vgscan --ignorelockingfailure --cache
        run_cmd "Activating LVM volume groups" /sbin/lvm vgchange -a y --sysinit
        /sbin/lvm vgmknodes --ignorelockingfailure
 fi
+
+exit 0
This page took 0.081719 seconds and 4 git commands to generate.