5

I'm trying to fix a problem with a new installation. I'm running this existing distro (Ubuntu) from /dev/sdb with a new OS, Gentoo, installed on /dev/sda. I'm glad I took the trouble of setting these up on different disks because I can't boot into the new OS. All I get is grub error 15 "File not found". It also gives the UUID which I have verified is correct:

sudo blkid
/dev/sda1: LABEL="boot" UUID="b891774a-0b2d-4ab4-bcfa-23a11a97cae5" TYPE="ext2" 
/dev/sda2: UUID="fc34999a-e85d-4c7b-8775-30510eb4c396" TYPE="swap" 
/dev/sda3: LABEL="main" UUID="65a90a0d-a651-4215-8552-0c1859ab61dd" TYPE="ext4"

The menu.lst (on /dev/sdb) for the new OS is

title Gentoo Linux 3.10.7-r1
uuid b891774a-0b2d-4ab4-bcfa-23a11a97cae5
#root (hd0,0)
kernel /kernel-3.10.7-gentoo root=UUID=65a90a0d-a651-4215-8552-0c1859ab61dd

I also tried

kernel /boot/kernel-3.10.7-gentoo root=UUID=65a90a0d-a651-4215-8552-0c1859ab61dd

but since the UUID goes directly to the boot partition I think this is wrong.

The kernel should be correct; if I mount dev/sda1 and ls I see

grub  kernel-3.10.7-gentoo

Any ideas what I'm doing wrong? It might be very basic; I've only been using Linux for a few years and never Gentoo except for a few days in a chroot.


I should mention I also have grub2 installed on dev/sda1 though I don't get as far there: it just shows the grub 'command line'.

Charles
  • 279
  • 1
  • 3
  • 17
  • In which order did you installed gentoo/ubuntu? – Braiam Apr 26 '14 at 03:24
  • @Braiam: I installed Ubuntu first (years ago) and I've been trying to get Gentoo working for a few months now. It runs fine in a `chroot` but I can't get it to boot, either from its own grub2 or from Ubuntu's grub-legacy. – Charles Apr 26 '14 at 23:57

4 Answers4

3

I think, the problem is with root (hd0,0). You said that this is a sdb, so try uncoment your root... and set it to root (hd1,0)

Artur Szymczak
  • 1,913
  • 12
  • 12
2

It looks like you are using grub-legacy on ubuntu and this is the bootloader used at boot.

This error is returned if the specified file name cannot be found, 
but everything else (like the disk/partition info) is OK.
Frequently, the error notes a missing kernel image file. 
Make sure that the file it is referring to exists on your boot partition. 

The following is incorrect, you need to define a partition to boot from (using root parameters). Here root is commented out.

uuid b891774a-0b2d-4ab4-bcfa-23a11a97cae5
#root (hd0,0)

Remove the uuid entry and uncomment root (hd0,0).

If the gentoo kernel is not on /dev/sda1, then you need to change (hd0,0) to the correct partition or copy the kernel there.

If the gentoo kernel is present in /dev/sda1 then you need to confirm what grub is used. Since you are booting on MBR on sdb, I wonder what the BIOS is seeing the drives as. What is the root hdX for the ubuntu, is it (hd1,0) ?

Since you have installed grub2 on Gentoo, you could maybe use it.

 # Gentoo entry in menu.lst ( in Ubuntu)
 title Gentoo
 root (hd0,0)
 kernel /boot/grub/core.img

https://wiki.gentoo.org/wiki/GRUB_Error_Reference#Grub_Error_15

UnX
  • 821
  • 5
  • 8
2

I agree to the points about the error by @rMistero. So now the grub boot from mbr and partition boot record but can't load the basic modules because they can't find it on the expected place (/boot/grub) of that partition. So reinstalling grub will fix that and the best solution is to boot to Gentoo the owner OS of grub legacy (Am I right ?), and reinstall grub.
As you have grub2 available run the following commands 1 by 1 from the grub2 prompt.

set UUID=65a90a0d-a651-4215-8552-0c1859ab61dd

search -u $UUID --set=root
linux /kernel-3.10.7-gentoo root=UUID=$UUID
boot

In case it doesn't work give the output of above commands and this one search -u $UUID and search -l main. Also tell the version of Ubuntu and Gentoo, number of storage devices, OS installed on each storage device, whether Windows installed

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
totti
  • 1,464
  • 14
  • 15
  • None of `set`, `search`, or `linux` were commands it could find, and it asked me to load the kernel before attempting to `boot`. Ubuntu is 14.04 (trusty), Gentoo is 3.10.7. Gentoo is installed on sda (hd0,0), Ubuntu on sdb (hd1,0). There are lots of partitions on sdb but just the basic three (boot, swap, balance) on sda. Windows has never been installed on any drive. – Charles Apr 29 '14 at 03:04
0

As for grub2 you may generate correct grub.cfg issuing following command:

grub2-mkconfig -o /boot/grub2/grub.cfg

It will pick up your kernels and put them into config using templates from /etc/grub.d/ and config file /etc/default/grub. Don't forget to write correct MBR with grub2-install