Now we have this typical scenario here where you need to install your boot loader. Into the MBR. And you’re running Debian. Plus, you decided to format your / as xfs.

The whole procedure is kind of like magic. Let me start of by telling you about the problems:

  1. Debian has patched grub-install in such a way to call xfs_freeze to freeze your file system. Unfortunately, that means your file system will be frozen and all programs will block until you unfreeze it.
  2. Well I’m actually clueless about the exact reason, but the Debian grub-install will still hang even if we fix #1.

Hit the jump for the ultimate “this works for me and I don’t know if it works for you” guide to installing grub with an xfs /

I assume that you already have the grub binaries installed on your linux partition, for example by using the Debian installer.

Now you boot with a Debian CD, for example a Debian install disk and type rescue26 at the SysLinux prompt to start it in rescue mode (in order to install the boot loader).

Click through the prompts and choose your root partition. Then choose “install GRUB bootloader”. Wait! Not yet.

Hit on <Alt>+<F2> to switch to a console. Hit Enter to activate it, then chroot /target to make your linux root partition your current root.

Now make sure xfs_freeze is there (it is part of “xfsprogs” package).

Go back to <Alt>+<F1> and finally select “install GRUB”. Now go to <Alt>+<F2> again and type

xfs_freeze -u .

That command is supposed to unfreeze the filesystem that Debian’s grub-install froze. Repeat this command several times.

Wait for a while until you think nothing is happening nomore. You can then <Ctrl>+<D> out of the chroot environment and look at the processes:

ps auxw

Look up the PID of grub-install and then kill grub-install (kill pid).

Now watch the <Alt>+<F1> screen again. If it still doesn’t progress, you might need to

chroot /target
xfs_freeze -u .

one more time on the second virtual console.

Hopefully you should now be back to the menu on the first virtual console. Choose “reboot” and pray.