View previous topic :: View next topic |
Author |
Message |
sardonick n00b
Joined: 01 Sep 2013 Posts: 1
|
Posted: Sun Sep 01, 2013 8:20 pm Post subject: help getting grub2 to boot debian |
|
|
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 |
|
|
quilosaq Veteran
Joined: 22 Dec 2009 Posts: 1520
|
Posted: Sun Sep 01, 2013 9:53 pm Post subject: Re: help getting grub2 to boot debian |
|
|
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 |
|
|
ryo-san l33t
Joined: 17 Feb 2005 Posts: 729
|
Posted: Mon Sep 02, 2013 11:32 pm Post subject: Re: help getting grub2 to boot debian |
|
|
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 |
|
|
|