Reply
 
Thread Tools Display Modes
  #1  
Old 05-02-2012, 06:59 AM
rameshan rameshan is offline
Junior Member
 
Join Date: May 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default what are the commands for adding PCBSD9 to Sabayon linux Grub2
Hi i recenly installled Sabayon linux to my PC. PCBSD partition did not come as default. What is the command and sequence for adding pcbsd to sabayon linux grub2. thanks in advance




rameshan nattikka
Reply With Quote
  #2  
Old 05-02-2012, 09:54 AM
fvj fvj is offline
Junior Member
 
Join Date: Feb 2007
Location: France
Posts: 26
Thanks: 0
Thanked 2 Times in 2 Posts
Default
Hi,
I also have Sabayon installed alongside PC-BSD. So what you need to do is the following 2 steps:

- Step 1: Add a custom entry (to chainload from Grub2 to PC-BSD bootloader) as root in the file /etc/grub.d/40_custom, who will then look like this:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.

menuentry "PCBSD 9.0" {
set root=(hd0,2)
chainloader +1
}

If I have correctly understand your setup, you've installed Sabayon AFTER PC-BSD on a single disk, so, in this case, hd0 is the first disk (as Grub2 still counts HDD from 0) and 2 is the second partition (as Grub2 doesn't count anymore partitions from 0, but from 1 / why is this so is open to debate but it is so) but correct the entries according to your setup if I'm wrong.

- Step 2: run grub-mkconfig -o /boot/grub/grub.cfg as root (to generate the menu), and reboot the machine.

If everything went right, you should now be able to choose PC-BSD in the Grub2 menu, bringing you to the PC-BSD bootloader (with all it's specific options)...

More on this: http://en.gentoo-wiki.com/wiki/Grub2
(But note that even if Sabayon is Gentoo based, it uses "grub-mkconfig" and NOT "grub2-mkconfig" as shown in this page for whatever reason)

Hope this helps...
Reply With Quote
  #3  
Old 05-02-2012, 10:20 AM
mike4 mike4 is offline
Junior Member
 
Join Date: Oct 2011
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default
I've only added about the below in grub.cfg. Works fine in Ubuntu.

menuentry "PCBSD 9.0" {
set root=(hd0,2)
chainloader +1
Reply With Quote
  #4  
Old 05-02-2012, 10:54 AM
fvj fvj is offline
Junior Member
 
Join Date: Feb 2007
Location: France
Posts: 26
Thanks: 0
Thanked 2 Times in 2 Posts
Default
@mike4

You're right, this is working too.

But be aware that, in case of a kernel update, or if you have to run "sudo update-grub" manually (as if installing another OS that you want to boot or chainload with Grub2), grub.cfg will be regenerated automagically from scripts and your changes will be gone, unless you put them in /etc/grub.d/40_custom !!!

The full details can be found here:
https://help.ubuntu.com/community/Grub2
Section "GRUB vs GRUB 2", points 5. to 8.
Reply With Quote
  #5  
Old 05-02-2012, 10:54 AM
rameshan rameshan is offline
Junior Member
 
Join Date: May 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Thanks Fvi I think the procedure is correct This is what the output of grub-mkconfig -o /boot/grub/grub.cfg as root

Generating grub.cfg ...
Found background image: default-splash.png
Found linux image: /boot/kernel-genkernel-x86-3.2.0-sabayon
Found initrd image: /boot/initramfs-genkernel-x86-3.2.0-sabayon
No volume groups found
Found Microsoft Windows XP Professional on /dev/sda1
Found unknown Linux distribution on /dev/sda3
/etc/grub.d/40_custom.save: line 1: menuentry: command not found
insmod: can't read 'ufs': No such file or directory
/etc/grub.d/40_custom.save: line 4: chainloader: command not found
/etc/grub.d/40_custom.save: line 5: }#!/bin/sh: No such file or directory
/etc/grub.d/40_custom.save.1: line 3: /etc/grub.d/40_custom: Permission denied
error: syntax error.
error: Incorrect command.
error: syntax error.
error: line no: 122
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
done
Reply With Quote
  #6  
Old 05-02-2012, 12:02 PM
fvj fvj is offline
Junior Member
 
Join Date: Feb 2007
Location: France
Posts: 26
Thanks: 0
Thanked 2 Times in 2 Posts
Default
Hi rameshan,

Those errors from grub-mkconfig -o /boot/grub/grub.cfg aren't good at all!

So, let's go back to the beginning

First (as I just rebooted in my Sabayon 8 right now to be sure), there's only those files in my /etc/grub.d/:

00_fonts 00_header 05_distro_theme 10_linux 20_linux_xen 30_os-prober 40_custom 41_custom README

As we can see, no /etc/grub.d/40_custom.save! So let's say it's a backup file that was made when you've edited the original /etc/grub.d/40_custom.

To be sure, open a terminal as your standard user and type "sudo leafpad /etc/grub.d/40_custom.save" (or use gedit / kate / kwrite or whatever you've installed).

Check that there is only this inside:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.

and save it with the same name (to use it as a backup).

Then add (after it) those lines:

menuentry "PCBSD 9.0" {
set root=(hd0,3)
chainloader +1
}

(as it seems you have on a single HDD XP Pro / Sabayon / PC-BSD and as "Found unknown Linux distribution on /dev/sda3" is the same I've got here = it's PC-BSD but you can use "sudo fdisk -l" to check it)

and save it as /etc/grub.d/40_custom (without any extension, just 40_custom).

It should now looks like:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.

menuentry "PCBSD 9.0" {
set root=(hd0,3)
chainloader +1
}

Now type "sudo grub-mkconfig -o /boot/grub/grub.cfg" and there shouldn't be anymore errors and you should be good...

(In case it's still want to read 40_custom.save, move it to your Documents and let only 40_custom be in /etc/grub.d)

Good luck.
Reply With Quote
  #7  
Old 05-02-2012, 04:53 PM
rameshan rameshan is offline
Junior Member
 
Join Date: May 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default
HI fvj

Thanks It worked. solved PCBSD is there in the Grub.God bless you

the steps

su
followed by password

then
nano etc/grub.d/40_custom

then entered this after the first paragraph

menuentry "PCBSD 9.0" {
set root=(hd0,3)
chainloader +1
}

I have also edited the backup files etc/grub.d/40_custom.save.1 followed by 2 and 3. fvj there were different entries. correct one by one.

then typed
nano etc/grub.d/40_custom in terminal

save it followed by grub-mkconfig -o /boot/grub/grub.cfg
This time there were no errors rebooted found PCBSD 9 in the Grub
---------------------------------------------------------------------
Mentioned the steps for other users who want to dual boot PCBSD and Sabayon
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 01:15 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Copyright 2005-2010, The PC-BSD Project. PC-BSD and the PC-BSD logo are registered trademarks of iXsystems.
All other content is freely available for sharing under the terms of the Creative Commons Attribution License.