There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
UNIX/Linux
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > UNIX/Linux >
Configure GRUB to boot FreeBSD


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
absolutezero1287's Avatar
Senior Member with 156 posts.
 
Join Date: May 2007
Experience: Intermediate
03-Mar-2008, 12:09 AM #1
Configure GRUB to boot FreeBSD
I have a dual boot setup with Ubuntu and FreeBSD. The FreeBSD partition is mounted on /dev/sda3. So I figured that the entry in menu.lst would look like this:

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

But then I get a message saying that that partition doesn't exist. Any suggestions?
Attached Thumbnails
configure-grub-boot-freebsd-screenshot.png  
absolutezero1287's Avatar
Senior Member with 156 posts.
 
Join Date: May 2007
Experience: Intermediate
03-Mar-2008, 10:10 AM #2
For those who need it, here's my GRUB configuration.

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=d60fc9cb-4b80-46bc-88f2-7edf65190e90 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=d60fc9cb-4b80-46bc-88f2-7edf65190e90 ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic
quiet

title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=d60fc9cb-4b80-46bc-88f2-7edf65190e90 ro single
initrd /boot/initrd.img-2.6.22-14-generic

title Ubuntu 7.10, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet

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

### END DEBIAN AUTOMAGIC KERNELS LIST
lotuseclat79's Avatar
Distinguished Member with 10,043 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
03-Mar-2008, 10:20 AM #3
Using Ubuntu, from the root account, issue the command:
# fdisk -l
and post the result in this thread.

I suspect that to make your scheme work with Grub, you may need to repartition FreeBSD to have a /boot partition separate from its main active partition - but, I am not sure, OTOH, you may simply be missing the partition id for your FreeBSD partition. saikee (a member here at TSG) may know the answer off the top of his head as I'm sure he may even have encounter this problem before.

You should note that FreeBSD will not be using any Linux filesystem partitions usually with an ID of 82 for swap, and 83 for either /boot or / root partitions that Grub (being a Linux bootloader probably knows about). The missing information needed for your Unix partition from the screenshot attachment you posted can probably be found here which lists a table of partition ids for PCs. Note: FreeBSD is a5. I would first try assigning a5 to the FreeBSD partition id field with your partitioning software. From your menu.lst entry, it looks to be what the Gnu Grub manual 0.97 specifies, so maybe all you are missing is the partition id specification for FreeBSD in the partition table. In fact, checking with saikee's post for A grub menu booting 100+ systems of Dos, Windows, Linux, BSD and Solaris, it looks like that might be the aswer.

Also, here is a link to How It Works: Partition Tables which may help you understand what you have to do to make your scheme work with Grub further if the above suggestion does not solve your problem, although, I suspect it will.

-- Tom
__________________
The independence created by philosophical insight is - in my opinion - the mark of distinction between a mere artisan or specialist and a real seeker after truth. - Einstein wrote in 1944.

Some say knowledge is power, I say knowledge without action is powerless. - lotuseclat79

Don't confuse action with movement. - Hemingway to Gardner

Imagination is more important than knowledge. - Einstein
absolutezero1287's Avatar
Senior Member with 156 posts.
 
Join Date: May 2007
Experience: Intermediate
03-Mar-2008, 10:31 AM #4
Another little bit of info:

fdisk -l /dev/sda

Disk /dev/sda: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd0f4738c

Device Boot Start End Blocks Id System
/dev/sda1 1 4732 38009758+ 83 Linux
/dev/sda2 9465 9726 2104515 5 Extended
/dev/sda3 * 4733 9464 38009790 a5 FreeBSD
/dev/sda5 9465 9726 2104483+ 82 Linux swap / Solaris

Partition table entries are not in disk order
saikee's Avatar
Distinguished Member with 2,515 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
03-Mar-2008, 10:40 AM #5
Try this in menu.lst
Code:
title FreeBSD 7.0 in sda3 but dude said it is (hd0,2)
root (hd0,2)
chainloader +1
FreeBSD has BSDsubparts that work like logical partitions and its boot loader may be in one of the subparts. In a standard installation it is a lot easier to chainload the BSD bootloader than to ask Grub to fire the BSD up. The difference is to let Grub boots FreeBSD boot loader and the FreeBSD boot loader boots the BSD system.

The partition type a5 is standard for FreeBSD and its variants.
__________________
A newbie entered Linux wonderland in Jun 2004, now a converted Linux user - No. 361921
Using a Linux live CD to clone XP
To install Linux and keep Windows MBR untouched
Adding extra Linux & Doing it in a lazy way
A Grub menu booting 100+ systems & & A "Howto" to install and boot 145 systems
Just booting tips A collection of booting tips
Judge told Linux "You are charged of murdering Windoze by stabbing its heart with a weapon, what was it? Linux replied "A Live CD"

Last edited by saikee : 03-Mar-2008 10:45 AM.
absolutezero1287's Avatar
Senior Member with 156 posts.
 
Join Date: May 2007
Experience: Intermediate
03-Mar-2008, 10:53 AM #6
I'm gonna try this:

title FreeBSD 7.0
root (hd0,3,a)
kernel /boot/loader
chainloader +1

BBL to see if it works.

Thanks everyone for all your input.

Looks like my method didn't work. Saikee, I'm gonna try your method.

Last edited by absolutezero1287 : 03-Mar-2008 11:11 AM. Reason: Update!
absolutezero1287's Avatar
Senior Member with 156 posts.
 
Join Date: May 2007
Experience: Intermediate
03-Mar-2008, 11:02 AM #7
Here's a pic from Ubuntu. Why are there so many partitions? Lol.
Attached Thumbnails
configure-grub-boot-freebsd-screenshot-1.png  
absolutezero1287's Avatar
Senior Member with 156 posts.
 
Join Date: May 2007
Experience: Intermediate
03-Mar-2008, 11:21 AM #8
Well, with my previous configuration:

title FreeBSD 7.0
root (hd0,3,a)
kernel /boot/loader
chainloader +1

it said that it couldn't find the partition. But with the current configuration:

title FreeBSD 7.0 in sda3 but dude said it is (hd0,2)
root (hd0,2)
chainloader +1

It said that it can't mount the partition.

To my understanding, this means that GRUB can't handle BSD partitions or that I simply have the wrong partition.

On a side note: I was told that I could have GRUB load the FreeBSD bootloader which would in turn be able to handle my FreeBSD partition(s).
absolutezero1287's Avatar
Senior Member with 156 posts.
 
Join Date: May 2007
Experience: Intermediate
03-Mar-2008, 11:28 AM #9
Quote:
Originally Posted by saikee View Post
Try this in menu.lst
Code:
title FreeBSD 7.0 in sda3 but dude said it is (hd0,2)
root (hd0,2)
chainloader +1
FreeBSD has BSDsubparts that work like logical partitions and its boot loader may be in one of the subparts. In a standard installation it is a lot easier to chainload the BSD bootloader than to ask Grub to fire the BSD up. The difference is to let Grub boots FreeBSD boot loader and the FreeBSD boot loader boots the BSD system.

The partition type a5 is standard for FreeBSD and its variants.
I tried it out but to no avail. Would I need to install the FreeBSD bootloader?
By default it installs it to the MBR, but I'm worried that it may screw with Ubuntu.

BTW, your post in justlinux.com rocks
lotuseclat79's Avatar
Distinguished Member with 10,043 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
03-Mar-2008, 12:39 PM #10
Quote:
Originally Posted by absolutezero1287 View Post
I tried it out but to no avail. Would I need to install the FreeBSD bootloader?
By default it installs it to the MBR, but I'm worried that it may screw with Ubuntu.

BTW, your post in justlinux.com rocks
Hi,

The line:
kernel /boot/loader
in your menu.lst entry assumes that the FreeBSD bootloader is installed in /boot/loader if I am not mistaken.

-- Tom
saikee's Avatar
Distinguished Member with 2,515 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
03-Mar-2008, 03:23 PM #11
The chainloader +1 only works if you have installed the boot loader in the root partition (sda3) of FreeBSD.
absolutezero1287's Avatar
Senior Member with 156 posts.
 
Join Date: May 2007
Experience: Intermediate
03-Mar-2008, 03:36 PM #12
Oh, I see. So the bootloader must be installed in sda3...I'm gonna give it a shot.
danielcc's Avatar
Computer Specs
Junior Member with 24 posts.
 
Join Date: Mar 2008
Experience: Advanced
04-Mar-2008, 06:26 PM #13
the line for free bsd should be as follows:
title FreeBSD 7.0
root (hd0,2)
kernel /boot/loader

now let me explain why... the title is of course the title. the root is where the partition is located going from 0 as one on up(drive,partition#) your number for bsd is sda3 so it will be a two instead of a 3. the kernal is of course the kernal.... so yeah change that one number and you should be good to go...
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 04:59 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.