Thursday, January 22, 2009

Grub voodoo error no 13/24 and how do i fixed it

It all started by an reboot then the error i saw was

24 : Attempt to access block outside partition
This error is returned if a linear block address is outside of the disk partition. This generally happens because of a corrupt filesystem on the disk or a bug in the code handling it in GRUB (it's a great debugging tool).

What i did next was to boot from an Jaunty jack live cd and i have checked the partition
with fsck -pf -v /dev/sda1
no errors

Next i chroot-ed and tried to reinstall the kernel 2.6.28 from ubuntu repository
$ sudo su
$ mount /dev/sda1 /mnt
$ mount --bind /dev /mnt/dev
$ mount --bind /dev/pts /mnt/dev/pts
$ mount --bind /dev/shm /mnt/dev/shm
$ mount -t proc none /mnt/proc
$ mount -t sysfs none /mnt/sys

and then dpkg -i

no result after booted i was greeted with error no 13

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).

So i did an grub recovery
$ grub
$ grub> root (hd0,0)
$ grub > setup (hd0)
$ grub > exit

rebooted and no change
so i have booted the livecd again and did the chroot from above
and then i did an grub install

$ sudo grub-install /dev/sda --root-directory=/ --recheck

and seems that it changed the device.map
from hda to sda

cat /boot/grub/device.map
(fd0) /dev/fd0
(hd0) /dev/sda

rebooted and all was ok after that

No comments: