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
Member
 
Join Date: Oct 2011
Posts: 30
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
  #8  
Old 08-22-2013, 11:49 AM
Ritana Ritana is offline
Junior Member
 
Join Date: Aug 2013
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Hi guys,

Unfortunately, the tutorial having written by you seems not to work for me

I've checked in grub command line my PC-BSD has been installed to (hd1,3) but after replacing it in your code and configuring my grub list throughout the grub-mkconfig -o /boot/grub/grub.cfg comman I still unable to start PC-BSD from gub2

Launching simply stops with a short 'Boot error' message.

What have I made wrong ?
Reply With Quote
  #9  
Old 08-22-2013, 04:57 PM
AN00B AN00B is offline
Junior Member
 
Join Date: Jul 2013
Posts: 24
Thanks: 1
Thanked 2 Times in 2 Posts
Default
I installed Pear Os on a slice and then PCBSD over it to another slice. I am unable to boot into the Pear Os install and can only boot into PCBSD . Please help me add the Pear install to the grub menu

Code:
[AN00b@pcbsd ~]$ gpart show
=>       63  251658177  ada0  MBR  (120G)
         63       1985        - free -  (992k)
       2048  120719360     1  linux-data  [active]  (57G)
  120721408  124645376     3  freebsd  (59G)
  245366784       2046        - free -  (1M)
  245368830    6287362     2  ebr  (3G)
  251656192       2048        - free -  (1.0M)

=>      0  6287362  ada0s2  EBR  (3G)
        0  6287362       1  linux-swap  (3G)

=>        0  124645376  ada0s3  BSD  (59G)
          0  124624896       1  freebsd-zfs  (59G)
  124624896      20480          - free -  (10M)
Here is the results of the bootinfoscript. Thank you.
Attached Files:
File Type: txt results.txt (13.5 KB, 5 views)
Reply With Quote
  #10  
Old 08-22-2013, 05:18 PM
Beanpole's Avatar
Beanpole Beanpole is offline
Senior Member
 
Join Date: May 2010
Posts: 2,516
Thanks: 20
Thanked 444 Times in 360 Posts
Default
@AN00B

In PC-BSD there should be a new utility under the PC-BSD control panel called "Boot Manager", open that up and go to the "GRUB Configuration" tab.
In the pane on the right-hand side you should be able to add any custom GRUB2 entries that you would need to boot other OS's.
Example (modify as necessary):
Code:
menuentry 'Other OS'{
set root=(hd0,1)
chainloader +1
}
Remember that the hard drives (hd) start counting at 0, while the slices start counting at 1!
So I am guessing from your "gpart" output that your line would be "set root=(hd0,[1 or 2])".

Hope this helps!

EDIT: Don't forget to click the "Save" button once you are done!

NOTE: This only works if you are using the new GRUB loader from PC-BSD. If it is loading a version of GRUB that was installed some other way (like through a linux distro) you will need to edit it using alternate methods dependent upon how you installed it.
__________________
~ Ken Moore ~
PC-BSD/iXsystems

Last edited by Beanpole; 08-22-2013 at 05:28 PM. Reason: Don't forget to save!
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 02:09 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, 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.