nixCraft Poll

Topics

Configure Ubuntu Linux GRUB to load FreeBSD

Posted by Vivek Gite [Last updated: April 26, 2008]

Recently my friend emailed me an interesting scenario. He installed FreeBSD 6.0 / 7.0 in the first primary partition (10G). One day he installed Ubuntu Linux. He can boot into Linux but not able to boot into FreeBSD. Now, my friend wanted to boot both FreeBSD and Ubuntu Linux via Grub boot loader.

It is not that hard to configure grub to boot FreeBSD. You just need to add following three lines to grub configuration file (/boot/grub/menu.lst). Boot into Ubuntu Linux and use text editor to edit the file /boot/grub/menu.lst ( Red hat and friends [ Fedora / CentOS ] try /etc/grub.conf file) :
$ gksudo gedit /boot/grub/menu.lst
OR
$ gksudo vi /boot/grub/menu.lst
Append FreeBSD boot Configuration:

title  FreeBSD 7.0
root   (hd0,a)
kernel /boot/loader

Save and close the file. To see changes or to boot into FreeBSD reboot Ubuntu Linux box.
Where,

Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

You may also be interested in other helpful articles:

Discussion on This Article:

  1. seaman Says:

    If it does not want to boot you can put something like this:

    title FreeBSD
    rootnoverify (hd0,0)
    makeactive
    chainloader +1

    it realy works

  2. DJ Tux Says:

    GRUB loads the kernel directly and FreeBSD’s bootstrap interface sometimes changes heavily so GRUB can’t guarantee to pass kernel parameters correctly. Thus loading it via very flexible loader i.e. /boot/loader is highly recommend.

    @seaman,
    Your method is good when unsupported operating systems needs booting via GRUB. But for FreeBSD /boot/loader is highly recommend.

    Cheers,

    DJ Tux

  3. johan Says:

    Hey,
    I dont really understand, I got ubuntu and windowsxp,, now when I start my computer I want to be able co choose one of these, what shoud I put to choose windows xp?
    have to ask so I dont do anything wrong,
    Thank you,
    Johan

  4. nixcraft Says:

    johan,

    Do you see Windows XP as boot option? If so just select and enter. If you don’t see an option you need to edit grub.conf

  5. Matrixium Says:

    Hi,
    I just install ubuntu on top of window xp. I can boot into ubuntu, but I can not boot into window xp.
    when I start my computer I was able to choose window xp as one of the choices to boot. But then the windows xp went to a autocheck,and autochecks fails. then the system restarts itself.
    can you help to solve the problem?

    Thank you

  6. Marco van de Voort Says:

    Note that partition (label) “c” is special and designates the whole disc.

    P.s. it is kind of confronting having to type “linux” as antispam word on a FreeBSD topic :-)

  7. cfchris6 Says:

    /boot/loader did not work for me, I think that is mainly because GRUB is not able to handle the disklabels of BSD correctly because /boot/loader may be in ad0s1a but GRUB looks just in ad0s1, so GRUB does not find anything.

    root(hd?,?)
    makeactive
    chainloader +1

    works perfectly and gives all the possibilitiys as a bootloader directly installed on MBR.

  8. John Marino Says:

    Thanks for this article.

    I was not amused tonight. I have FreeBSD on my primary partition of my primary disk. A few months ago I left 24GB free reserved for a Linux testbed and installed Ubuntu 8.04 tonight. Much to my anger, it wiped out my existing bootloader and I couldn’t get back to my primary OS.

    This article pointed me in the right direction — true I am now using grub instead of the freeBSD bootloader but at least I can get to FreeBSD now.

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , , , , , , , , , , , , , ,

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.