lvm: lvm.conf (locking_type = 4)
- the use of sed is placeholder "hack" until lvm2 provides a proper tool for changing lvm.conf - lvm_scan.sh should run lvm commands with --ignorelockingfailure to re-use lvm's existing initrd-specific logic; future lvm2 changes will split this flag out into various new command-line switches - no monitoring should be started from within initramfs - NOTE: the same should apply to 90dmraid/install - the correct types would be: '[ "blkext", 1 , "cciss0", 16 ]' but lvm2 (>= 2.02.52) already properly supports both 'blkext' and 'cciss' (including cciss0 -> cciss7)master
parent
5c7821b6c5
commit
0fae59d6eb
|
@ -1,23 +1,17 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
inst lvm
|
inst lvm
|
||||||
inst dmeventd
|
|
||||||
|
|
||||||
if ldd $(which lvm) | grep -q lib64; then
|
|
||||||
LIBDIR="/lib64"
|
|
||||||
else
|
|
||||||
LIBDIR="/lib"
|
|
||||||
fi
|
|
||||||
|
|
||||||
inst_rules "$moddir/64-lvm.rules" 64-lvm.rules
|
inst_rules "$moddir/64-lvm.rules" 64-lvm.rules
|
||||||
|
|
||||||
if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then
|
if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then
|
||||||
[ -f /etc/lvm/lvm.conf ] && inst /etc/lvm/lvm.conf
|
if [ -f /etc/lvm/lvm.conf ]; then
|
||||||
|
inst /etc/lvm/lvm.conf
|
||||||
|
# FIXME: near-term hack to establish read-only locking;
|
||||||
|
# use command-line lvm.conf editor once it is available
|
||||||
|
sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' ${initdir}/etc/lvm/lvm.conf
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in $(ls /$LIBDIR/libdevmapper-event*.so 2>/dev/null); do
|
|
||||||
dracut_install $i
|
|
||||||
done
|
|
||||||
|
|
||||||
inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules 11-dm-lvm.rules
|
inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules 11-dm-lvm.rules
|
||||||
|
|
||||||
inst "$moddir/lvm_scan.sh" /sbin/lvm_scan
|
inst "$moddir/lvm_scan.sh" /sbin/lvm_scan
|
||||||
|
|
|
@ -23,14 +23,17 @@ if [ ! -e /etc/lvm/lvm.conf ]; then
|
||||||
printf '"a|^/dev/%s$|", ' $dev;
|
printf '"a|^/dev/%s$|", ' $dev;
|
||||||
done;
|
done;
|
||||||
echo '"r/.*/" ]';
|
echo '"r/.*/" ]';
|
||||||
echo 'types = [ "blkext", 1024 , "cciss0", 1024 ]'
|
|
||||||
echo '}';
|
echo '}';
|
||||||
|
# establish read-only locking
|
||||||
|
echo 'global {';
|
||||||
|
echo ' locking_type = 4';
|
||||||
|
echo '}';
|
||||||
} > /etc/lvm/lvm.conf
|
} > /etc/lvm/lvm.conf
|
||||||
lvmwritten=1
|
lvmwritten=1
|
||||||
fi
|
fi
|
||||||
info "Scanning devices $lvmdevs for LVM volume groups $VGS"
|
info "Scanning devices $lvmdevs for LVM volume groups $VGS"
|
||||||
lvm vgscan 2>&1 | vinfo
|
lvm vgscan --ignorelockingfailure 2>&1 | vinfo
|
||||||
lvm vgchange -ay --monitor n $VGS 2>&1 | vinfo
|
lvm vgchange -ay --ignorelockingfailure --monitor n $VGS 2>&1 | vinfo
|
||||||
if [ "$lvmwritten" ]; then
|
if [ "$lvmwritten" ]; then
|
||||||
rm -f /etc/lvm/lvm.conf
|
rm -f /etc/lvm/lvm.conf
|
||||||
ln -s /sbin/lvm-cleanup /pre-pivot/30-lvm-cleanup.sh 2>/dev/null
|
ln -s /sbin/lvm-cleanup /pre-pivot/30-lvm-cleanup.sh 2>/dev/null
|
||||||
|
|
Loading…
Reference in New Issue