LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Sabayon (https://www.linuxquestions.org/questions/sabayon-86/)
-   -   updating grub on sabayon8 while dualbooting with ubuntu 10.04 (https://www.linuxquestions.org/questions/sabayon-86/updating-grub-on-sabayon8-while-dualbooting-with-ubuntu-10-04-a-938683/)

Fred Caro 04-07-2012 08:08 PM

updating grub on sabayon8 while dualbooting with ubuntu 10.04
 
As I understand it there is no 'update-grub' on sabayon8 as it uses grub 1.99 so my latest Ubuntu kernel is not recognised on the boot options page and that page cannot be easily updated.
Would I have to use a text editor to add a line to the /boot/grub/menu.list? If so what happens if that kernel has not been properly recognised by Sabayon, would boot hang or loop?

Fred.

towheedm 04-08-2012 01:19 AM

GRUB 1.99 does not use menu.lst or grub.conf. Those are for grub-legacy.

GRUB2 is quite different and uses several files to generate its grub.cfg boot script. The files are /etc/default/grub which contains the GRUB variables and the scripts in /etc/grub.d which are used to generate the menu entries.

To update the boot script use:
Code:

sudo grub-mkconfig -o /boot/grub/grub.cfg

Fred Caro 04-09-2012 02:06 PM

grub2 and grub 1.99
 
Sorry to question but are you sure grub 1.99 is the same as, or responds the same as, grub2. The boot section on my layout is controled by Sabayon and not Ubuntu so there might be some differences in the way grub is configured.You will appreciate I am reluctant to run a command as 'root' on a sensitive part if I am not sure 1.99=2.
Thanks, perhaps I am being overly cautious.

Fred

towheedm 04-09-2012 02:43 PM

You are damn right on being overly cautious. But to answer your question, yes GRUB2=1.99. GRUB-legacy is any GRUB version < 0.97 (which is the more common GRUB-legacy version used by the distros). GRUB2 started with version 1.9x with 1.97 being the more popular GRUB2 used by the distros.

Any version <=0.97 is now referred to as GRUB-legacy and any version >=1.9x is now referred to as GRUB2 to differentiate between it and GRUB-legacy.

The first version of Sabayon I used was 5.5 and it had GRUB2 by default. Sabayon 7 uses 1.99 also. It follows that Sabayon 8 which I'm now hearing about would certainly use GRUB2 v1.99.

Of course you can verify this by looking for a menu.lst or grub.conf file. These only exists for GRUB-legacy. Again, GRUB2 uses the files I mentioned in my first post.

You can always generate a new boot script without touching your existing one with:
Code:

sudo grub-mkconfig -o ~/Documents/mygrub.cfg
You can then inspect this file to verify for yourself.

Also,
Code:

info -f grub
would give you the info pages for GRUB2.

While most distros install GRUB2 to /boot/grub, some distros such as Fedora and openSUSE uses GRUB-legacy by default, and so places it's GRUB2 files in /boot/grub2. They have also renamed some of the GRUB2 script such as grub-mkconfig and grub-install to grub2-mkconfig and grub2-install.

Fred Caro 04-09-2012 07:20 PM

grub/saayon
 
Dear...,
the readout for 'info -f grub':

fred@sabayon-fred ~ $ info -f grub
info: grub: No such file or directory
fred@sabayon-fred ~ $

the readout from the previous is:

red@sabayon-fred ~ $ info -f grub
info: grub: No such file or directory
fred@sabayon-fred ~ $ sudo grub-mkconfig -o ~/Documents/mygrub.cfg

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

Password:
fred is not in the sudoers file. This incident will be reported.
fred@sabayon-fred ~ $ the following happened using 'su'

fred@sabayon-fred ~ $ su
Password:
sabayon-fred fred # grub-mkconfig -o ~/Documents/mygrub.cfg
/sbin/grub-mkconfig: line 264: /root/Documents/mygrub.cfg.new: No such file or directory
sabayon-fred fred #

Any ideas, Fred.

towheedm 04-09-2012 07:47 PM

Please use code tags, it makes the reading so much easier.

Are you the only user on the system, or is there a different administrator who initially set up the system. I may be wrong but I think Sabayon uses sudo by default.

But we can do it with su:
Code:

su -mc "grub-mkconfig -o ~/Documents/mygrub.cfg
-m : preserve environment
-c : execute command

or:
Code:

su -c "grub-mkconfig -o /home/fred/Documents/mygrub.cfg"
Also try (without the -f option):
Code:

info grub
or:
Code:

su -c "info grub"

Fred Caro 04-10-2012 02:06 PM

update grub
 
Hello again. The output of your first suggestion is as follows,

code:
fred@sabayon-fred ~ $ su -mc "grub-mkconfig -o ~/Documents/mygrub.cfg
> ^C
fred@sabayon-fred ~ $

oops.

code:

fred@sabayon-fred ~ $ su -mc "grub-mkconfig -o ~/Documents/mygrub.cfg
> ^C
fred@sabayon-fred ~ $ su -mc "grub-mkconfig -o ~/Documents/mygrub.cfg"
Password:
Generating grub.cfg ...
Found background image: default-splash.png
Found linux image: /boot/kernel-genkernel-x86_64-3.2.0-sabayon
Found initrd image: /boot/initramfs-genkernel-x86_64-3.2.0-sabayon
No volume groups found
Found Ubuntu 10.04.4 LTS (10.04) on /dev/sda6
done
fred@sabayon-fred ~ $

This seems to getting somewhere but it does not tell me if it has found the latest kernel. Don't think I have got the tag thing right.
Please note that "sudoers" seems to exist in theory but there is no group for it and, more importantly, man or info searches result in a fruitless result. You have to give more specific searches, i.e., "man grub-probe" and so on. Oh yes I am the only user/admin, which is probably a good thing!

Fred.

Fred Caro 04-11-2012 05:37 PM

grub 1.99
 
Thanks. I did send the tenuous results to a file which convinced me to try the:

(su) grub-mkconfig -o /boot/grub/grub.cfg

It worked but I still don't know why. Also could not reconstitute your grub guide.

Fred.

towheedm 04-11-2012 07:51 PM

Quote:

It worked but I still don't know why.
You don't know why what worked?

Quote:

Also could not reconstitute your grub guide.
I don't quite get what you mean by 'reconstitute'?

Fred Caro 04-14-2012 08:41 PM

sabayon/ubuntu boot issue
 
The solution given worked fine until sabayon updated then sabayon would not boot but the previously obscured ubuntu kernel would.
I cannot recreate any error outputs (nor would I want to) but I can say that the /grub.cfg file became 'read only' and the corresponding 'rc.log' file output a time stamp of the same value. Chmod would not change the permissions on /boot/grub/.
I did find a trojan on Ubuntu that was shifted.

I ended up reinstalling Sabayon8 on freed space.

Fred.


All times are GMT -5. The time now is 06:34 PM.