# Problem with GRUB after installing FreeBSD 8.2



## marcinnn (Oct 3, 2011)

Hi,

I have weird problem with GRUB 1.99 after installing  FreeBSD (8.2). I has disk with linux-swap partition and Ubuntu 11 on ext4 and everything was ok. Then I installed FreeBSD and I selected option with no installing boot manager. However I'm logged to grub rescue shell and I'm not able to fix it. I started Ubuntu form cd, I chrooted to Ubuntu on disk, and even reinstalling Grub didn't helped. It helps only when I remove FreeBSD. When I removed it, Grub reinstall helps but when I'm installing FreeBSD the problem is coming back again. What is going on?

Thanks in advance for help!


----------



## Beeblebrox (Oct 5, 2011)

Not a lot of info re your grub setup, so I will just have to comment from certain assumptions - ask if for clarification if your setup is different or if my assumptions are wrong.

1. You probably have a separate partition for grub or /boot from your Ubuntu install.  In Ubuntu this will mount under /boot.  You SHOULD NOT do the same for your FreeBSD install and you should mount the grub partition elsewhere (like /grub for example). FreeBSD's /boot ad Ubuntu's /boot (which has grub) will not mix and will not work together.

2. If you are getting a "grub rescue" prompt when you boot up your PC, that means grub has done it's job and that your problem is not a grub or "boot loader" from FreeBSD problem - it is a config file problem.

3. Here's what I assume you did: After you got Ubuntu working nicely, you installed FreeBSD, but placed the grub partition (/boot in ubuntu) as /boot in FreeBSD. This wiped out the /boot/grub folder in the partition and copied FreeBSD files WITHOUT installing the freeBSD Boot Loader (BTX). So you end up in never-land.

4. Solution: Install FreeBSD, BUT keep /boot on FreeBSD's root. Then you can edit the grub menu (or latest grub version should detect on its own) so that you have "chainloader +1" which passes boot control to FreeBSD internals.


----------



## marcinnn (Oct 5, 2011)

Thanks for your reply.

You are asking about grub configuration. I have two disks /dev/sda and /dev/sdb (from linux point of view) and while installing I choose option to install grub on /dev/sdb (not on /dev/sdb2 or something). Rest is done automatically by grub. Grub installation files are on /dev/sda2 on /boot/grub. 

On /dev/sdb I have 3 partitions: 
/dev/sdb1 with linux-swap
/dev/sdb2 with Ubuntu on ext4
/dev/sdb3 with FreeBSD and its partitions.

1. I described my Grub installation. I'm not sure if it's ok when I'm reading this point.
2. Problem occurs before grub starts. Ok there is an rescue shell but I don't have any menu to choose system or anything like that. It also cannot be just a config problem cause when I remove installation with config files (aptitude purge) and reinstall package again I still have this problem and I have even problems while I'm installing Grub. These problems disappears when I remove FreeBSD partition.
3 and 4. I don't get it. If I have Grub on /boot/ on sdb2 filesystem and FreeBSD with its partitions (I chose automatic partitioning) with something like /dev/sdb3a1 mounted on /boot then it may cause a problems with Grub starting? 

Ppl, how it works on your computers? Maybe the simplest solution will be just installing grub from FreeBSD ports on /dev/sdb3 or maybe I should try to use FreeBSD boot loader and configure it for loading FreeBSD, Ubuntu and Windows 7.


----------



## marcinnn (Oct 8, 2011)

Non of you use Grub2? All of you are using FreeBSD only?


----------

