There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Linux and Unix
Tag Cloud
access acer asus bios bsod computer crash drive driver drivers error ethernet excel freeze games gaming hard drive hardware hdmi internet java laptop malware memory monitor motherboard music network obp printer problem ram random registry router slow software sound trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Configure GRUB to boot FreeBSD

Reply  
Thread Tools
absolutezero1287's Avatar
Senior Member with 210 posts.
 
Join Date: May 2007
Experience: Intermediate
03-Mar-2008, 01: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 to boot FreeBSD-screenshot.png  
absolutezero1287's Avatar
Senior Member with 210 posts.
 
Join Date: May 2007
Experience: Intermediate
03-Mar-2008, 11: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 21,345 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
03-Mar-2008, 11: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 1944
Imagination is more important than knowledge. - Einstein
absolutezero1287's Avatar
Senior Member with 210 posts.
 
Join Date: May 2007
Experience: Intermediate
03-Mar-2008, 11: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
Senior Member with 3,409 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
03-Mar-2008, 11: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.

Last edited by saikee; 03-Mar-2008 at 11:45 AM..
absolutezero1287's Avatar
Senior Member with 210 posts.
 
Join Date: May 2007
Experience: Intermediate
03-Mar-2008, 11: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 at 12:11 PM.. Reason: Update!
absolutezero1287's Avatar
Senior Member with 210 posts.
 
Join Date: May 2007
Experience: Intermediate
03-Mar-2008, 12:02 PM #7
Here's a pic from Ubuntu. Why are there so many partitions? Lol.
Attached Thumbnails
Configure GRUB to boot FreeBSD-screenshot-1.png  
absolutezero1287's Avatar
Senior Member with 210 posts.
 
Join Date: May 2007
Experience: Intermediate
03-Mar-2008, 12:21 PM #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 210 posts.
 
Join Date: May 2007
Experience: Intermediate
03-Mar-2008, 12:28 PM #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 21,345 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
03-Mar-2008, 01: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
Senior Member with 3,409 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
03-Mar-2008, 04: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 210 posts.
 
Join Date: May 2007
Experience: Intermediate
03-Mar-2008, 04: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, 07: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

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
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 07:54 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.