Configuration of Grub?

Garrett Cooper youshi10 at
Sat Dec 9 15:07:16 PST 2006

Hash: SHA1

David Stanford wrote:
> ad3 may be (and probably is) correct for you, but this has no relationship
> with the 'hdx' format that Grub uses. Using 'hd3' in your Grub config would
> suggest that you have installed FreeBSD on the fourth (counting 0, 1, 2, 3)
> hard drive on your machine. If you have only one hard drive on your machine
> and have installed FreeBSD on it, you would have to use 'hd0' (the *first*
> hard drive) in your config. You would use 'hd1' if you installed on your
> second hard drive, and so on. I would guess, since you mentioned ad3, that
> you have installed FreeBSD on a second hard drive; if so, try the
> following:
> title FreeBSD
>        root (hd1,0,a)
>        kernel /boot/loader

Incorrect. If you installed the filesystem on ad3s1, it should be:

root (hd3,0,a)

Many people goof up GRUB by accident because it's numbering system is
zero-based and linux-like to a certain extent, so /dev/hda in Linux
translates to hd0 in GRUB, which is also ad0 in FreeBSD.

The second argument refers to the partition itself (which may or may not
be 0), and the third argument refers to the slice.

So, in /dev/ad0s1a, this would translate to what I show shortly, in Grub:

root (hd0,0,a)

Another method for accomplishing the same thing from info grub. This may
or may not be outdated information:

4.2.3 FreeBSD
- -------------

GRUB can load the kernel directly, either in ELF or a.out format. But
this is not recommended, since FreeBSD's bootstrap interface sometimes
changes heavily, so GRUB can't guarantee to pass kernel parameters

   Thus, we'd recommend loading the very flexible loader `/boot/loader'
instead. See this example:

     grub> root (hd0,a)
     grub> kernel /boot/loader
     grub> boot

> Right now Linux can not read the FreeBSD disk. Does FreeBSD have its own
>> filesystem?
> Yes, by default FreeBSD uses UFS2. There is almost certainly a third party
> app out there that will allow you to read UFS2 from Linux if this is what
> you want to do at some point. You can also check 'man mount' under SUSE to
> see if there is built-in support for mounting UFS2 filesystems (though this
> is probably a long shot).

UFS2 is supported with a custom kernel IIRC. So, you'll have to
recompile a kernel from sources on your Suse system.

> Ans if it has its own filesystem how can grub read the /boot/loader in
>> there?
> SUSE may not be able to read it, but remember that Grub is independent (so
> to speak) from Linux and has support for booting *BSD OS's.

Grub knows how to deal with different filesystem formats, but this may
or may not be due to the fact that it depends upon other things
available in the kernel that it bootstraps (grub has 2 boot stages). I
will have to look into this a bit further..

> Do I have to copy the loader on my Linux drive, configure it there so
>> FreeBSD
>> can then start?

No. Set it up on linux, making sure that you reference the correct
locations for kernels, and root disks, and you will be fine. If you have
a (GRUB) bootloader setup from Linux, configure everything from there;
don't worry about configuring any other bootloader in any OS, since
everything else is managed by your Linux bootloader.

> Is there any other way to start the system on that disk? From the
> install-CD
>> maybe?
> Hmm, never tried. You may have to use FreeSBIE for something like this,
> but,
> again, try your config first.

You can try booting from the grub shell as well (similar to bash). It
should say what the relevant key to enter in for entering the shell (C,
E, etc). Entering in the individual commands as noted above ("root...
loader") will help you test boot your FreeBSD OS.

- -Garrett
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla -


More information about the freebsd-questions mailing list