Multibooting under Grub- some questions

After I bit on just Linux I'm coming back to freebsd FreeBSD. I installed it next to my current Debian squeeze and LMDE installs, like so:

Code:
/dev/sda1- bios_boot
/dev/sda2- (linux) /boot
/dev/sda3- linux-swap
/dev/sda4- Debian
/dev/sda5- LMDE
/dev/sda6- FreeBSD
/dev/sda7- nothing
/dev/sda8- (linux) /home
(of course it's slices from freebsd FreeBSD, but you get the point)

The end goal is to have freebsd FreeBSD using the same swap if possible, and most importantly using the same /home mounted as ext2, as I don't think I'm using any of the features in ext4 that make it unmountable as ext2; but that's not for this thread.

So my bootloader (grub-pc) is at version 1.98 in debian squeeze. I can find some info on the web but a lot is outdated and a lot of conflicts, and I've never been quite sure with how grub labels partitions. If I am correct I would put this:

Code:
title  FreeBSD 9.1
root   (hd?,?)
kernel /boot/loader

What do I add for the numbers? is that even correct? Please help.
 
So I added:
Code:
menuentry 'FreeBSD 9.1' {
    set root='(hd0,6)'
    chainloader +1
}

to 40_custom. After running update-grub it shows me 'FreeBSD 9.1' upon enter it says 'invalid signature' 'any key to continue' hitting any key brings me back to the menu. Does anyone know what to do?

EDIT--

I also tried using hd0,5 instead of 6 in case it counts 0, no prize.
 
From the menu entry, it looks like you're using grub2.

If so, I have success with
Code:
chainloader (hd0,6)+1

I remember, many years ago, legacy grub requiring a space before the +1, but I just looked at a laptop with Fedora. I see that I have it the way I've written it above, no space before the plus sign.

Then, if using 40_custom, you have to run, in Debian and Debian based systems
Code:
grub-mkconfig -o /boot/grub/grub.cfg

(I think--I've been using Fedora which uses the command grub2-mkconfig and the path /boot/grub2/grub.cfg)

Not sure if you can use the same swap for Linux and FreeBSD, I'd have to google to confirm that one way or the other.
 
ran both update-grub and grub-mkconfig in that way, no luck. as for chainloader (hd0,6)+1, are you saying do this:
Code:
menuentry 'FreeBSD 9.1' {
    set root='(hd0,6)'
    chainloader (hd0,6)+1
}
?
 
after reading another thread I gave this a shot.

Code:
     menuentry "FreeBSD 9.1" {
                insmod ufs2
                insmod gpt
                set root=(hd0,6)
                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
        }

gives the error 'device 4b22f9090565ab77 not found' and 'command freebsd not found' and 'command freebsd_load_env' not found. not sure what the number in the line search defines though, is it uuid or something?
 
The command chainloader +1 causes GRUB to read and execute the first sector of the specified partition.

Thats if your UFS/BSD slice is on /dev/sda6 (in linux):
/dev/sda1 = hd0,0
/dev/sda2 = hd0,1
/dev/sda3 = hd0,2
/dev/sda4 = hd0,3
/dev/sda5 = hd0,4
/dev/sda6 = hd0,5

Entry which boots FreeBSD into /etc/grub.d/40_custom add:
Code:
menuentry "FreeBSD 9.1" {
  insmod ufs
  set root=(hd0,5)
  chainloader +1
}

Be sure you run:
# grub2-mkconfig -o /boot/grub/grub.cfg

Finally do update-grub from either distro.
 
jrl1357 said:
ran both update-grub and grub-mkconfig in that way, no luck. as for chainloader (hd0,6)+1, are you saying do this:
Code:
menuentry 'FreeBSD 9.1' {
    set root='(hd0,6)'
    chainloader (hd0,6)+1
}
?

Yes, that is what works for me.
 
both scottro's and cpu82s thoughts end with error: invalid signature. I tried both configs with both hd0,5 and hd0,6. Neither worked. I addedinsmod ufs to scottro's and tried both again and neither worked, with the same error, and at times also with error: file not found.
 
Use grub2, instead grub package. Make sure that /dev/sda6 is bootable, add the line "GRUB_DISABLE_OS_PROBER=false" to the end of /etc/default/grub.

Assign execute permissions to /etc/grub.d/40_custom:

# chmod +x /etc/grub.d/40_custom

After check http://forums.freebsd.org/showpost.php?p=56726&postcount=10.

Try making the following changes:
Code:
menuentry "FreeBSD 9.1" {
                insmod ufs2
                insmod bsd
                search --no-floppy --fs-uuid --set=root UUID
                kfreebsd /boot/kernel/kernel
                kfreebsd_loadenv /boot/device.hints
                set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ufsid/UUID
                set kFreeBSD.vfs.root.mountfrom.options=rw
}

Replacing UUID of the disk discovered, run:

# grub-probe -d /dev/sda6 -t fs_uuid

Note that for other distros and GRUB versions, freebsd might have to be changed to just kfreebsd.
 
For what it's worth, though I don't know if this will help. I have found that if I put a space before the +1 in the chainloader line, I get an error. It should be the way I typed it,
Code:
chainloader (hd0,6)+1
and not
Code:
(hd0,6) +1
 
Back
Top