Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   Dual-boot with kFreeBSD and Linux cannot find Linux kernel (http://www.linux-archive.org/debian-user/650249-dual-boot-kfreebsd-linux-cannot-find-linux-kernel.html)

David Banks 03-29-2012 08:24 AM

Dual-boot with kFreeBSD and Linux cannot find Linux kernel
 
Hey all,

I am trying to set up a dual-boot machine with Debian kFreeBSD (sid) and
Debian Linux (squeeze). The machine has two hard disks, the first disk
has kFreeBSD on it and I want to use this disk to boot both OSs.
Squeeze is on the second disk. The kFreeBSD partition is UFS and the
Squeeze partition is ext3.

I have successfully installed both distros and wiped grub from the MBR
of the second disk using dd. kFreeBSD boots fine, however I have had
trouble getting a working Grub menu entry for Squeeze. I am using Grub
1.99-18.

People on IRC advised me to use 'os-prober' within kfreebsd, but this
does not give any output and does not create a menu entry for squeeze.
I tried to manually add a menu entry for squeeze as such, within
/etc/grub.d/40_custom:

menuentry 'squeeze' --class debian --class gnu-linux --class gnu
--class os {
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
linux /boot/vmlinuz-2.6.32-5-amd64 root=/dev/sdb1 ro quiet
initrd /boot/initrd.img-2.6.32-5-amd64
}

However, when I boot this I get this error three times:

error: file not found.

Other things I tried:

* Using /dev/hdb1 instead of /dev/sdb1. Same behaviour.
* Copying across a working menu entry from the squeeze install by
mounting the disk in kFreeBSD and pasting it out of /boot/grub/grub.cfg.
This has a lot of extra stuff about UUIDs, but it still had the exact
same problem.
* Quite a few other values for (hd1,msdos1), but none worked.

I also tried going to the Grub command line and playing around a bit.
This was interesting, because I was able to run "set root=(hd1,msdos1)"
and then I could use the 'ls' command to show the contents of the second
hard disk. So it seems that this line should not be the problem. I
could even list and tab complete the name of the kernel file, exactly as
it is in the menu entry, but then if I tried to boot the kernel I would
get the same 'error: file not found' message, even though I had not
changed the name of the kernel file at all.

Cheers,
David


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jl1683$d5e$1@dough.gmane.org">http://lists.debian.org/jl1683$d5e$1@dough.gmane.org

Andrei POPESCU 03-29-2012 09:16 AM

Dual-boot with kFreeBSD and Linux cannot find Linux kernel
 
On Jo, 29 mar 12, 09:24:30, David Banks wrote:
...
> I tried to manually add a menu entry for squeeze as such, within
> /etc/grub.d/40_custom:

Please attach your full /boot/grub/grub.cfg

Kind regards,
Andrei
--
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic

Jon Dowland 03-29-2012 09:38 AM

Dual-boot with kFreeBSD and Linux cannot find Linux kernel
 
On Thu, Mar 29, 2012 at 09:24:30AM +0100, David Banks wrote:
> menuentry 'squeeze' --class debian --class gnu-linux --class gnu
> --class os {
> insmod part_msdos
> insmod ext2
> set root='(hd1,msdos1)'
> linux /boot/vmlinuz-2.6.32-5-amd64 root=/dev/sdb1 ro quiet
> initrd /boot/initrd.img-2.6.32-5-amd64
> }
>
> However, when I boot this I get this error three times:
>
> error: file not found.

Do you have your kernel and initramfs inside the directory /boot on the
root filesystem, or do you have a separate boot partition?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120329093856.GB32743@debian">http://lists.debian.org/20120329093856.GB32743@debian

David Banks 03-29-2012 09:50 AM

Dual-boot with kFreeBSD and Linux cannot find Linux kernel
 
On 29/03/12 10:38, Jon Dowland wrote:
> Do you have your kernel and initramfs inside the directory /boot on the
> root filesystem, or do you have a separate boot partition?

The kernel and initrd are inside /boot on the root filesystem, no
separate boot partition.

Cheers,
David


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jl1ba3$kuf$1@dough.gmane.org">http://lists.debian.org/jl1ba3$kuf$1@dough.gmane.org

David Banks 03-29-2012 10:19 AM

Dual-boot with kFreeBSD and Linux cannot find Linux kernel
 
On 29/03/12 10:16, Andrei POPESCU wrote:
> Please attach your full /boot/grub/grub.cfg

Here is the /boot/grub/grub.cfg. I am installing it with "grub-install
/dev/ad0" in kFreeBSD, which completes successfully.

Correction: I only get the "file not found" error repeated twice now.

Cheers,
David

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}

insmod part_msdos
insmod ufs2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 4f71fd5b806762cc
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
insmod part_msdos
insmod ufs2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 4f71fd5b806762cc
set locale_dir=($root)/boot/grub/locale
set lang=en_GB
insmod gettext
fi
terminal_output gfxterm
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_kfreebsd ###
menuentry 'Debian GNU/kFreeBSD, with kFreeBSD 8.2-1-amd64' --class debian --class gnu-kfreebsd --class gnu --class os {
insmod part_msdos
insmod ufs2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 4f71fd5b806762cc
echo 'Loading kernel of FreeBSD 8.2-1-amd64 ...'
kfreebsd /boot/kfreebsd-8.2-1-amd64.gz
insmod part_msdos
insmod ufs2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 4f71fd5b806762cc
kfreebsd_module_elf /lib/modules/8.2-1-amd64/ufs.ko
set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ad0s1
set kFreeBSD.vfs.root.mountfrom.options=rw
}
menuentry 'Debian GNU/kFreeBSD, with kFreeBSD 8.2-1-amd64 (recovery mode)' --class debian --class gnu-kfreebsd --class gnu --class os {
insmod part_msdos
insmod ufs2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 4f71fd5b806762cc
echo 'Loading kernel of FreeBSD 8.2-1-amd64 ...'
kfreebsd /boot/kfreebsd-8.2-1-amd64.gz -s
insmod part_msdos
insmod ufs2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 4f71fd5b806762cc
kfreebsd_module_elf /lib/modules/8.2-1-amd64/ufs.ko
set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ad0s1
set kFreeBSD.vfs.root.mountfrom.options=rw
}
### END /etc/grub.d/10_kfreebsd ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.

menuentry 'Squeeze' --class debian --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
linux /boot/vmlinuz-2.6.32-5-amd64 root=/dev/sdb1 ro quiet
initrd /boot/initrd.img-2.6.32-5-amd64
}
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

Andrei POPESCU 03-29-2012 10:36 AM

Dual-boot with kFreeBSD and Linux cannot find Linux kernel
 
On Jo, 29 mar 12, 11:19:23, David Banks wrote:
>
> menuentry 'Squeeze' --class debian --class gnu-linux --class gnu --class os {
> insmod part_msdos
> insmod ext2
> set root='(hd1,msdos1)'
> linux /boot/vmlinuz-2.6.32-5-amd64 root=/dev/sdb1 ro quiet
> initrd /boot/initrd.img-2.6.32-5-amd64
> }

Does the ext2 module exist on the kFreeBSD partition (wherever the other
grub modules are, presumably /boot/grub/)?

Is the MBR grub image in sync with the modules (do they come from the
same package version)?

Kind regards,
Andrei
--
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic

David Banks 03-29-2012 10:56 AM

Dual-boot with kFreeBSD and Linux cannot find Linux kernel
 
On 29/03/12 11:36, Andrei POPESCU wrote:
> Does the ext2 module exist on the kFreeBSD partition (wherever the other
> grub modules are, presumably /boot/grub/)?

ls -l /boot/grub/ext2.mod shows that the file is there, with a size of
5892 bytes.

> Is the MBR grub image in sync with the modules (do they come from the
> same package version)?

$ aptitude show grub-pc-bin | grep Version
Version: 1.99-18

$ grub-install --version
grub-install (GRUB) 1.99-18

GRUB menu shows "GNU GRUB version 1.99-18".

Cheers,
David



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jl1f5n$ir5$1@dough.gmane.org">http://lists.debian.org/jl1f5n$ir5$1@dough.gmane.org

Andrei POPESCU 03-29-2012 11:25 AM

Dual-boot with kFreeBSD and Linux cannot find Linux kernel
 
On Jo, 29 mar 12, 11:56:51, David Banks wrote:

[snip no obvious problem]

Sorry, I'm out of ideas. I would suggest, if you don't get any more
suggestions in a few days (say over the weekend) you contact the
kFreeBSD port maintainers (debian-bsd?) or file a bug against grub.

Kind regards,
Andrei
--
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic

Martin Steigerwald 03-29-2012 11:57 AM

Dual-boot with kFreeBSD and Linux cannot find Linux kernel
 
Am Donnerstag, 29. März 2012 schrieb David Banks:
> menuentry 'squeeze' --class debian --class gnu-linux --class gnu
> --class os {
> insmod part_msdos
> insmod ext2
> set root='(hd1,msdos1)'
> linux /boot/vmlinuz-2.6.32-5-amd64 root=/dev/sdb1 ro quiet
> initrd /boot/initrd.img-2.6.32-5-amd64
> }
>
> However, when I boot this I get this error three times:
>
> error: file not found.

What is before the file not found? Does it give a hint as to which file it
did not found? Or what it was trying to do before printing the error
message? I suggest you to lookup whether GRUB 2 can run with more
verbosity if not.


In GRUB console what does

find /boot

find /boot/vmlinuz-2.6.32-5-amd64

find /boot/initrd.img-2.6.32-5-amd64

say?


Also

find /etc/debian_version

find /boot/grub/core.img

find /boot/grub/ext2.mod


On GRUB console does

insmod ext2.mod

work?



If you can´t get it to work easily, then you may try the other way around:
Install GRUB on the Linux side and copy over the menu entry for kFreeBSD
to it.


Ciao,
--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201203291357.48911.Martin@lichtvoll.de">http://lists.debian.org/201203291357.48911.Martin@lichtvoll.de

David Banks 03-29-2012 01:22 PM

Dual-boot with kFreeBSD and Linux cannot find Linux kernel
 
Hi Martin,

On 29/03/12 12:57, Martin Steigerwald wrote:
>> However, when I boot this I get this error three times:
>>
>> error: file not found.
>
> What is before the file not found? Does it give a hint as to which file it
> did not found? Or what it was trying to do before printing the error
> message? I suggest you to lookup whether GRUB 2 can run with more
> verbosity if not.

Nothing -- 'error: file not found' is the first message.

My Grub does not know about 'find', so I'll assume that 'search --file'
works the same for the following commands.

> In GRUB console what does
>
> find /boot

grub> search --file /boot
error: no such device: /boot.

> find /boot/vmlinuz-2.6.32-5-amd64

grub> search --file /boot/vmlinuz-2.6.32-5-amd64
hd1,msdos1

> find /boot/initrd.img-2.6.32-5-amd64

grub> search --file /boot/initrd.img-2.6.32-5-amd64
hd1,msdos1

> find /etc/debian_version

grub> search --file /etc/debian_version
hd0,msdos1 hd1,msdos1

> find /boot/grub/core.img

grub> search --file /boot/grub/core.img
hd1,msdos1

> find /boot/grub/ext2.mod

grub> search --file /boot/grub/ext2.mod
hd1,msdos1

These last two are very confusing because the output should include
hd0,msdos1 -- the kFreeBSD partition -- I presume. No difference if I
run 'insmod ufs2' beforehand.

> On GRUB console does
>
> insmod ext2.mod
>
> work?

This command gives an error, but "insmod ext2" is working.

I was confused by the output above so I tried to boot kFreeBSD from the
GRUB console in the same way. It appears that GRUB cannot see any of
the files in the kFreeBSD partition when testing from the console. But
when I use the menuentry, KFreeBSD boots fine. I typed in the exact
commands from the kFreeBSD menuentry into the console:

grub> insmod part_msdos
grub> insmod ufs2
grub> set root='(hd0,msdos1)'
grub> search --no-floppy --fs-uuid --set=root 4f71fd5b806762cc
error: file not found. (repeat ~25 times)
error: no such device: 4f71fd5b806762cc.
grub> kfreebsd /boot/kfreebsd-8.2-1-amd64.gz
error: file not found.

Cheers,
David


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jl1nnm$oki$1@dough.gmane.org">http://lists.debian.org/jl1nnm$oki$1@dough.gmane.org


All times are GMT. The time now is 03:53 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.