public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs@oss.sgi.com
Subject: Re: Installing grub onto a system with XFS root fs
Date: Sun, 16 Dec 2007 19:07:11 -0600	[thread overview]
Message-ID: <4765CBBF.1020207@sandeen.net> (raw)
In-Reply-To: <20071217004945.GA13335@jdc.jasonjgw.net>

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
corruption.

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
just wrote(!).

If you:

a) don't write to the bdev while mounted

and b) don't try to read the mounted filesystem via the bdev (skip
verification steps)

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)
/grub/stage2 p
(hd0,7)/grub/grub.conf

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.

-Eric

  reply	other threads:[~2007-12-17  1:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-17  0:49 Installing grub onto a system with XFS root fs Jason White
2007-12-17  1:07 ` Eric Sandeen [this message]
2007-12-17  1:46   ` Jason White
2007-12-17  3:12     ` Eric Sandeen
2007-12-17 13:28 ` Martin Steigerwald
2007-12-17 23:04   ` Jason White
2007-12-18  0:35     ` David Chinner
2007-12-18 22:03       ` Martin Steigerwald

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4765CBBF.1020207@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox