Jason White wrote:
> I am trying to install Grub onto a system with a single XFS partition serving
> as both / and /boot.
> Distribution: Debian Unstable (Sid).
> Architecture: x86_64
> When I run grub-install I get:
> Searching for GRUB installation directory ... found: /boot/grub
> Due to a bug in xfs_freeze, the following command might produce a segmentation
> fault when /boot/grub is not in an XFS filesystem. This error is harmless and
> can be ignored.
Hrm, that's funky.
> At this point the install script hangs and the only way to recover is to
> reboot the machine (with a hard reset). Needless to say, Grub isn't installed.
> Any suggestions?
> Note that the installation of grub failed during the Debian installation
> process for a reason that wasn't specified (no helpful error message).
Hard to say - in a nutshell, grub just sucks w.r.t. how it (ab)uses the
filesystem it's trying to install on.
In some invocations, it actually writes directly to the block device
*while it is mounted* - this leads to data corruption and/or filesystem
In other cases, in a "verification" phase, it tries to directly read
filesystem structures off the disk *while it is mounted* after a couple
of wishful sync; sync;'s - this often can lead to a grub hang when it
goes off in the weeds on inconsistent disk data that it finds.
I think various distros have tried to hack around these problems in
different ways; the freeze above is probably an effort to coalesce the
filesystem before grub goes groveling around the disk to verify what it
a) don't write to the bdev while mounted
and b) don't try to read the mounted filesystem via the bdev (skip
it should all work ok.
(for fedora grub, a) means passing the path to the stage2 files on the
commandline to grub-install, ymmv):
install --stage2=/boot/grub/stage2 (hd0,7)/grub/stage1 d (hd0)
for some reason this stops grub from writing to the mounted block device.
Otherwise, I'd bug debian - honestly, this isn't an xfs bug.