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.
- nixCraft is a one-person operation. I create all the content myself, with no help from AI or ML. I keep the content accurate and up-to-date.
- Your privacy is my top priority. I don’t track you, show you ads, or spam you with emails. Just pure content in the true spirit of Linux and FLOSS.
- Fast and clean browsing experience. nixCraft is designed to be fast and easy to use. You won’t have to deal with pop-ups, ads, cookie banners, or other distractions.
- Support independent content creators. nixCraft is a labor of love, and it’s only possible thanks to the support of our readers. If you enjoy the content, please support us on Patreon or share this page on social media or your blog. Every bit helps.
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,
- title FreeBSD 7.0 : Start a new boot entry. User always sees this title and hit enter key to boot os.
- root (hd0,a) : Actual part is to select the correct root partition. The root option set the current root device to the device, then attempt to mount it to get the partition size. In above example – hd0 is your first hard disk i.e. hda in Linux. In grub hda is hd0. Likewise your first, second partition on the first hard disk – hda1, hda2, becomes hd0,0 hd0,1 in Grub. In short, you are asking to use first hard first partition (remember FreeBSD use a,b,c names to represent partition names). If you have installed FreeBSD on third partition then you need to use following root statement:
root (hd0,2,a) - kernel /boot/loader : Use to load the primary boot image. FreeBSD use /boot/loader to load rest of kernel and os.
If it does not want to boot you can put something like this:
title FreeBSD
rootnoverify (hd0,0)
makeactive
chainloader +1
it realy works
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
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
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
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
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 🙂
/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.
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.
Thanks U
To enable FreeBSD 7 in Ubuntu Gibbon,
Appending this following lines helped me.
title FreeBSD 7
rootnoverify (hd0,0)
makeactive
chainloader +1
Thanks
****************************************************
To enable FreeBSD 7 in Ubuntu Gibbon,
Appending this following lines in /boot/grub/menu.lst helped me.
title FreeBSD 7
rootnoverify (hd0,0)
makeactive
chainloader +1
Thanks
*************************************************
————————————————–
****************************************************
Partition Detail
—————-
FreeBSD is installed in the First partition of the primary IDE hard disc. Ubuntu is in second partition.
I tried the first option given in this website.
It too worked.
The following lines are appended.
title FreeBSD 7
root (hd0,0,a)
kernel /boot/loader
Thanks Again. 🙂
*************************************************
Thanks a lot !!
It saved my day.
However I also used this article to restore my filesystem:
http://neosmart.net/forums/showthread.php?t=1823
salut !! i have blowed my system and i ive tryed to restore with alive cd 1010 ..nothing happen,THEN with a 2009 version ,better but when i start i have a strange console saying :shgrub or rescue grub ,mostly i cant send any command ,the pianno don’t play all the letters proppely ..my question :do we have something to load before the live cd to make it work? a grub?linux ? if yes ,how do i empty ALL on that computer to be sure there is nothing at all before the new setting THANKS from France and please to help you for some kind of help i can O.