PDA

View Full Version : [SOLVED] sabayon fried my bootloader



Chymera
September 21st, 2007, 08:00 PM
ok, so i wanted to install sabayon on my "safe" pc (the one i dont experiment on), figuring that i know how to use sabayon well enough to stay clear of any trouble...

WRONG!
During the installation i added my ubuntu as my default boot option, and probably got the path wrong or something like that; since booting sabayon works fine, but booting ubuntu gives the following output:


rootnoverify (hd0,1)
chainloader +1
Error 13: Invalid or unsupported executable format
My ubuntu installation is still intact, so the bootloader is the only problem. I just followed a guide from the forums on how to reinstall your grub from a livecd, and guess what, nothin happened.

rsambuca
September 21st, 2007, 08:06 PM
You need a line that says 'title' above the root line. You probably don't need the rootnoverify either. I just use root for chainloading distros.

Chymera
September 21st, 2007, 08:09 PM
say what?

..... so what exactly should i do to get this up and running again, i know how to edit the sabayon grub entries.... but didnt quite understand what you said i should add

rsambuca
September 21st, 2007, 08:16 PM
OK, post your grub.conf and we'll figure it out.

Chymera
September 21st, 2007, 08:20 PM
voilą

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,2)
# kernel /boot/kernel-genkernel real_root=UUID=cdab712a-5058-4f37-b7c5-8128e5047950
# initrd /boot/initramfs-genkernel
#boot=sda
default=1
timeout=6
splashimage=(hd0,2)/boot/grub/splash.xpm.gz
title Sabayon Linux x86-64 3.4
root (hd0,2)
kernel /boot/kernel-genkernel-x86_64-2.6.22-sabayon root=/dev/ram0 ramdisk=8192 real_root=UUID=cdab712a-5058-4f37-b7c5-8128e5047950 quiet init=/linuxrc splash=silent,theme:sabayon vga=791 CONSOLE=/dev/tty1 pci=nomsi
initrd /boot/initramfs-genkernel-x86_64-2.6.22-sabayon
title Ubuntu
rootnoverify (hd0,1)
chainloader +1
title Other
rootnoverify (hd1,0)
chainloader +1

Chymera
September 21st, 2007, 09:07 PM
soooo....?

yabbadabbadont
September 21st, 2007, 09:14 PM
Do you plan to keep using Sabayon on that machine? If so, boot Sabayon then mount your ubuntu partition. Look at the menu.lst in the boot/grub directory of your mounted ubuntu partition. Copy the first entry from that file and add it to your grub.conf (or menu.lst whichever sabayon uses) in your Sabayon's /boot/grub directory.

If you don't wish to keep Sabayon, post the output of running "fdisk -l" and tell us which of the listed partitions contains your ubuntu system.

floke
September 21st, 2007, 09:16 PM
In Sabayon, or a live CD, mount your ubuntu partition and copy the grub/menu.lst part over to your Sabayon grub file.

eg:

1) mkdir /home/yourname/Desktop/here
2) sudo mount /dev/hda2 /home/yourname/Desktop/here

Then scoot through the 'here' folder to the /boot/grub/menu.lst file -- and copy the relevant stanza over.

Kingsley
September 21st, 2007, 09:22 PM
Try changing the Ubuntu section to this:


title Ubuntu, kernel 2.6.20-16-generic
root (hd0,1)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=cdab712a-5058-4f37-b7c5-8128e5047950 ro quiet splash
initrd /boot/initrd.img-2.6.20-16-generic
savedefault
Make sure you save backups of Grub before you take anyone's advice.

Chymera
September 21st, 2007, 09:23 PM
ok hope this works....

rsambuca
September 21st, 2007, 10:29 PM
Sorry, I had to run out.

I see you are taken care of. Depending on which OS you want to keep as your main distro, you might consider resetting grub and chainloading the other distro, but these ideas will also work. You will have to manually update the grub.conf with every kernel change, though.

Chymera
September 22nd, 2007, 07:34 PM
Ok, 10x very much for your quick and competent interventions, if anyone else encounters similar problems here's what to do:

copy the ubuntu entry from the menu.lst in your ubuntu to the menu.lst in your sabayon, delete the lines "quiet" and "savedefault", reboot, and voilą! unfried bootloader :)

yabbadabbadont
September 22nd, 2007, 08:23 PM
Re-reading this, I just realized that a simpler solution would be to reinstall grub in ubuntu, but instead of to the MBR, it should be installed to ubuntu's root partition. Then the "chainloader" command used in the Sabayon grub.conf would simply load up ubuntu's grub installation. This has the advantage that you wouldn't have to keep updating the Sabayon grub.conf file after every ubuntu kernel upgrade. Just FYI. :)

lewac
September 22nd, 2007, 09:11 PM
yep IF the partition of ubuntu is in fact on (hd0,1) this oughta work. however IF there is an alternate PRIMARY partition on this drive (or THIS happens to be a primary one) one should add the following command right after the root command:

root (hd0,1)
# unhide the partition...
makeactive
kernel ...

because if the thing is NOT active its not gonna boot even IF you're pointing to the correct installed partition.

in fact

Chymera
September 29th, 2007, 10:49 PM
Re-reading this, I just realized that a simpler solution would be to reinstall grub in ubuntu, but instead of to the MBR, it should be installed to ubuntu's root partition. Then the "chainloader" command used in the Sabayon grub.conf would simply load up ubuntu's grub installation. This has the advantage that you wouldn't have to keep updating the Sabayon grub.conf file after every ubuntu kernel upgrade. Just FYI. :)

ok, this sounds interesting, especially since there's gonna be a kernel upgrade pretty soon i suppose.... so how do i revert from my method to yours?
also, i noticed that i had 2 boot entries for ubuntu when i still had its bootloader: a -15 kernel and a -16 kernel ... do i get a new boot entry for each kernel upgrade? cant i just tell the mbr to link to ubuntu's bootloader? i mean it's still there isnt it?