# Grub2 fail to boot



## tangi (Apr 22, 2013)

I'm facing this issue when booting FreeBSD 9.1-RELEASE i386.

```
error: address 0x65000 is out of range.
error: no loaded kernel.

 Failed to boot both default and fallback entries.

Press any key to continue...
```

Here is the content of grub.cfg:

```
# install grub
GRUB_HIDDEN_TIMEOUT=0
GRUB_DEFAULT=0
GRUB_TIMEOUT=0
set timeout=0
set default=0
menuentry "FreeBSD 9.1" {
        insmod ufs
        set root=(hd0,1)
        kfreebsd /boot/kernel/kernel
        kfreebsd_loadenv /boot/device.hints
        set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ad0s1
        vfs.root.mountfrom.options=rw
        boot
}
```
*T*hanks.


----------



## Beeblebrox (Apr 22, 2013)

When the GRUB boot menu comes up, hit "c" for the GRUB command-line, then:
[CMD=>]insmod ufs[/CMD]
[CMD=>]ls[/CMD]
This should list the partitions visible to GRUB, including the UFS slices. You should then modify these two (use the info from the ls output) as something like:

```
set root=(hd0,1a)
set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ad0s1a
```


----------



## tangi (Apr 22, 2013)

*T*hank you, @Beeblebrox. *H*ave you tried to boot version 9.1 i386 with GRUB? What is strange is that I had no issue with the amd64 version.

I run this command: `grub> kfreebsd /boot/kernel/kernel`


```
error: address 0x65000 is out of range.
```


----------



## nox@ (Apr 22, 2013)

Is this GRUB 2.00?  If not it may not work and if yes it may need this bugfix patch cherrypicked from GRUB bzr:  (Yes this was about >= 9.1/amd64 but maybe i386 is affected too...)

http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/4556

See also:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=699002

If you installed GRUB2 via FreeBSD ports (sysutils/grub2) and not from Linux try the update in this PR:

http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/170417

HTH, 
Juergen


----------



## Beeblebrox (Apr 22, 2013)

@tangi: Try to boot via FreeBSD's BTX loader - add menu item as:

```
title FreeBSD 
      set root (hd0,1,a)
      kernel /boot/loader
```
You will see that if you set root as (hd0,1,a) you will get the BTX prompt, but if your menu entry is (hd0,1) you will most likely get an address error. Your menu entry is not addressing the FreeBSD partition scheme (a,b,c,etc.) What is the output of ls from the GRUB menu?

@Juergen: Hi - I think the problem is that he is using MBR partition but addressing it ambiguously - either GRUB <2, >2 should work into the BTX loader. But even the "direct boot" method should work regardless of GRUB version on a UFS slice IMHO.


----------



## tangi (Apr 23, 2013)

@Beeblebrox: output of `ls` is 

```
grub> ls
(hd0) (hd0,1)
grub> ls (hd0,1)/
COPYRIGHT bin/ boot/ dev/ ...
```
I'm using MBR partitioning without BSD label (disklabel). As I said early it's working fine on amd64 version. I will try what @nox@ and you suggested.


----------

