'fixed raid on grub installation'

This commit is contained in:
Tobias Powalowski 2009-03-28 18:16:46 +01:00
parent 53ef29022c
commit 92f5f43fd6

View file

@ -247,7 +247,7 @@ findpartitions() {
done done
# include none partitionable raid md devices # include none partitionable raid md devices
for devpath in $(ls -d /dev/md* | grep md[0-9]); do for devpath in $(ls -d /dev/md* | grep md[0-9]); do
if [ "$(cat /proc/mdstat 2>/dev/null | grep -w $(basename $devpath)" ]; then if [ "$(cat /proc/mdstat 2>/dev/null | grep -w $(basename $devpath))" ]; then
echo "$devpath" echo "$devpath"
[ "$1" ] && echo $1 [ "$1" ] && echo $1
fi fi
@ -1578,9 +1578,8 @@ dogrub() {
done done
redundant="1" redundant="1"
else else
# none raid1 devices are not redundant, only one device needed! # none raid1 devices are not bootable with grub, let it fail!
_grubdev=$(mapdev $(mdadm --detail $PART_ROOT | grep "\ /dev/" -m 1| sed -e 's#.* /#/#g')) FAIL_RAID=1
redundant=""
fi fi
else else
# use normal device # use normal device
@ -1596,15 +1595,22 @@ dogrub() {
_bootdev="$_bootdev $i" _bootdev="$_bootdev $i"
done done
redundant="1" redundant="1"
# remove fail if /boot is raid1!
FAIL_RAID=""
else else
# none raid1 devices are not redundant, only one device needed! # none raid1 devices are not bootable with grub, let it fail!
_bootdev=$(mdadm --detail $bootdev | grep "\ /dev/" -m 1| sed -e 's#.* /#/#g') FAIL_RAID="1"
redundant=""
fi fi
else else
# remove fail if /boot is on other device!
! [ "$bootdev" = "" ] && FAIL_RAID=""
# use normal device # use normal device
_bootdev=$bootdev _bootdev=$bootdev
fi fi
if [ "$FAIL_RAID" = "1" ]; then
DIALOG --msgbox "Error: Grub cannot boot from none raid1 devices!" 0 0
return 1
fi
if [ "$UUIDPARAMETER" = "yes" ]; then if [ "$UUIDPARAMETER" = "yes" ]; then
local _rootpart="${PART_ROOT}" local _rootpart="${PART_ROOT}"
local _uuid="$(getuuid ${PART_ROOT})" local _uuid="$(getuuid ${PART_ROOT})"