Dualboot FreeBSD / Linux

Hello,
Last night I installed Ubuntu on a second slice that I have available. Of course I lost the boot of FreeBSD, and impossible to add in Grub2.
I don't know what to do ....
I find no way to get the dual boot FreeBSD / ubuntu ...: (

Can you tell me what are the solutions?

Code:
thialis@Yunix:~$ sudo fdisk -l
[sudo] password for thialis: 

Disque /dev/sda: 640.1 Go, 640135028736 octets
255 têtes, 63 secteurs/piste, 77825 cylindres
Unités = cylindres de 16065 * 512 = 8225280 octets
Taille de secteur (logique / physique)*beep*: 512*beep*octets / 512*beep*octets
taille d'E/S (minimale / optimale)*beep*: 512*beep*octets / 512*beep*octets
Identifiant de disque : 0xa8a8a8a8

Périphérique Amorce  Début        Fin      Blocs     Id  Système
/dev/sda1   *           1       52217   419430280+  a5  FreeBSD
La partition 1 ne se termine pas sur une frontière de cylindre.
/dev/sda2           52217       77826   205701121    5  Etendue
/dev/sda5           52217       52903     5506048   82  Linux swap / Solaris
/dev/sda6           52903       53510     4881408   83  Linux
/dev/sda7           53511       77826   195311616   83  Linux


[ do not post in any language other than English - read the forum rules - Mod. ]
 
You should be able to add FreeBSD booting to Grub2 if you RTFM...

Otherwise, find a way of getting boot0 installed into your disk's MBR. You'll need a bootable FreeBSD USB stick, or another FreeBSD system into which you can put your disk. Use boot0cfg(8).

Of course that might render your linux unbootable. If it does, you'll need to get Grub installed into your linux's boot partition rather than the disk's MBR...
 
The problem is that I no longer have access to FreeBSD, I'm stuck on linux (ubuntu) ..
I try many things to add to grub2 FreeBSD but to no avail: (
 
upgrade-grub and addd the lines suggested in /boot/grub/grub

@thialis: If you have access to ubuntu, you may already have a grub2 installed. So from the ubuntu partition, run '[cmd="update grub"]update-grub[/cmd]' which shall detect FreeBSD partition also if you installed grub in mbr.

Else, add the following at the end of the /boot/grub/grub.cfg in the custom section:

Code:
menuentry 'FreeBSD' --class os {
    set root='(hd0,1)'
    chainloader +1
}

Replace necessary parameters like HDD. From what I see from your partition table I feel, the above may work.

But don't forget to backup a copy of the working grub.cfg file because it will get replace once you do the [cmd="upgrade-grub"]upgrade-grub[/cmd] again in the future.

Hope it helps.


*** If any of my posts helped you, please contribute to either http://www.freebsdfoundation.org/donate/ or http://www.thehumanape.org/. Appreciate it! Thanks for your understanding! ***
 
thialis said:
The problem is that I no longer have access to FreeBSD, I'm stuck on linux (ubuntu) ..
I try many things to add to grub2 FreeBSD but to no avail: (

Are you unable to load a DVD with FreeBSD on it?
 
It's good, Actually it was easy to re-boot with the CD of FreeBSD.
I am now on BSD, what is the best solution for to add Ubuntu to boot?
Install grub on FreeBSD ?
 
FreeBSD's BTX loader is not so good with dual-boot problems. Grub and other dedicated boot-loader software are much better at it - BTX will not be able to boot other O/S so your best bet is grub.

I assume your root on FreeBSD is on UFS, which is solvable with grub, whereas if root is on zfs grub has some problems. If your freeBSD is on UFS, zennybsd gave you the correct answer for your grub menu. Edit your grub.cfg and try it - keeping in mind the correct hdd mapping (hd0 - hd1 - etc) and the correct partition number mapping (gpt2 - gpt3 - etc)

Alternatively, install grub from ports in FreeBSD and run:
# grub-install
# grub-mkconfig
But I would advise you study the internal commands of grub a little so you can get an idea of how it works. As a plus grub has the ability to boot iso (loopback) files directly...
 
FreeBSD's BTX loader is not so good with dual-boot problems. Grub and other dedicated boot-loader software are much better at it - BTX will not be able to boot other O/S so your best bet is grub.
mating1.jpg

mating2.jpg

mating3.jpg
 
Back
Top