1#!/bin/sh 2 3if [ ! -x /sbin/lvm ]; then 4 echo "ERROR: /sbin/lvm not exists or executable" 5 return 1 6fi 7 8echo "Configuring LVM volumes ..." 9 10export LVM_SYSTEM_DIR=/var/tmp/lvm2 11[ -d "$LVM_SYSTEM_DIR" ] || mkdir $LVM_SYSTEM_DIR 12 13# Scan for volume groups 14/sbin/lvm vgscan --mknodes --ignorelockingfailure &> /dev/null 15 16# Change volume availability to yes 17/sbin/lvm vgchange --ignorelockingfailure -a y > /dev/null 18 19# Get a list of volumes and display it 20LV_LIST=$( /sbin/lvm vgdisplay -C -o vg_name --noheadings 2> /dev/null ) 21echo " Activated Volume Groups: $LV_LIST" 22