bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grub fails to detect harddrive on freebsd 5.0-release


From: leon j. breedt
Subject: Re: grub fails to detect harddrive on freebsd 5.0-release
Date: Sun, 8 Jun 2003 16:04:07 +0100
User-agent: Mutt/1.4i

i wrote:

    i run the 'grub' command in interactive shell mode. i try to
    force detection of ad0 as '(hd0)' using 'device (hd0) /dev/ad0',
    and get no error message. i then execute 'root (hd0,2,a)', as
    a precursor to running 'setup (hd0)', and get the error message:

    Error 21: Selected disk does not exist

it would seem this is due to the GEOM layer in FreeBSD 5.x that
is now mandatory. GEOM disallows opening of /dev/ad* in R/W mode
if any slices on the disk are mounted, no matter what the securelevel is.

so the get_diskinfo() call in asmstub.c fails, and GRUB silently
deletes the '(hd0)' device from the map (!!!! why not complain???).

if i patch asmstub.c to accept EPERM as well in the check for a
failed open, then it sees the disks, but any later write operations
fail, obviously.

since your boot disk is often the disk containing the '/' filesystem,
and the disk GRUB expects to be able to write stage1 to, this is
always going to fail because of GEOM, unless your boot disk is not
the one containing '/', or you can unmount it beforehand somehow.

i'm surprised no-one else using FreeBSD 5.x ran into this...

anyhow, this can probably only be fixed by either adding GEOM
support (libdisk(3)??), or using the DIOCSMBR ioctl's that 
FreeBSD's fdisk(8) uses on a read-only fd.

adding support for this is beyond my feeble capabilities at
this point, i wouldn't know how to translate the GEOM/ioctl
semantics into the ones required by GRUB.

leon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]