LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices



Reply
 
Search this Thread
Old 08-18-2010, 02:44 PM   #1
j1alu
Member
 
Registered: Apr 2009
Distribution: debian gnu/linux
Posts: 798

Rep: Reputation: Disabled
I can't get grub2 to boot FreeBSD


I installed FreeBSD on the third partition of the second internal hard-disk (in linux-speak /dev/sdb3 from fdisk -l, i seem to remember it was ad6 during FreeBSD installation).
My entry for grub2 looks like this:
Code:
menuentry "FreeBSD" {
insmod ufs2
set root=(hd1,3)
chainloader +1
}
But when i choose FreeBSD from grubs menu it just hangs, no error message.
Version is FreeBSD-8.1.
I tried different changes to the set-root-line, i also tried "freebsd /boot/loader", but then get different kind of errors.
I am able to mount /dev/sdb3 from Debian and have a look at it.

Thanks

In case it helps: The installation CD says its ad6s3
 
Old 08-18-2010, 05:08 PM   #2
rocket357
Member
 
Registered: Mar 2007
Location: 127.0.0.1
Distribution: OpenBSD-CURRENT
Posts: 476
Blog Entries: 121

Rep: Reputation: 74
Quote:
Originally Posted by j1alu View Post
Code:
menuentry "FreeBSD" {
insmod ufs2
set root=(hd1,3)
chainloader +1
}
You need to specify the slice as well. root=(hd1,3,a)
 
Old 08-18-2010, 11:53 PM   #3
j1alu
Member
 
Registered: Apr 2009
Distribution: debian gnu/linux
Posts: 798

Original Poster
Rep: Reputation: Disabled
I tried that as well:
i used
set root=(1,3,a) and set root=(0,3,b)
and what not.

Everything else i try gives me an error message. Mostly that the partition would not exist.
On my other PC it works with the syntax i posted above (without the slice letter). Also grub2, also Debian/FreeBSD.
 
Old 08-19-2010, 02:36 AM   #4
pr_deltoid
Member
 
Registered: Jun 2010
Distribution: Fedora
Posts: 289

Rep: Reputation: 41
I'm using Kubuntu/FreeBSD and have root set as (hd0,3) and chainloader + 1 and nothing else and it works fine. It looks like this:
Code:
menuentry "FreeBSD" {
    set root=(hd0,3)
    chainloader +1
}

Last edited by pr_deltoid; 09-01-2010 at 12:00 AM.
 
Old 08-19-2010, 04:19 AM   #5
j1alu
Member
 
Registered: Apr 2009
Distribution: debian gnu/linux
Posts: 798

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by prdeltoid View Post
I use Kubuntu/FreeBSD and have root set as (hd0,3) and chainloader + 1 and nothing else and it works fine. It looks like this:
Code:
menuentry "FreeBSD" {
    set root=(hd0,3)
    chainloader +1
}
Like said: exactly that syntax works fine on my second PC.
I want a bit more of horse-power for BSD, so i put it on my main PC too.

Now the problem is the following:
1)i am rather lousy with the output of "fdisk" from BSD. I am better with the output of "fdisk -l" in linux-speak.
The partiton(s) BSD is/are installed on is:
/dev/sdb3
Wherever the no 6 in sd6a3 from the BSD-installation is coming from is beyond me.

2) If there would be an grub-error i could search for it. But it just hangs, and nothing happens

3) I am not so sure about /boot/grub/device.map, as it comes with UUID now.
In my eyes it looks ok.

4) During FreeBSD installations there are three options:
install to mbr, something else and don't install a boat- loader at all.
I don't know what to use in case i already know i will boot it from Debian's grub.
I tried different options, but to no avail.
 
Old 08-19-2010, 04:23 AM   #6
j1alu
Member
 
Registered: Apr 2009
Distribution: debian gnu/linux
Posts: 798

Original Poster
Rep: Reputation: Disabled
I already tried all i can think of. The installation is sitting in the box and ready to explode (aka: to be booted).
If no one helps me to get it booted i will have to remove it again. No biggie, sure, but a bit of a pity, cause i will have to use FreeBSD on my other PC, with less specs, and in Vbox and Qemu, with "more of less specs".

So, BSD-folks, take the chance and give a Linuxer a hand, so he will get convinced of the amazing BSD.
Pluaeze.....
 
Old 08-19-2010, 02:05 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
@j1alu: Before you throw in the towel on that, at least give the shorter form chainloader approach (mentioned earlier) a try. It's a little more simplistic, but sometimes you need a blunt tool.

-------

edit: Actually, after reading here and here, your initial syntax (minus the insmod, perhaps) looks fairly sane.

For grins, read the following (short) article and accompanying comments:
http://www.cyberciti.biz/tips/config...d-freebsd.html

Last edited by anomie; 08-19-2010 at 02:11 PM.
 
Old 08-19-2010, 03:28 PM   #8
j1alu
Member
 
Registered: Apr 2009
Distribution: debian gnu/linux
Posts: 798

Original Poster
Rep: Reputation: Disabled
Hmm... bit of an update.
I tried again to edit the grub menu entry by hitting <e>. No avail.

Then i re-installed BSD.
When i can choose the hard-disk there is:
ad4
ad6
I choose ad6 (which is the second hard-disk).
This time i have chosen to install the freebsd-boot-loader to mbr (might well be i already did that... not sure).
I rebooted: No freebsd-boat-loader, but grub menu. Huh?
(the last time grub was replaced by freebsd-boot-loader, i booted a live-CD and re-installed grub)

Then i have chosen to boot from the second hard-disk:
Voila, the freebsd boot-menu (F1; F2; F3 and so on).
I hit enter: nothing.
The keyboard is dead. Really.
OMG....
 
Old 08-19-2010, 03:33 PM   #9
linus72
Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,084

Rep: Reputation: 336Reputation: 336Reputation: 336Reputation: 336
I had something similar happen when I installed
Calculate Linux Scratch
for some reason no matter what OS I installed, even to where Calculate used to be, a Calculate
grub menu always came up
this is even after reformatting partitions and reinstalling grub

in desperation I finally had to DD the hard drive
and then it was normal again...
 
Old 08-20-2010, 07:26 AM   #10
j1alu
Member
 
Registered: Apr 2009
Distribution: debian gnu/linux
Posts: 798

Original Poster
Rep: Reputation: Disabled
thanks, linus72.
Well: i got two other partitions on that hard-disk.
The one contains a backup of my Documents and Music
The other contains a monthly backup of my OS from January to now and a lot of iso's.
So i would rather not want to dd it (besides that i did never use dd ).

That said: it might well be that you are right (and that that would be the solution. If i would know for sure i could move the data around, go for dd and move the data back... but just as a test... bit much of work)


Another option would be to use a stick.
As my main purpose is to use FreeBSD with more horse-power, would that make sense?
Debian is slower on a stick than on a hard-disk (not much, but it is).

Last edited by j1alu; 08-20-2010 at 07:28 AM.
 
Old 08-20-2010, 12:11 PM   #11
j1alu
Member
 
Registered: Apr 2009
Distribution: debian gnu/linux
Posts: 798

Original Poster
Rep: Reputation: Disabled
Ok, now it gets weird.
I installed a debian-based distribution on said device (/dev/sdb3) and i run into the exactly same problem.
I choose it from the grub-menu, no error-message whatsoever, but the screen, including the grub-image, just hangs there.

For how to figure out what might be wrong there: i am pretty clueless.
Is there a difference if i delete all the three partitions and create them again (say with gparted)
and the usage of dd?
 
Old 02-11-2011, 07:46 PM   #12
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 172
Blog Entries: 5

Rep: Reputation: 17
Don't know if it helps...
Try to REINSTALL the FreeBSD bootcode onto your MBR (using FreeBSD Fixit DVD and following the procedures well decribed in many places), then copy it with dd utility, after which you can fearlessly overwrite that MBR with your GRUB installation, and your copied bootcode of MBR will do the job to boot into the FreeBSD bootloader.
Code:
dd if=/dev/sdb of=/boot/sdb.mbr bs=512
Thus I saved it into the /boot/sdb.mbr on the same partition where GRUB files were installed.
Then you can use a "chainloader" directive in /boot/grub/menu.lst:
Code:
root (hd1,8)
chainloader (hd1,4)/boot/sdb.mbr
where (hd1,8) is the FreeBSD partition, and (hd1,4) is where the GRUB's own files reside, there I also placed the MBR bootcode copy.
Or maybe you need to supply the FreeBSD root partition? Like
Code:
rootnoverify (part/slice)
Not sure which will work.
For me the above works, but I'm using a GPT disk with FreeBSD root partition on (hd1,8).
On the other hand, from my experience I know, that once you boot into the FreeBSD bootloader, it will not care what root device you gave to GRUB. And if confused, it will prompt you for root device anyway!!

A! Don't forget to reinstall GRUB and overwrite your FreeBSD made MBR after you're done with the FreeBSD bootcode - hope you know how to do that?

Hope this trick will work for you just like it worked for me several times.

Last edited by kostya; 02-11-2011 at 07:47 PM.
 
Old 02-11-2011, 07:50 PM   #13
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 172
Blog Entries: 5

Rep: Reputation: 17
Yeah, I just noticed the date... anyway, the trick works fine and may be helpful to others
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grub2 boot from .img bforbes Linux - General 2 12-06-2010 06:24 PM
[SOLVED] Editing the grub2 boot menu in a dual boot machine Chriscrof Linux - Newbie 13 07-15-2010 02:14 AM
GRUB2 - FreeBSD-8.0 does not show up in triple boot menu, dual boot menu it does.. wiliweld *BSD 7 05-03-2010 02:05 PM
[SOLVED] How to get Grub2 to boot OS X with Graphics Mode boot option PaulFXH Linux - General 3 04-17-2010 04:58 AM
Grub2 and iso boot ---- Again niravshah Linux - Newbie 6 09-18-2009 04:32 PM


All times are GMT -5. The time now is 11:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration