summaryrefslogtreecommitdiff
path: root/scripts/vyatta-raid-event
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2010-03-03 18:08:51 -0800
committerBob Gilligan <gilligan@vyatta.com>2010-03-03 18:08:51 -0800
commit742350e958edc7950844f806d3a1fca3dfb8e02b (patch)
tree75172a7b75eb9dc9b8382361f7e72efbe9d56147 /scripts/vyatta-raid-event
parentf5a394b660780b6551a631770394455183af682d (diff)
downloadvyatta-cfg-system-742350e958edc7950844f806d3a1fca3dfb8e02b.tar.gz
vyatta-cfg-system-742350e958edc7950844f806d3a1fca3dfb8e02b.zip
Bugfix 5404: Handle RAID re-sync on image-installed systems.
Diffstat (limited to 'scripts/vyatta-raid-event')
-rw-r--r--scripts/vyatta-raid-event13
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/vyatta-raid-event b/scripts/vyatta-raid-event
index f279a57d..2c193da5 100644
--- a/scripts/vyatta-raid-event
+++ b/scripts/vyatta-raid-event
@@ -55,8 +55,17 @@ case $event in
# We need to update grub at the time that a resync completes
# on the root filesystem so that the new member disk will be
# bootable.
+ root_dir=/
+ mounted_on_root=0
mounted_on=`mount | grep "^${raid_set}" | awk '{ print $3 }'`
- if [ "$mounted_on" = "/" ]; then
+ for dir in $mounted_on ; do
+ if [ "$dir" = "/" -o "$dir" = "/live/image" ]; then
+ mounted_on_root=1
+ root_dir=$dir
+ fi
+ done
+
+ if [ $mounted_on_root -eq 1 ]; then
raid_set_dev=${raid_set##*/}
if [ -e /sys/block/${raid_set_dev}/md/degraded ]; then
degraded=`cat /sys/block/${raid_set_dev}/md/degraded`
@@ -68,7 +77,7 @@ case $event in
logger -t "RAID" -p local0.warning \
"RAID set ${raid_set} holds root filesystem. Updating grub."
touch /tmp/raid-grub-install-log
- grub-install --no-floppy --recheck --root-directory=/ ${raid_set} \
+ grub-install --no-floppy --recheck --root-directory=${root_dir} ${raid_set} \
>> /tmp/raid-grub-install-log 2>&1
if [ $? -ne 0 ]; then
logger -t "RAID" -p local0.warning \