LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-28-2009, 05:11 PM   #1
Jeff91
Bodhi Developer
 
Registered: Jan 2009
Location: Bloomington, IL
Distribution: Bodhi
Posts: 379

Rep: Reputation: 68
Adding a menu entry to grub2


I have both Ubuntu 9.10 and Sabayon 4.2 installed on my laptop. Sabayon (along with it's boot loader) resides on sda8 on my hard drive. Ubuntu 9.10 resides on sda6, and grub2 resides on sda1 (Which is mounted as Ubuntu 9.10 /boot directory)

I am trying to add an entry for Sabayon to my grub so I can choose to boot into it when I want to... I ran the grub auto updated and it looked like it had worked...
Code:
jeff@sager-lintop:~$ sudo update-grub2
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.31-5-generic
Found initrd image: /boot/initrd.img-2.6.31-5-generic
Found memtest86+ image: /memtest86+.bin
Found Gentoo Base System release 2.0.0 on /dev/sda8
done
How ever when I reboot I did not have a new menu entry in my grub entires... So I did some reading here and create a custom.sh (and made it executable) in my /etc/grub.d/ directory. The contents of my custom.sh are:
Code:
echo "Adding Sabayon Linux to the Menu..."
cat << EOF
menuentry "Sabayon Linux - 4.2" {
        set root=(hd0,7)
        linux /boot/kernel-genkernel-x86_64-2.6.29-sabayon  root=/dev/ram0 ramdisk=8192 real_root=UUID=c1cd8123-e519-43bf-b3eb-451423824159 dolvm init=/linuxrc splash=silent,theme:sabayon vga=791 CONSOLE=/dev/tty1 quiet resume=swap:/dev/sda2 real_resume=swap:/dev/sda2
        initrd /boot/initramfs-genkernel-x86_64-2.6.29-sabayon
}
EOF
I ran the update-grub2 command again and get the same results as before (for some reason it failed to show my echo command) - but anywho upon investigating my /boot/grub/grub.cfg it had indeed added the entry for Sabayon this time.

Only once I reboot threw me an error message "you need to load the kernel first" when I selected my Sabayon option. I know I must be missing something but I cannot quiet figure it out... any suggestions?

Thanks,
~Jeff

PS: This is my menu.lst from Sabayon to show that I have the kernels and such right in my custom.sh:
Code:
title Sabayon Linux (kernel-genkernel-x86_64-2.6.29-sabayon)
	root (hd0,7)
	kernel /boot/kernel-genkernel-x86_64-2.6.29-sabayon  root=/dev/ram0 ramdisk=8192 real_root=UUID=c1cd8123-e519-43bf-b3eb-451423824159 dolvm init=/linuxrc splash=silent,theme:sabayon vga=791 CONSOLE=/dev/tty1 quiet resume=swap:/dev/sda2 real_resume=swap:/dev/sda2
	initrd /boot/initramfs-genkernel-x86_64-2.6.29-sabayon
	savedefault

Last edited by Jeff91; 08-28-2009 at 05:38 PM.
 
Old 08-28-2009, 06:12 PM   #2
Jeff91
Bodhi Developer
 
Registered: Jan 2009
Location: Bloomington, IL
Distribution: Bodhi
Posts: 379

Original Poster
Rep: Reputation: 68
Meh nvm, I had mistakenly used hd(0, 7) when I needed to use hd(0, 8)

Works now

~Jeff
 
  


Reply

Tags
grub2


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add e menu entry to KDE start menu over CLI browny_amiga Linux - General 7 02-08-2009 03:05 PM
adding menu entry in gnome brainlesspinkey Linux - Software 2 11-20-2004 08:38 PM
Adding a KDE menu to gnome menu Projekt2 Slackware 3 10-25-2003 01:47 PM
Adding Menu Entry in GDM on SuSE 8.2 JoshuaRogers Linux - Software 1 10-18-2003 09:24 PM
adding entry to quick browser menu apberzerk Linux - General 0 10-18-2003 08:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration