Grub2 and multiple boot different ubuntu versions

Tom H tomh0665 at gmail.com
Thu Mar 25 21:59:20 UTC 2010


> I just opened a Terminal and typed grub-mkconfig and it said:

> karl at Lucid:~$ sudo grug-mkconfig
> [sudo] password for karl:
> sudo: grug-mkconfig: command not found
> karl at Lucid:~$

> Why did this happen? Is this an error? Should it be reported as a
> bug? Without the sudo it finds the file and reports you must be a root
> login.

Strange. /usr/sbin must have dropped out of your root user's path or
you have modified /etc/sudoers not to clear the env of the user
executing sudo.


> Continuing you cd to /usr/sbin and try again. I get a long list of
> my system. Too long for this message. The end has this cryptic things:
> }
> menuentry "Ubuntu 9.04, memtest86+ (on /dev/sda9)" {
>     insmod ext2
>     set root='(hd0,9)'
>     search --no-floppy --fs-uuid --set 6bae2f33-aff5-42ca-b2cc-65cea5be3cc8
>     linux /boot/memtest86+.bin
> }
> ### END /etc/grub.d/30_os-prober ###
>
> ### BEGIN /etc/grub.d/40_custom ###
> # 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.
> ### END /etc/grub.d/40_custom ###
> done
> karl at Lucid:/usr/sbin$

Of course! grub-mkconfig outputs to stdout if you do not specify a
file to output to.


> So I go looking for /etc/grub.d/40_custom. It gets weird in the
> extreme:

> karl at Lucid:/etc/grub.d$ more 40_custom
> #!/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.
> karl at Lucid:/etc/grub.d$

> It tells you nothing about how to enter a new entry! It tells you
> nothing about how to just move one entry in front of another.

40_custom is there to allow you to add entries to the end of your grub
menu (or to customize your entire grub menu if you "chmod -x" 05_...,
10_..., 20_..., 30_...).

It has nothing to do with re-ordering the menu if you do not "chmod
-x" the other scripts in
/etc/grub.d




More information about the ubuntu-users mailing list