kexec-tools/kdump_runtime_helpers/assemble_lvm_array
2009-05-20 16:42:31 +00:00

25 lines
637 B
Bash
Executable File

#!/bin/sh
#kdump-requires: /etc/lvm/lvm.conf
#
echo "Scanning logical volumes"
lvm vgscan --ignorelockingfailure --mknodes
echo "Activating logical volumes"
lvm vgchange -a y --ignorelockingfailure
DM_NUM=0
for i in `lvm lvs --noheadings -o lv_name,vg_name | sed -e's/\+/:/g'`
do
LV=`echo \$i | awk -F":" '{ print $2 }'`
VGRP=`echo $i | awk -F":" '{ print $3 }'`
mkdir -p /dev/$VGRP
if [ ! -e /dev/$VGRP/$LV ]
then
ln -s /dev/mapper/$VGRP-$LV /dev/$VGRP/$LV
DM_NUM=`echo $DM_NUM 1 + p | dc`
echo "Resuming /dev/mapper/"$VGRP-$LV
/sbin/dmsetup resume /dev/mapper/$VGRP-$LV
fi
done
echo "All LVM volumes reactivated"
exit 0