From ba0e266b9d26ac1ab0e1afb050df9dfeb9b7500f Mon Sep 17 00:00:00 2001 From: Gerhard Brauer Date: Thu, 4 Jun 2009 17:14:23 +0200 Subject: Fix xfs freezing during grub installation Since kernel 2.6.29 xfs_freeze could also freeze non-xfs partitions. This leeds to the problem that in the process of grub installation all our TARGET partitions ($target/ and $target/boot) get freezed - regardless which filesystem they have. The result is a stuck grub install. Better way is: freeze above TARGETS only if they realy have an xfs FS. --- src/core/libs/lib-ui-interactive.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 8beb6fb..2b57346 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -807,10 +807,12 @@ EOF cp -a $var_TARGET_DIR/usr/lib/grub/i386-pc/* $var_TARGET_DIR/boot/grub/ sync # freeze xfs filesystems to enable grub installation on xfs filesystems - if [ -x /usr/sbin/xfs_freeze ]; then - /usr/sbin/xfs_freeze -f $var_TARGET_DIR/boot > /dev/null 2>&1 - /usr/sbin/xfs_freeze -f $var_TARGET_DIR/ > /dev/null 2>&1 - fi + for xfsdev in $(blkid -t TYPE=xfs -o device); do + mnt=$(mount | grep $xfsdev | cut -d' ' -f 3) + if [ $mnt = "$var_TARGET_DIR/boot" -o $mnt = "$var_TARGET_DIR/" + /usr/sbin/xfs_freeze -f $mnt > /dev/null 2>&1 + fi + done # look for a separately-mounted /boot partition bootpart=$(mount | grep $var_TARGET_DIR/boot | cut -d' ' -f 1) if [ "$bootpart" = "" ]; then @@ -843,10 +845,12 @@ quit EOF cat /tmp/grub.log >$LOG # unfreeze xfs filesystems - if [ -x /usr/sbin/xfs_freeze ]; then - /usr/sbin/xfs_freeze -u $var_TARGET_DIR/boot > /dev/null 2>&1 - /usr/sbin/xfs_freeze -u $var_TARGET_DIR/ > /dev/null 2>&1 - fi + for xfsdev in $(blkid -t TYPE=xfs -o device); do + mnt=$(mount | grep $xfsdev | cut -d' ' -f 3) + if [ $mnt = "$var_TARGET_DIR/boot" -o $mnt = "$var_TARGET_DIR/" + /usr/sbin/xfs_freeze -u $mnt > /dev/null 2>&1 + fi + done if grep "Error [0-9]*: " /tmp/grub.log >/dev/null; then notify "Error installing GRUB. (see $LOG for output)" -- cgit v1.2.3-54-g00ecf