27f82
![]() |
|
|
|
|
|||||||
| General General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
hi.
i have a box that has both debian (sid) and freebsd-8-beta2. i let debian own the bootsector and use grub to access either system. with grub1, this works fine debian has updated to grub2 and i am having some problems getting freebsd to work with it. i use this entry: Code:
menuentry "freebsd 8.0" {
set root=(hd0,2,a)
freebsd /boot/loader
}
any ideas? |
|
#2
|
||||
|
||||
|
It looks like they're not using savanna anymore to track bugs. I can't find any reference to what bug tracking they're currently using though.
So you may want to drop the developers a note, they can probably point you in the right direction.
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. |
|
#3
|
|||
|
|||
|
Have you tried dropping the 'a' and using chainloader +1?
Code:
menuentry "freebsd 8.0" {
set root=(hd0,2)
chainloader +1
}
Last edited by DutchDaemon; August 7th, 2009 at 23:56. Reason: [code] added |
|
#4
|
|||
|
|||
|
Yes, the partition numbering apparently changed from grub1 to grub2, it's apparently no longer indexed to 0, so that partition probably doesn't exist at all as far as grub is concerned. I'd try changing it to read:
Code:
menuentry "freebsd 8.0" {
set root=(hd0,3,a)
freebsd /boot/loader
}
|
|
#5
|
|||
|
|||
|
There's no "freebsd" command counterpart to the "linux" command used only for loading a Linux kernel, not a BSD one. So you have to chainload FreeBSD's bootloader.
The correct form's as following: Code:
menuentry "freebsd 8.0" {
set root=(hd0,2,a)
chainloader +1
}
Last edited by DutchDaemon; October 20th, 2010 at 12:29. |
|
#6
|
|||
|
|||
|
Ok, I've just downloaded and not yet installed FreeBSD; but one thing is: in grub2 default (and I'm assuming debian but not sure) drive numbering starts on 1. so your /dev/sda2 [(hd0,2) in grub legacy] will be (hd1,2) now. Thought that may be it.
|
|
#7
|
||||
|
||||
|
Not quite right.
In Grub2 drives are still counted from 0 but partitions from 1. So if hd0,5 in Grub1 was for partition#6 (sda6 in linux) that is hd0,6 (sda6) now in Grub2. |
|
#8
|
|||
|
|||
|
hi,
Have you boot your freebsd right now using grub2? if you make it, please let me know. I am struggling with the same problem as you and any howtos is welcome. |
|
#9
|
||||
|
||||
|
What problem? I boot FreeBSD (and OpenBSD) from grub2 having beautiful splash 1280x1024.
This is absolutely correct: Code:
menuentry "FreeBSD 8.0" {
set root=(hd0,1,a)
chainloader +1
}
I assume you run sudo update-grub after inserting the menuentry in /etc/grub.d/40_custom
|
|
#10
|
|||
|
|||
|
Grub2 (1.97~beta4) works fine with BSD. You can do two things:
1) do the traditional BSD 2nd stage loader: Code:
menuentry "FreeBSD ad4, via /boot/loader" {
insmod ufs2
set root=(hd0,1,a)
freebsd /boot/loader
}
Code:
badtrip# /usr/local/sbin/grub-probe -d /dev/ad4s1 -t fs_uuid 4b22f9090565ab77 Code:
menuentry "FreeBSD ad4, direct" {
insmod ufs2
set root=(hd0,1,a)
search --no-floppy --fs-uuid --set 4b22f9090565ab77
freebsd /boot/kernel/kernel
freebsd_loadenv /boot/device.hints
set FreeBSD.vfs.root.mountfrom=ufs:/dev/ad4s1a
set FreeBSD.vfs.root.mountfrom.options=rw
}
|
|
#11
|
|||
|
|||
|
I have a question.
With this thread having at least 3 correct ways to boot FreeBSD, I'm wondering, what's the difference between all of them? I'm trying to boot FreeBSD too, and have tried the simpler-looking one mentioned above, which worked for me: Code:
menuentry "FreeBSD 8.0" {
set root=(hd0,1,a)
chainloader +1
}
Sorry if it's a silly question. I'm new and don't even know what much of the syntax means, such as the "insmod ufs2" or other parts. I feel weird that there isn't just some simple table available online stating what to enter to boot each OS. Last edited by DutchDaemon; January 6th, 2010 at 12:05. Reason: [code], not [quote] |
|
#12
|
|||
|
|||
|
Zero change to performance. OS boot times will be unaffected, but the time taken for the boot loader to do its thing might be affected by its configuration.
|
|
#13
|
||||
|
||||
|
chainloader is the shotgun approach, and will work with any OS that includes a boot loader in the first block of the root partition. Grub doesn't do anything special, just loads the first block, and passes control over to whatever is stored there. This could be boot0 (the FreeBSD boot manager with the F1, F2, F3 menu), /boot/loader (the nice ASCII boot menu), or something else.
The next method is more specific to FreeBSD, and tells GRUB to look into a specific filesystem for /boot/loader, and then run that program, bringing up the nice FreeBSD ASCII boot menu. The last method is even more specific, and tells GRUB to look into a specific filesystem for /boot/kernel/kernel and boots directly into the FreeBSD kernel, by-passing /boot/loader completely. All the extra entries are to pass information to the kernel that is normally done via /boot/loader. Which you use depends on how FreeBSD-specific you want to be, and whether or not you want to see the FreeBSD boot menu(s). |
|
#14
|
|||
|
|||
|
This is the first hit for FreeBSD and grub2, so I thought I'd help out.
- After fighting with grub2 constantly and trying to get my boot completed I finally figured out that the command has changed from freebsd to kfreebsd. freebsd /boot/kernel should bekfreebsd /boot/kernelWho knows if it'll change again, grub2 documentation leaves A LOT to desired, I finally figured this out with a: strings bsd.modShould this change in the future. Last edited by DutchDaemon; January 29th, 2010 at 12:30. |
| The Following 2 Users Say Thank You to jafrey For This Useful Post: | ||
fronclynne (January 29th, 2010), Grey_Ash (January 30th, 2010) | ||
|
#15
|
|||
|
|||
|
Can't really blame anyone but the Debian guys and their whole 'kernel of FreeBSD' side project
.The latest version released a few days ago 1.97.2 uses kfreebsd and it's not just a Debian Package thing. From the changelog: Code:
2009-10-14 Robert Millan <rmh.grub@aybabtu.com> Refer to kernel of FreeBSD "kFreeBSD" to avoid confusion between the Operating System (FreeBSD) and its kernel (kernel of FreeBSD). * loader/i386/bsd.c (grub_freebsd_boot): Read kernel environment from "kFreeBSD" namespace (rather than "FreeBSD"). Update all users. (GRUB_MOD_INIT (bsd)): Rename "freebsd" command to "kfreebsd", "openbsd" to "kopenbsd", "netbsd" to "knetbsd", "freebsd_loadenv" to "kfreebsd_loadenv", "freebsd_module" to "kfreebsd_module", and "freebsd_module_elf" to "kfreebsd_module_elf". Update all users. Code:
cmd_freebsd = grub_register_extcmd ("kfreebsd", grub_cmd_freebsd,
GRUB_COMMAND_FLAG_BOTH,
"kfreebsd FILE", "Load kernel of FreeBSD.",
freebsd_opts);
cmd_openbsd = grub_register_extcmd ("kopenbsd", grub_cmd_openbsd,
GRUB_COMMAND_FLAG_BOTH,
"kopenbsd FILE", "Load kernel of OpenBSD.",
openbsd_opts);
cmd_netbsd = grub_register_extcmd ("knetbsd", grub_cmd_netbsd,
GRUB_COMMAND_FLAG_BOTH,
"knetbsd FILE", "Load kernel of NetBSD.",
netbsd_opts);
|
|
#16
|
|||
|
|||
|
Quote:
I've tried this and others suggestions before, but I can't access to PCBSD 8. The chainloader reload the grub2 ! It's the same if I change (hd0,1,a) with (hd0,0,a) I've seen also this, and this but are too olds.
|
|
#17
|
|||
|
|||
|
Still using lilo (Slackware) to boot FreeBSD:
Code:
# FreeBSD other = /dev/sda3 label = FreeBSD table = /dev/sda Last edited by DutchDaemon; February 13th, 2010 at 21:55. |
|
#18
|
|||
|
|||
|
How to boot FreeBSD 8.0 or PC-BSD 8.0 with grub2:
Code:
menuentry "FreeBSD 8.0 (on /dev/ad0s2)" {
set root=(hd0,2)
chainloader +1
boot
}
|
| The Following User Says Thank You to Goette For This Useful Post: | ||
Elwood (October 4th, 2010) | ||
|
#19
|
|||
|
|||
|
To automatically add the entry when using update-grub don't just edit /boot/grub/grub.cfg but too the script that creates that file. Add to /etc/grub.d/filename this:
Code:
#!/bin/bash
echo "Adding Custom PC-BSD system" >&2
cat << EOF
menuentry "PC-BSD_Unix_KDE" {
set root=(hd0,2)
chainloader +1
boot
}
EOF
Code:
sudo chmod u+x /etc/grub.d/filename https://wiki.ubuntu.com/Grub2 |
|
#20
|
|||
|
|||
|
Quote:
Interestingly, I tried the "kfreebsd" trick mentioned below first, it hung and returned an error on the second line "kfreebsd_loadenv", but not the first. Maybe they changed that again. With grub2, none of the other methods worked for me. With 0.97, almost any example listed here and elsewhere would work. |
|
#21
|
|||
|
|||
|
Quote:
Trying this above, - changed freebsd to kfreebsd - the booting process dropped into the "manual mount point entry" prompt. where, typing "ufs:/dev/ad4s1a" runs fine. - My FreeBSD box was installed in the same way than yours - /I took care about the uppercase letters./
__________________
http://diablotins.davenulle.org/index.php/Accueil http://user.lamaiziere.net/david/Site/ |
|
#22
|
|||
|
|||
|
After reinstalling Xubuntu with the new 10.04 version and searching again to add FreeBSD to the boot menu, this syntax worked for me:
Code:
menuentry "FreeBSD"
{
insmod ufs2
set root='(hd2,1)'
chainloader +1
}
Last edited by DutchDaemon; May 11th, 2010 at 16:08. Reason: added [code] tags |
|
#23
|
|||
|
|||
|
Just to add my two cents to this thread since its first hit on Google for "grub2 FreeBSD".
After hours of reading documentation, googleing, and experimenting with various "menuentry" options I finally discovered solution for my problem. First of all, both ways (via /boot/loader or /boot/kernel) works fine with Ubuntu 10.04. Here are examples: Code:
menuentry "FreeBSD 8.0 via /boot/loader" {
insmod ufs2
set root='(hd1,4,a)'
search --no-floppy --fs-uuid --set 4c0029f407b3cd1d
kfreebsd /boot/loader
}
Code:
menuentry "FreeBSD 8.0 direct" {
insmod ufs2
set root='(hd1,4,a)'
search --no-floppy --fs-uuid --set 4c0029f407b3cd1d
kfreebsd /boot/kernel/kernel
kfreebsd_loadenv /boot/device.hints
kfreebsd_module /boot/splash.bmp type=splash_image_data
set kFreeBSD.vfs.root.mountfrom=ufs:ad6s4a
}
Problem which took me several hours to solve had simple solution (as it always seems simple when solved). Linux /dev/sdc was drive where FreeBSD was installed and I assumed Grub2 sees it as hd2. Terminaly wrong! Grub2 sees it as hd1 which I finally manage to find out in grub command prompt typing "ls (hd1)". hd0 is mapped in linux as /dev/sda and hd2 is mapped as /dev/sdb. @babel17: You can get fs_uuid from Grub2 commad line typing: Code:
ls (hd0,1) |
|
#24
|
|||
|
|||
|
Quote:
Okay, now this one is working better on my side. But, there is still an issue: Most of the tunable knobs ( /boot/loader.conf) are not loaded at boot, doing this way. Here is my /etc/grub.d/40_Custom, for the record: Code:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "FreeBSD, way of shotgun" {
set root=(hd0,1)
chainloader +1
}
menuentry "FreeBSD, boot easy" {
insmod ufs2
set root=(hd0,1,a)
kfreebsd /boot/loader
}
menuentry "FreeBSD, direct boot" {
insmod ufs2
set root=(hd0,1,a)
search --no-floppy --fs-uuid --set 4a86db44195cac47
kfreebsd /boot/kernel/kernel
kfreebsd_loadenv /boot/device.hints
set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ad4s1a
set kFreeBSD.vfs.root.mountfrom.options=rw
}
__________________
http://diablotins.davenulle.org/index.php/Accueil http://user.lamaiziere.net/david/Site/ |
| The Following User Says Thank You to DavidMarec For This Useful Post: | ||
olivier (March 4th, 2012) | ||
|
#25
|
|||
|
|||
|
Yeah, besides changing configuration parse, structure and location, and shortcuts in grub2, I just wonder why they decided to change partition numbering but did not change the disk numbering - this is why I dont like Linux anymore - it has no standard at all.
|
![]() |
| Tags |
| grub2 |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| entry for FreeBSD for grub2 | jalu | Installing & Upgrading | 6 | August 23rd, 2010 13:22 |
| grub2 can't find freebsd on second drive | blwizard | Installing & Upgrading | 1 | May 14th, 2010 18:49 |
| Dualboot Freebsd and Ubuntu 9.10 with Grub2 | skido | Installing & Upgrading | 4 | April 22nd, 2010 07:38 |
| [Solved] dual boot FreeBSD with linux using grub2 | favor | Installing & Upgrading | 22 | January 20th, 2010 14:26 |
| FreeBSD 7.2 LiveCD, FreeBSD 7.2 embedded & GRUB2 for FreeBSD [logical partitions also | Panarchy | General | 24 | August 9th, 2009 19:06 |