Search
j0ke.net Open Build Service
>
Projects
>
GFS
>
lvm2
> collect_lvm
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File collect_lvm of Package lvm2
#!/bin/sh PVNAME=$1 /sbin/lvm pvs --config "devices {filter = [ \"a|$PVNAME|\", \"r/.*/\" ]}" --partial -o vg_name,vg_attr,pv_uuid,vg_uuid --ignorelockingfailure --noheadings $PVNAME 2>/dev/null | while read vgname vgattr pvuuid vguuid; do if [[ $vgattr =~ mode. ]]; then continue fi if [[ $vgattr =~ .....c ]]; then exit 1 fi pvlist=$(/sbin/lvm vgdisplay --config "devices {filter = [ \"a|$PVNAME|\", \"r/.*/\" ]}" --partial -v $vgname 2>/dev/null | while read str1 str2 val; do if [[ $str1 =~ PV && $str2 =~ UUID ]]; then echo $val fi done) echo PVUUID=$pvuuid echo VGUUID=$vguuid echo VGNAME=$vgname collected=0 for pv in $pvlist; do if [[ ! -h /dev/disk/by-id/lvm2-pvuuid-$pv ]]; then echo COLLECT=1 collected=1 break fi done if [[ $collected == 0 ]]; then echo COLLECT=0 fi # /lib/udev/collect $vguuid $pvuuid $pvlist # echo COLLECT=$? done