more dmraid fixes

This commit is contained in:
Tobias Powalowski 2009-06-26 12:39:55 +02:00
parent b70503ad21
commit 780528c7c8

View file

@ -946,7 +946,7 @@ _createpv()
ALREADYINUSE=""
# skip physical volume devices
ALREADYINUSE="$(pvs -o pv_name --noheading)"
# skip raidpartions on physical volumes!
# skip raidpartitions on physical volumes!
if [ "$(pvs -o pv_name --noheading | grep /dev/md_)" ]; then
ALREADYINUSE="$ALREADYINUSE $(pvs -o pv_name --noheading | sed -e 's#p[0-9]$##g')"
fi
@ -954,6 +954,10 @@ _createpv()
for i in $(ls /dev/mapper/* | grep -v control); do
lvs $i --noheading 2>/dev/null && ALREADYINUSE="$ALREADYINUSE $i"
done
# skip dmraid main volume
for i in $(dmraid -s -c); do
ALREADYINUSE="$ALREADYINUSE /dev/mapper/$i"
done
for i in $PARTS; do
# skip harddisks which contain already encrypted partitions!
for k in $(ls /dev/mapper/* | grep -v control); do
@ -1200,6 +1204,10 @@ _luks()
if [ "$(pvs -o pv_name --noheading | grep /dev/md_)" ]; then
ALREADYINUSE="$ALREADYINUSE $(pvs -o pv_name --noheading | sed -e 's#p[0-9]$##g')"
fi
# skip dmraid main volume
for i in $(dmraid -s -c); do
ALREADYINUSE="$ALREADYINUSE /dev/mapper/$i"
done
for i in $PARTS; do
# skip harddisks which contain already encrypted partitions!
for k in $(ls /dev/mapper/* | grep -v control); do