# Configuring grub with Pcbsd



## jigglywiggly (Nov 25, 2009)

Vostro 1310(laptop)
So, I installed pcbsd, installed nicely, I didn't install the bootmanager because then it would take over grub, which has Ubuntu and Windows.

So then I do update-grub, it doesn't see pcbsd... ok then.
(Also note I am on the awful grub2, grub1 I could have solved this myself)

Then I go to /boot/grub(this is on ubuntu) and look for menu.lst, wait there is no menu.lst anymore, it's grub.cnf which is non editable. Ok then I get confused, and just go to grub commandline on bootup:

I know pcbsd is on /dev/sda3 or how grub will see it (hd0,3)

SO I do:
root (hd0,3)
kernel /boot/loader
unknown command 'kernel'

Uh, why doesn't it know what the command kernel is? Well grub2 changed this into a command called linux. I have no idea why the heck they are making my life worse.

So I do linux /boot/loader
error: Invalid magic number






Anyone have any ideas? I'm lost.

Things I have learned: *beep**beep**beep**beep* grub2.


----------



## SirDice (Nov 25, 2009)

Try:

```
os-prober
update-grub
```


----------



## jigglywiggly (Nov 25, 2009)

No luck D:


----------



## jigglywiggly (Nov 25, 2009)

I saw this thread http://forums.pcbsd.org/viewtopic.php?f=1&t=14668
And the last post intrigued me, 


> 50_pcbsd in the directory /etc/grub.d/ and ran update-grub. The contents of the file are:
> 
> cat << EOF
> menuentry "PC-BSD 7.1" {
> ...



However this doesn't look like an executable file, and I tried it, nothing... Is there something more to this? (I changed the hd0 obviously)


----------



## graudeejs (Nov 25, 2009)

Did I saw grub2?
Stick to the good old grub


----------



## jigglywiggly (Nov 25, 2009)

Too late now, or can I go back? Though there is one thing stopping me from going back, when I lose grub(over written), I don't know how to get it back in grub1. Is it the same as this process https://help.ubuntu.com/community/Grub2#Reinstalling GRUB 2


----------



## gnemmi (Nov 25, 2009)

have you tried:


```
title PC-BSD
root (hd0,3,a)
kernel /boot/loader
```

or maybe:


```
title PC-BSD
root (hd0,2,a)
kernel /boot/loader
```

?


----------



## jigglywiggly (Nov 25, 2009)

Where would that go? There is no menu.lst


----------



## gnemmi (Nov 25, 2009)

In grub.cfg .. which seems to replace menu.lst

Have this around .. itÂ´ll come really handy: 

http://grub.enbug.org/CommandList
http://ubuntuforums.org/showthread.php?t=1195275

Hope that helps


----------



## dennylin93 (Nov 25, 2009)

This is my GRUB config:

```
default 0
timeout 5

title Windows XP SP2
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1

title FreeBSD 7.2-RELEASE-p4
rootnoverify (hd0,0)
chainloader +1
```

Windows is on hd1 and FreeBSD is on hd0.


----------



## jalla (Nov 25, 2009)

> I know pcbsd is on /dev/sda3 or how grub will see it (hd0,3)



No, /dev/sda3 is (hd0,2) in grub. Don't now grub2, but in grub this should get you going


```
root (hd0,2)
chainloader +1
boot
```


----------



## jigglywiggly (Nov 25, 2009)

gnemmi said:
			
		

> In grub.cfg .. which seems to replace menu.lst
> 
> Have this around .. itÂ´ll come really handy:
> 
> ...


But, if you do update-grub everything will be lost... (Or if the Linux Kernel changes)


----------



## jigglywiggly (Nov 25, 2009)

jalla said:
			
		

> No, /dev/sda3 is (hd0,2) in grub. Don't now grub2, but in grub this should get you going
> 
> 
> ```
> ...


I don't think that's right, well in grub2 anyway, when I go to command line just to type 
root (hd0,2) it says no such partition.


----------



## jigglywiggly (Nov 25, 2009)

dennylin93 said:
			
		

> This is my GRUB config:
> 
> ```
> default 0
> ...


When you say grub config, I'm going to assume you are talking about grub.cfg (because there are like a lot of grub configs now D:, and not menu.lst)
But isn't the whole reason of grub2 not to edit the grub.cfg? I don't know, but I'll try that.


----------



## jigglywiggly (Nov 25, 2009)

Ok so I just edited the grub.cnf

and I did something  and t works I will post back what I wrote, because once I do grub-update it will dissapear D:


----------



## jigglywiggly (Nov 25, 2009)

Ehhh... the installer detected the 8400mgs but I noticed the windows were lagging a bit, so I thought nvidia drivers were not isntalled so I got to ports and try to install nvidia-drivers, but it says it's only for i386, not amd64... You're kidding right, there are no 64bit video drivers?


----------



## gnemmi (Nov 25, 2009)

nope ...
there are a lot of threads and info on google about that ...
the only official nvidia drivers for FreeBSD are the i386 ...
the only thing close to the amd64 official nvidia drivers have been rumors ... nothing else


----------



## jigglywiggly (Nov 25, 2009)

gnemmi said:
			
		

> nope ...
> there are a lot of threads and info on google about that ...
> the only official nvidia drivers for FreeBSD are the i386 ...
> the only thing close to the amd64 official nvidia drivers have been rumors ... nothing else



Bah, time to install 32 bit


----------



## tangram (Nov 25, 2009)

gnemmi said:
			
		

> nope ...
> there are a lot of threads and info on google about that ...
> the only official nvidia drivers for FreeBSD are the i386 ...
> the only thing close to the amd64 official nvidia drivers have been rumors ... nothing else



More than rumours according to NVIDIA 64-bit FreeBSD Beta Driver By Year's End.


----------



## jigglywiggly (Nov 26, 2009)

Oh and for anyone who wonders this is what my grub2 loader looks like, works fine:


```
insmod ufs2
root (hd0,3)
chainloader +1
```


----------



## stuckinoregon (Nov 28, 2009)

Try this URL. http://old.nabble.com/Dual-Booting-Ubuntu-Linux---FreeBSD-using-the-new-Grub2-td26154525.html

It explains the process. Hopefully you haven't already pooched you grub.d


----------

