Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
help getting grub2 to boot debian
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
sardonick
n00b
n00b


Joined: 01 Sep 2013
Posts: 1

PostPosted: Sun Sep 01, 2013 8:20 pm    Post subject: help getting grub2 to boot debian Reply with quote

I'm having trouble getting grub2 to boot my debian installation.

my partition table looks like this:


Device Boot Start End Blocks Id System
/dev/sda1 2048 716802047 358400000 83 Linux <---Debian 7.1
/dev/sda2 961062910 976771071 7854081 5 Extended <---unallocated
/dev/sda4 716867584 961060863 122096640 83 Linux <----Gentoo
/dev/sda5 961062912 976771071 7854080 82 Linux swap / Solaris <---swap

Before I installed Gentoo I had Debian installed on the whole hard disk. Debian was using grub2.

The unallocated partition was a 32mB partition I intended to use as a boot partition when installing Gentoo, but couldn't get it to work.
I wiped that partition using gparted and installed gentoo and its boot on sda4. I installed grub2 in the Gentoo installation.

Now when I boot my computer the Gentoo grub2 screen boots.

I've looked over the grub2 manual and this guide: http://dedoimedo.com/computers/grub-2.html, but haven't been able to correctly add my Debian system to gentoo's grub menu.

I added this script to /etc/grub.d in the Gentoo installation and ran grub2-mkconfig -o /boot/grub2/grub.cfg:

#!/bin/sh -e
echo "Adding debian to GRUB 2"
cat << EOF
menuentry "Debian" {
set root=(hd0,1)
linux /boot/vmlinuz-3.2.0-4-amd64
initrd /boot/initrd.img-3.2.0-4-amd64
}
EOF

There is now an entry for Debian in Gentoo's grub menu, but when I select it the kernel panics.

My /boot folder in the Debian partition looks like this:

-rw-r--r-- 1 root root 129065 Aug 13 18:46 config-3.2.0-4-amd64
drwxr-xr-x 3 root root 4096 Aug 30 19:26 extlinux
drwxr-xr-x 3 root root 12288 Aug 30 19:26 grub
-rw-r--r-- 1 root root 10749526 Aug 30 19:26 initrd.img-3.2.0-4-amd64
-rw-r--r-- 1 root root 176764 Nov 13 2011 memtest86+.bin
-rw-r--r-- 1 root root 178944 Nov 13 2011 memtest86+_multiboot.bin
-rw-r--r-- 1 root root 2107991 Aug 13 18:46 System.map-3.2.0-4-amd64
-rw-r--r-- 1 root root 2835968 Aug 13 18:41 vmlinuz-3.2.0-4-amd64

I also tried running grub-install /dev/sda1. It gave my an error saying /dev/sda1 was an ext2 fs (its ext4) and the install failed.

I'm not sure what to try next. I'm wondering if the Gentoo grub2 treats the sda4 partition its installed on as (hd0, 1), and if I should change the (hd0, 1) in my script to (hd0, -2).

Any help will be appreciated and I'll do my best to provide my information if needed.
Back to top
View user's profile Send private message
quilosaq
l33t
l33t


Joined: 22 Dec 2009
Posts: 763

PostPosted: Sun Sep 01, 2013 9:53 pm    Post subject: Re: help getting grub2 to boot debian Reply with quote

sardonick wrote:
...
I added this script to /etc/grub.d in the Gentoo installation and ran grub2-mkconfig -o /boot/grub2/grub.cfg:

#!/bin/sh -e
echo "Adding debian to GRUB 2"
cat << EOF
menuentry "Debian" {
set root=(hd0,1)
linux /boot/vmlinuz-3.2.0-4-amd64
initrd /boot/initrd.img-3.2.0-4-amd64
}
EOF
...

Try changing linux command with:
linux /boot/vmlinuz-3.2.0-4-amd64 real_root=/dev/dsa1
Back to top
View user's profile Send private message
ryo-san
l33t
l33t


Joined: 17 Feb 2005
Posts: 725

PostPosted: Mon Sep 02, 2013 11:32 pm    Post subject: Re: help getting grub2 to boot debian Reply with quote

sardonick wrote:
...
I added this script to /etc/grub.d in the Gentoo installation and ran grub2-mkconfig -o /boot/grub2/grub.cfg:

#!/bin/sh -e
echo "Adding debian to GRUB 2"
cat << EOF
menuentry "Debian" {
set root=(hd0,1)
linux /boot/vmlinuz-3.2.0-4-amd64
initrd /boot/initrd.img-3.2.0-4-amd64
}
EOF
...


Your are trying to boot on your extended partition which is not a real partition though.
if debian is on first partition then grub must point on hd(0,0)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum