[HOWTO:] Making Sabayon a Second OS - Fixing GRUB

Issues Related to Hardware (Sound, Video, Printers, Scanners, Webcams, Touchpads, Keyboards, Sensors, Drives, GRUB, etc.)

Moderator: Moderators

[HOWTO:] Making Sabayon a Second OS - Fixing GRUB

Postby Element » Sun Nov 25, 2007 21:54

So there has been a lot of talk about Sabayon being a second OS, only for people to lose their first OS upon install. So here, lets end all of the crying and whining "Oh crap, I lost my Ubuntu/Arch/Mint install.", and here is a note... if you're dual booting Windows XP/Vista with Sabayon, don't read this article, it doesn't pertain to you, only to those who are wanting more than one Linux installation on the same system with Sabayon (and as far as I know, this will work with Gentoo as well O:)
You'll want to back up your grub.conf, so as a root terminal, do:
Code: Select all
cp /boot/grub/grub.conf >> /boot/grub/grub.conf.original
If you can, try to print out the grub.conf, it'll make life easier on you. Next open grub.conf as a root text editor. Either kdesu kwrite /boot/grub/grub.conf or gksu gedit /boot/grub/grub.conf depending on your Desktop Environment.
Okay this is what your GRUB.conf looks like, or should look like, or maybe doesn't. Who knows, we'll get you all sorted out:
Code: Select all
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /kernel-genkernel real_root=UUID=0ee567ef-085d-4698-865c-f2c2bb3c4339
#          initrd /initramfs-genkernel
#boot=sda
default=1
timeout=6
splashimage=(hd0,0)/grub/splash.xpm.gz
title Sabayon Linux Elemental Edition
   rootnoverify (hd0,0)
   chainloader +1

There's your problem! See that rootnoverify? That is your problem. So clean that crap out and leave everything above rootnoverify alone to make it look like
Code: Select all
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /kernel-genkernel real_root=UUID=0ee567ef-085d-4698-865c-f2c2bb3c4339
#          initrd /initramfs-genkernel
#boot=sda
default=1
timeout=6
splashimage=(hd0,0)/grub/splash.xpm.gz
title Sabayon Linux Elemental Edition

Next we're going to build your grub.conf. Pay attention, you can screw your system up if you do this wrong!

Okay, you always want root (hd*,*) to be that first line. This tells you where the root of the OS you're trying to boot is. For me it is (hd0,0). According to a friend of mine he says that GRUB is always starting at 0; meaning it has to be (hd0,*). Usually for me, seeing as how I only have one drive, it is (hd0,0). So type this in(Note:All code boxes after this line mean you should do what it says to in the /boot/grub/grub.conf text file. I have explained how to open it in the aforementioned lines, thank you.):
Code: Select all
root (hd0,0) <-- this tells GRUB that the root of the drive is at 0,0. Remember, the first 0 is needed by GRUB, it will not change.
Congrats, you just made your first grub line.

Next you're going to create your kernel line. This tells GRUB what kernel to boot. This is why when you build a new kernel, you see a new line in the GRUB boot menu that mentions your original install (Probably something like Sabayon Linux x86 Standard Edition or something like that) and a new one with parentheses that have the new kernel name in it. So go down one line, tab over and start typing:
Code: Select all
kernel /kernel-genkernel-x86-2.*.**-sabayon root=/dev/ram0 ramdisk=8192 real_root=/dev/sda3 quiet init=/linuxrc splash=silent,theme:sabayon vga=791 CONSOLE=/dev/tty1 pci=nomsi
- Replace the kernel line (That /kernel-genkernel-x86-2.*.**-sabayon) with the name of your kernel, and replace real_root=/dev/sda3 with your /dev/point (I'll explain that below.) Now the ramdisk=8192 means the size of your ramdisk. Yeah, don't ask. Just know your ramdisk size, which is 8192 for me, and put it in there. Now you've booted your kernel. Great, Just a few more things and we're done. Now we have to create a initrd line. It's a simple line:
Code: Select all
initrd /initramfs-genkernel-x86-2.6.22-sabayon (replacing your kernel name with the 2.6.22-sabayon thing.
This should be your final product (Or it will look something similar to it)
Code: Select all
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /kernel-genkernel real_root=UUID=0ee567ef-085d-4698-865c-f2c2bb3c4339
#          initrd /initramfs-genkernel
#boot=sda
default=1
timeout=6
splashimage=(hd0,0)/grub/splash.xpm.gz
title Sabayon Linux Elemental Edition
   root (hd0,0)
   kernel /kernel-genkernel-x86-2.6.22-sabayon root=/dev/ram0 ramdisk=8192 real_root=/dev/sda3 quiet init=/linuxrc splash=silent,theme:sabayon vga=791 CONSOLE=/dev/tty1 pci=nomsi
   initrd /initramfs-genkernel-x86-2.6.22-sabayon
Okay you've created a GRUB.conf for Sabayon. Congrats. Now as for other distros, I'm not sure, I don't dip my hand into their cookie jar. I would say look at their original GRUB.conf if they use it, and see what you can emulate for ours. If this tutorial wasn't clear enough for you then please look at http://www.gnu.org/software/grub/manual ... B-natively as posted by Joost. Thank you Joost.

Resources:
Myself, Experience.
c0nv1ct, Knowledge.
Joost, Knowledge and self experience
dyingmuppet, self experience.
Last edited by Element on Mon Nov 26, 2007 23:46, edited 3 times in total.
Image
On Sabayon @ Freenode: <ColdFlo> im not asking for support <ColdFlo> im asking for help
Element
Growing Hen
 
Posts: 144
Joined: Mon Dec 11, 2006 0:55
Location: 127.0.0.2

Re: [HOWTO:] Making Sabayon a Second OS - Fixing GRUB

Postby joost » Mon Nov 26, 2007 8:55

root (hd0,0) <-- this tells GRUB that the root of the drive is at 0,0. Remember, the first 0 is needed by GRUB, it will not change.

Are you issuing a grub shell command there? Or are you editing the grub.conf file? That isn't clear.

:D

Also a nice little handy tut if you ever lost your grub boot loader due reinstall of windows:
http://www.gnu.org/software/grub/manual ... B-natively
joost
Sagely Hen
 
Posts: 2574
Joined: Fri Nov 17, 2006 12:11
Location: The Netherlands


Return to Hardware

Who is online

Users browsing this forum: juha and 1 guest