PDA

View Full Version : [ubuntu] 8.04.1 not installing GRUB?



CraigWatson
July 11th, 2008, 09:44 AM
I currently have a laptop I'm using as a workstation partitioned as follows:


[root@scaramouche ~]# fdisk -l

Disk /dev/sda: 59.4 GB, 59468134912 bytes
255 heads, 63 sectors/track, 7229 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x9ae89ae8

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1306 10490413+ 83 Linux
/dev/sda2 1307 3917 20972857+ 83 Linux
/dev/sda3 3918 4178 2096482+ 82 Linux swap / Solaris
/dev/sda4 4179 6031 14884222+ 5 Extended
/dev/sda5 4179 4786 4883728+ 83 Linux
/dev/sda6 4787 6031 10000431 83 Linux

I have Fedora 8 (Werewolf) installed on sda1, Debian 4.0 r1 (Etch) installed on sda5 and a shared /home partition on sda2, plus a shared swap on sda3.

I've installed from the Ubuntu 8.04.1 Desktop CD, created my partition (sda6) layout and completed the install with no problems. I have edited the GRUB menu.lst file (resides on sda1 with Fedora, Debian is chainloaded from Fedora's GRUB) to look like the following:


title Ubuntu 8.04 Hardy Heron
rootnoverify (hd0,5)
chainloader +1

When I boot, it successfully chains to Ubuntu's GRUB and gives me this error:


Error 13: Invalid or unsupported executable format

Now, from the GRUB manual:


13 : Invalid or unsupported executable format
This error is returned if the kernel image being loaded is not recognized as Multiboot or one of the supported native formats (Linux zImage or bzImage, FreeBSD, or NetBSD).

This either means that GRUB can't find the kernel, or the kernel image is corrupted somehow. I've verified the CD both at burntime against the MD5 and at installtime via the disk-check utility on the CD itself.

Here's the weird part. I boot to Fedora, mount the Ubuntu partition, browse to the boot folder and can find no GRUB folder. Even though I specified /dev/sda6 as the GRUB installation partition under Advanced on the Ubuntu installer.

If anyone has any ideas, they would definitely be welcomed. :)

Craig

Herman
July 11th, 2008, 10:18 AM
title Ubuntu 8.04.1 Hardy Heron
root (hd0,5)
chainloader +1 You don't need to use 'rootnoverify', that's only needed for NTFS partitions as far as I know, and might not even be needed for those nowadays.


When I boot, it successfully chains to Ubuntu's GRUB and gives me this error:

Error 13: Invalid or unsupported executable format Now, from the GRUB manual: Quote:

13 : Invalid or unsupported executable format
This error is returned if the kernel image being loaded is not recognized as Multiboot or one of the supported native formats (Linux zImage or bzImage, FreeBSD, or NetBSD). This either means that GRUB can't find the kernel, or the kernel image is corrupted somehow.Or, GRUB has not been successfully installed in the boot sector of the partition.


I've verified the CD both at burntime against the MD5 and at installtime via the disk-check utility on the CD itself.

Here's the weird part. I boot to Fedora, mount the Ubuntu partition, browser to the boot folder and can find no GRUB folder. Even though I specified /dev/sda6 as the GRUB installation partition under Advanced on the Ubuntu installer.Wow! Are you sure? That was a problem back when Hardy Heron was in beta stage, but I haven't seen it since then.
If that's really true then the best thing to do would be to press your 'c' key from your GRUB menu and do a direct boot into Ubuntu. Direct (kernel) Boot (http://users.bigpond.net.au/hermanzone/p15.htm#First_method:_direct_kernel_boot.).
Then, do as advised in post #4 of the following thread, GRUB will not install, LILO will not work (http://ubuntuforums.org/showthread.php?t=753478).
You'll may want to alter that grub-install command to install GRUB to your /dev/sda6 (Ubuntu) partition rather than to MBR.

CraigWatson
July 11th, 2008, 11:53 AM
Herman,
Many thanks for the reply, I have tried everything you suggested but still cannot boot to Ubuntu.

When I do the direct kernel boot, GRUB complains that it cannot find the /initrd.img file. I have also tried running grub-install /dev/sda6 from Fedora with sda6 unmounted, the command seems to run (no errors are reported) but there is still no "/boot/grub" folder on the Ubuntu partition.

I have even tried a fresh install from a USB stick (using the guide provided in the Ubuntu wiki to create the stick.

I'm completely stumped :(

This is the contents of the /boot directory on the Ubuntu install:


[root@scaramouche boot]# ls -la
total 3388
drwxr-xr-x 2 root root 4096 2008-07-02 11:39 .
drwxr-xr-x 21 root root 4096 2008-07-11 11:53 ..
-rw-r--r-- 1 root root 422667 2008-06-18 19:11 abi-2.6.24-19-generic
-rw-r--r-- 1 root root 80049 2008-06-18 19:11 config-2.6.24-19-generic
-rw-r--r-- 1 root root 103204 2007-09-28 11:06 memtest86+.bin
-rw-r--r-- 1 root root 905146 2008-06-18 19:11 System.map-2.6.24-19-generic
-rw-r--r-- 1 root root 1920472 2008-06-18 19:11 vmlinuz-2.6.24-19-generic

Edit
After looking at the directory listing, the symlink in the root of sda6 is broken because there's no .img file within the boot folder - an extremely strange problem :confused:

Herman
July 11th, 2008, 12:32 PM
When I do the direct kernel boot, GRUB complains that it cannot find the /initrd.img file. I have also tried running grub-install /dev/sda6 from Fedora with sda6 unmounted, the command seems to run (no errors are reported) but there is still no "/boot/grub" folder on the Ubuntu partition. No, you have to boot into Ubuntu first, and do 'sudo grub-install /dev/sda6' from inside Ubuntu.
If you do it from withing Fedora, it will refresh Fedora's GRUB files, and install Fedora's GRUB to your Ubuntu partition's boot sector. I don't think that's what you want.

Have you run an md5sum check on your downloaded .iso and run the 'check CD for integrity' test before beginning your install? It does seem very strange indeed that GRUB isn't installing for you.

CraigWatson
July 11th, 2008, 12:43 PM
Have you run an md5sum check on your downloaded .iso and run the 'check CD for integrity' test before beginning your install?


I've verified the CD both at burntime against the MD5 and at installtime via the disk-check utility on the CD itself.

:)

Herman
July 11th, 2008, 01:04 PM
:-k Hmmm, well I don't know then...
What about your hard disk?
Any bad blocks there?

sudo badblocks -sv /dev/sda6
Something must be wrong there somewhere, hopefully we'll be able to find out what it might be in a while.

CraigWatson
July 11th, 2008, 02:20 PM
The badblocks check ran fine and completed with no bad blocks found.

I think the problem is just a missing file - the initrd.img-2.6.24-19-generic file that the /initrd.img symlink refers to is missing, therefore breaking the chain.

The 2.6.24-19-generic modules are present inside /lib/modules, so I'm assuming all I need is the initrd.img file for that specific kernel. I can copy the GRUB files over from my Fedora or Debian installs and just edit the menu.lst once I have that file.

I've tried looking for it online but can't find a download of just the .img file. If anyone can upload that file it would be hugely appreciated!

----------------
Edit

Incidentally, the grub-install /dev/sda6 commands returns this when I run it from the Ubuntu 8.04.1 LiveUSB:

Could not find device for /boot: Not found or not a block device
It doesn't explain the lack of the .img file but it may explain the lack of a GRUB folder - if the installer couldn't run the command then none of the files would be created.

Herman
July 11th, 2008, 10:49 PM
I think the problem is just a missing file - the initrd.img-2.6.24-19-generic file that the /initrd.img symlink refers to is missing, therefore breaking the chain.You have an incomplete installation.
You won't be able to boot without an initrd.img.
You could try running a Ubuntu Hardy Heron Live CD and see if you use Synaptic Package Manager or apt-get in that to try to find initrd.img-2.6.24-19-generic and download it in the live CD somehow and copy it into your Ubuntu file system from there and try again to boot.
I don't know if that will a practical idea or not but it might be worth a try.
Maybe even try copying the kernel and initrd from the LiveCD into the hard disk installed system and see what happens. Look in the /casper directory. All you need to do is get it to boot, then you'll be able to get updates and run commands to fix it from there.
Or boot the live CD and chroot into the hard disk install and run apt-get update and apt-get upgrade, would that work? I would need to test that myself to be sure.

One worry is, if the initrd.img file i s missing, what other files might also be missing that we don't know about yet?
I remember helping someone quite a long time ago who didn't have a /boot/grub directory at all after an installation and it turned out that after creating one and re-installing grub, the rest of the operating system was fine.
Not all incomplete installs would be so lucky though.
Those are a few ideas, I hope something there will be helpful.
Regards, Herman :)

alexicon
September 27th, 2008, 08:58 AM
Herman,
Many thanks for the reply, I have tried everything you suggested but still cannot boot to Ubuntu.

When I do the direct kernel boot, GRUB complains that it cannot find the /initrd.img file. I have also tried running grub-install /dev/sda6 from Fedora with sda6 unmounted, the command seems to run (no errors are reported) but there is still no "/boot/grub" folder on the Ubuntu partition.

I have even tried a fresh install from a USB stick (using the guide provided in the Ubuntu wiki to create the stick.

I'm completely stumped :(

This is the contents of the /boot directory on the Ubuntu install:


[root@scaramouche boot]# ls -la
total 3388
drwxr-xr-x 2 root root 4096 2008-07-02 11:39 .
drwxr-xr-x 21 root root 4096 2008-07-11 11:53 ..
-rw-r--r-- 1 root root 422667 2008-06-18 19:11 abi-2.6.24-19-generic
-rw-r--r-- 1 root root 80049 2008-06-18 19:11 config-2.6.24-19-generic
-rw-r--r-- 1 root root 103204 2007-09-28 11:06 memtest86+.bin
-rw-r--r-- 1 root root 905146 2008-06-18 19:11 System.map-2.6.24-19-generic
-rw-r--r-- 1 root root 1920472 2008-06-18 19:11 vmlinuz-2.6.24-19-generic

Edit
After looking at the directory listing, the symlink in the root of sda6 is broken because there's no .img file within the boot folder - an extremely strange problem :confused:
i have the same problem with my ubuntu 8.04 64 bit install.

new build, all new parts except the 250gb sata drive:
asus maximus ii (p45 chipset)
e8500 3.16ghz core 2 duo
4gb 2x2gb mushkin ddr2 1066
400gb sata
250gb sata
asus 9800gt

fresh install, installation is on the 400gb, on sda3. had to use the ahci bios trick to get the livecd to finish loading. the install seems to complete but X crashes and restarts in a fresh livecd session. no prompt to reboot after the install 'finishes'. when you do reboot off the hdd, you post and pass bios, then you get the message "reboot and select proper boot device....", no grub obviously. bios and the livecd know your drive and the partitions, but without grub its not going to boot.

upon examination of the partitions, most of the install did complete, save for those files missing from /boot (i have the exact same files in my /boot directory). dont know myself if there is anything else missing in the filesystem but like it was said you just need to get the system to boot up once so you can update.