diff options
Diffstat (limited to 'scripts/local-top/lvm')
-rwxr-xr-x | scripts/local-top/lvm | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm index 7ac81e6..8ff3b98 100755 --- a/scripts/local-top/lvm +++ b/scripts/local-top/lvm @@ -15,23 +15,41 @@ prereqs) ;; esac -vg=${ROOT#/dev/mapper/} +activate_vg() +{ + local vg="$1" + + # Make sure that we have a non-empty argument + if [ -z "${vg}" ]; then + return 0 + fi -case ${vg} in - /dev/root) - unset vg - ;; - /*) + # Take care of lilo boot arg, risky activating of all vg + vg_lilo=${vg:0:2} + if [ "${vg_lilo}" = fe ]; then + vgchange -ay exit 0 - ;; -esac - -modprobe -q dm-mod + fi + + # Make sure that we have a d-m path + vg=${vg#/dev/mapper/} + if [ "$vg" = "$1" ]; then + return 0 + fi -# Split volume group from logical volume. -vg=$(echo ${vg} | sed -e 's#\(.*\)\([^-]\)-[^-].*#\1\2#') -# Reduce padded --'s to -'s -vg=$(echo ${vg} | sed -e 's#--#-#g') + # Split volume group from logical volume. + vg=$(echo ${vg} | sed -e 's#\(.*\)\([^-]\)-[^-].*#\1\2#') + # Reduce padded --'s to -'s + vg=$(echo ${vg} | sed -e 's#--#-#g') -vgchange -ay ${vg} + vgchange -ay ${vg} +} + +if [ ! -e /sbin/vgchange ]; then + exit 0 +fi + +modprobe -q dm-mod +activate_vg "$ROOT" +activate_vg "$resume" |