Ubuntu Server 9.10 (karmic): grub2: error: invalid magic number

Bug #487689 reported by Gerry Reno
This bug affects 4 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)

Bug Description

Binary package hint: grub

I installed Ubuntu Server 9.10 (karmic) using text-based installer into a KVM VM. During installation I provided console args after "quiet splash" so that a serial console would work. After installation the hypervisor reboots the VM and reconnects me to domain console. There is no console output.

I boot the VM using the 9.10 iso file and enter rescue mode. The kernel args are fine in grub.cfg but upstart is not configured for a serial console so I configure one. Create a /etc/default/grub file with serial console definitions. Do a 'update-grub' and a 'grub-install /dev/sda' and exit. set hd as boot dev and reboot. The serial console now works but I'm getting this message on console:

error: invalid magic number

  Failed to boot default entries.

Press any key to continue...

Something is obviously wrong with grub2. Is there any workaround to get this system booting?

Revision history for this message
Gerry Reno (greno-verizon) wrote :

Some further info:

/dev/sda5 is /boot which is ext3
/dev/ubuntu-LogVol00 is / which is ext4

Revision history for this message
Gerry Reno (greno-verizon) wrote :

I retried rerunning update-grub and grub-install again. No change. Still cannot boot.

9.10 is looking like a very bad release. Postings of all kinds of serious problems. X freezes, blank screens, no-boot scenarios, no serial consoles in text installs, lots of upgrade issues, broken kvm guests, ... I think I'm going to write this release off as 'toxic'.

Revision history for this message
Gerry Reno (greno-verizon) wrote :

I am using a 200GB VM HDD and my Karmic install in the VM was amd64. I just happened to run across this bug report for Debian which shows same invalid magic number error and talks about Bochs BIOS patch using 32bit computation.


I wonder if that patch is in KVM Bochs BIOS? Or if there is still 128GB limitation. And would that cause the magic number error?

Revision history for this message
nick (nmn1) wrote :

I have xubuntu 9.10 installed with wubi. After regular kernel update (2.6.31-15) grub fail booting default kernel with message "load kernel first". I still can boot system using record for 2.6.31-14 in grub. Grub boot sequence for 2.6.31-14 and are identical (see attachment).

Wubi installs linux into hdd image file which is placed on standard windows filesystem (in my case, ntfs). So linux is booted with loop option (maybe this is the key). I reproduce all booting steps with grub command line and everything is ok until I run
linux /boot/vmlinuz-2.6.31-15-generic root=/dev/sda5 loop=/ubuntu/disks/root.disk ro
which shows me "error: invalid magic number" and fails boot.

Revision history for this message
Miles Lane (miles-lane) wrote :

I have the same symptoms as Nick in comment #4.

I installed Ubuntu 9.10 using Wubi, and then upgraded to Lucid. When I try to boot the Lucid kernel, I get the "Must load kernel first" and then when I disable "screen" I also see the "invalid magic number" error. I am running the amd64 architecture packages on a machine with a SU7300 Intel processor.

This entry works:

menuentry "Ubuntu, Linux 2.6.31-18-generic" {
 insmod ntfs
 set root=(hd0,2)
 search --no-floppy --fs-uuid --set bc1235091234ca62
 loopback loop0 /ubuntu/disks/root.disk
 set root=(loop0)
 linux /boot/vmlinuz-2.6.31-18-generic root=/dev/sda2 loop=/ubuntu/disks/root.disk ro
 initrd /boot/initrd.img-2.6.31-18-generic

/dev/sda2 on /host type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
/dev/loop0 on / type ext4 (rw,errors=remount-ro)

This one fails:

menuentry "Ubuntu, Linux 2.6.32-11-generic" {
 insmod ntfs
 set root=(hd0,2)
 search --no-floppy --fs-uuid --set bc1235091234ca62
 loopback loop0 /ubuntu/disks/root.disk
 set root=(loop0)
 linux /boot/vmlinuz-2.6.32-11-generic root=/dev/sda2 loop=/ubuntu/disks/root.disk ro
 initrd /boot/initrd.img-2.6.32-11-generic

Steve Langasek (vorlon)
affects: grub (Ubuntu) → grub2 (Ubuntu)
Revision history for this message
Phillip Susi (psusi) wrote :

Karmic reached end of life some time ago, are you able to reproduce this on a currently supported release?

Changed in grub2 (Ubuntu):
status: New → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.