Merge branch 'vendor/DIFFUTILS'
[dragonfly.git] / initrd / etc / rc.lvm2
1 #!/bin/sh
2
3 if [ ! -x /sbin/lvm ]; then
4         echo "ERROR: /sbin/lvm not exists or executable"
5         return 1
6 fi
7
8 echo "Configuring LVM volumes ..."
9
10 export 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
20 LV_LIST=$( /sbin/lvm vgdisplay -C -o vg_name --noheadings 2> /dev/null )
21 echo " Activated Volume Groups: $LV_LIST"