diff -ur grub-0.97.old/util/grub-install.in grub-0.97/util/grub-install.in
--- grub-0.97.old/util/grub-install.in	2004-07-24 20:57:31.000000000 +0200
+++ grub-0.97/util/grub-install.in	2009-01-16 22:15:46.000000000 +0100
@@ -422,6 +422,17 @@
 test -n "$mkimg" && img_file=`$mkimg`
 test -n "$mklog" && log_file=`$mklog`
 
+# GRUB will try to verify that stage2 is accessible using its own
+# filesystem drivers.  Make sure it's committed to disk.
+sync
+
+# On XFS, sync() is not enough.
+if [ `grub-probe -t fs ${grubdir}` = "xfs" ] ; then
+  xfs_freeze -f ${grubdir} && xfs_freeze -u ${grubdir}
+  # We don't have set -e.  If xfs_freeze failed, it's worth trying anyway,
+  # maybe we're lucky.
+fi
+
 for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do
     count=5
     tmp=`echo $file | sed "s|^${grubdir}|${grub_prefix}|"`

