PDA

View Full Version : How to have a custom Grub2 menu that is maintenance free



Pages : [1] 2 3

Cavsfan
October 25th, 2012, 05:56 PM
If you just use Ubuntu or dual boot/multi boot Ubuntu with Debian, Mint, Arch, Fedora, openSUSE, Windows, etc. this will give you all the information to create a custom background, fonts colors and menu that never needs modified.
You can also choose the default OS and the timeout before the default OS is selected. That will never need changing even when a new kernel is installed in any Linux system.

It has been updated for UEFI/GPT partitioned systems.

The only time you would need to modify anything is if you get bored with the background picture, font colors or if you install/remove/re-install an operating system.

The Wiki evolved from this thread: How to: Create a Customized GRUB2 Screen that is Maintenance Free. (http://ubuntuforums.org/showthread.php?t=1542338)

There are several examples of what your screen could look like.

There is a link in the bottom of the Wiki that links back to this thread to post questions, comments, problems, etc.

All Linux systems are pretty much the same as far as customizing grub goes but, Arch is a little different see here for Arch Linux (https://ubuntuforums.org/showthread.php?t=2298744).

Grub has gotten much simpler and you should find that it is easier to customize. The Wiki has been updated with the ability to boot into the backup kernel.

If you choose not to have that ability, just omit that part and go with 2 entries per system instead of the three in the Wiki.

dino99
October 25th, 2012, 06:14 PM
hey you made a good job, clearly explained, thanks. :P:P
thats kind of wiki have a place into "tutorials & tips" subforum.

Cavsfan
October 25th, 2012, 06:51 PM
hey you made a good job, clearly explained, thanks. :P:P
thats kind of wiki have a place into "tutorials & tips" subforum.

You're welcome.
Didn't you get the message:
http://ubuntuforums.org/showthread.php?t=2074191

"the forum will be closed completely to posting after a transitional period." :razz:

Cavsfan
October 26th, 2012, 05:42 PM
Here is my current Grub2 menu on Quantal Quetzal 12.10.
I have 2 Lucid installs, a Precise Pangolin install, a Quantal Quetzal install and Windows 7.
I leave the default on Windows 7 for my wife in case the PC reboots.
Even when new kernels are installed in any Ubuntu, the default still is Windows 7.
The normal font color is yellow and highlight is white.

http://ompldr.org/tZzE5Mw (http://ompldr.org/vZzE5Mw)

Feel free to post your custom grub2 menu if you have used my wiki to make it. :)

Cavsfan
October 29th, 2012, 05:19 PM
I installed 3 more systems - Lucid, Precise and Quantal on separate partitions to keep the grub files generic in case anyone needs a copy of the original file.

I got an upgrade to grub and it gave me some errors. Luckily I had a copy of 05_debian_theme to fix the error.

I had to edit fstab every time I installed another system as it would pull all of the swap partitions into fstab.
There is a section on editing fstab when installing or reinstalling Ubuntu in the wiki in my signature in section 1.7.

It would be very difficult to maneuver the long menu without customizing it as I have.
Here is what my grub2 screen currently looks like with 7 operating systems:

http://ompldr.org/tZzJpNg (http://ompldr.org/vZzJpNg)

Here is the output of sudo blkid:


/dev/sda1: LABEL="C:" UUID="1CFC7A8DFC7A60C6" TYPE="ntfs"
/dev/sda2: LABEL="Lucid" UUID="a162dc8a-e4df-4b79-b4c3-524761ff7ae1" TYPE="ext4"
/dev/sda3: UUID="2a80f59e-e7c3-418e-aab2-ab5d19255a2f" TYPE="swap"
/dev/sda5: LABEL="Precise" UUID="3b8b1954-24e6-4a5e-9074-70a1a94ed4be" TYPE="ext4"
/dev/sda6: UUID="82c51b29-023f-4964-99b6-67b45a49527f" TYPE="swap"
/dev/sda7: LABEL="Quantal" UUID="b5fc902c-0bf0-45b3-95a1-29f3c46dfe6a" TYPE="ext4"
/dev/sda8: UUID="69ac3efc-8a8a-4056-89e0-59bb81c2f468" TYPE="swap"
/dev/sda9: LABEL="Lucid-Generic" UUID="109c11d0-71e3-41a4-87da-9e81535499a5" TYPE="ext4"
/dev/sda10: UUID="24aa8c8b-53dc-4ecc-852b-ff2c25c8b342" TYPE="swap"
/dev/sda11: LABEL="Precise-Generic" UUID="50104efb-d918-45a9-985e-a70c60e87ac0" TYPE="ext4"
/dev/sda12: UUID="139390a6-2fe1-4ff2-b650-88ae3b0586c1" TYPE="swap"
/dev/sda13: UUID="580e8c62-78ce-44a2-93e3-ccebd37c3acc" TYPE="ext4" LABEL="Quantal-Generic"
/dev/sda14: UUID="ec3048b8-c644-435a-93bb-08bb4975d0db" TYPE="swap"
/dev/sdb1: LABEL="Fantom" UUID="78B8D1A1B8D15DE6" TYPE="ntfs"

They are easy to recognize since they have all been labeled as explained in 1.6 of the wiki.

I will try to put the generic grub files on the wiki but, if any one needs a copy of something let me know and I will post the contents of the file here.

bogan
October 29th, 2012, 06:34 PM
HI!, Cavsfan,

I see your latest Grub menu is still using Grub v1.98-1: I thought grub 2 was 1.99.

With Quantal 12.10 Grub Customizer is a disaster, and I get no recovery options, so I am tempted to try your method; I have studied it with interest in the past, but have not tried it out, as Grub Customer did what I needed.

Will it work with Grub 2 v2.00 ?? which has files very different from previous versions.

Edit: I use the following to see what my grub menu will look like : will it work with your system ?
grep menuentry /boot/grub/grub.cfg | cut -b 1-11 --complement | cut -d "'" -f1 | cut -d "\"" -f 1 | nl --starting-line-number=0Currently mine shows like this:
0 ature_menuentry_id}
1 _id_option=
2 _id_option=
3 entry_id_option
4 Ubuntu 3.5.0-18 Linux 12.1 (on sda10)
5 Memory test (memtest86+)
6 Ubuntu Quantal (12.10) (on USB)
7 Ubuntu 12.04.1 LTS (12.04)
8 Ubuntu 12.10 (12.10)
9 Ubuntu 12.04.1 LTS (12.04)
10 Ubuntu 12.04.1 LTS (12.04)
11 Windows 7 (loader) (on /dev/sda1)
12 Ubuntu 3.2.0-33pae (12.04.1) ( on sda5)I have no idea what the first three entries mean, the first [Number 4] and the last, I renamed in grub Customer; entry 6 I( edited in /boot/grub/grub,cfg; whilst entries 7,9, & 10 are spurious duplicates of the sda5 entry, created by update-grub & Grub Customizer

Chao!, bogan.

Cavsfan
October 29th, 2012, 09:31 PM
HI!, Cavsfan,

I see your latest Grub menu is still using Grub v1.98-1: I thought grub 2 was 1.99.

With Quantal 12.10 Grub Customizer is a disaster, and I get no recovery options, so I am tempted to try your method; I have studied it with interest in the past, but have not tried it out, as Grub Customer did what I needed.

Will it work with Grub 2 v2.00 ?? which has files very different from previous versions.

Edit: I use the following to see what my grub menu will look like : will it work with your system ?
grep menuentry /boot/grub/grub.cfg | cut -b 1-11 --complement | cut -d "'" -f1 | cut -d "\"" -f 1 | nl --starting-line-number=0Currently mine shows like this:
0 ature_menuentry_id}
1 _id_option=
2 _id_option=
3 entry_id_option
4 Ubuntu 3.5.0-18 Linux 12.1 (on sda10)
5 Memory test (memtest86+)
6 Ubuntu Quantal (12.10) (on USB)
7 Ubuntu 12.04.1 LTS (12.04)
8 Ubuntu 12.10 (12.10)
9 Ubuntu 12.04.1 LTS (12.04)
10 Ubuntu 12.04.1 LTS (12.04)
11 Windows 7 (loader) (on /dev/sda1)
12 Ubuntu 3.2.0-33pae (12.04.1) ( on sda5)I have no idea what the first three entries mean, the first [Number 4] and the last, I renamed in grub Customer; entry 6 I( edited in /boot/grub/grub,cfg; whilst entries 7,9, & 10 are spurious duplicates of the sda5 entry, created by update-grub & Grub Customizer

Chao!, bogan.

Hi bogan!

Replace that old command with this one:

grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0
I got that from drs305 just in case you thought I was smart enough to come up with it myself! :)
Not sure why but, that old one doesn't even work in Lucid any more!
However neither can see what is in the submenus of the default grub menu.
The submenus came with grub 1.99 I believe.

Here is the output of that command on my system and it looks just like the picture:

0 menuentry "Lucid Lynx" {
1 menuentry "Lucid Lynx (Recovery Mode)" {
2 menuentry "Lucid Lynx Generic" {
3 menuentry "Lucid Lynx Generic (Recovery Mode)" {
4 menuentry "Precise Pangolin 12.04" {
5 menuentry "Precise Pangolin 12.04 (Recovery Mode)" {
6 menuentry "Precise Pangolin Generic 12.04" {
7 menuentry "Precise Pangolin 12.04 Generic (Recovery Mode)" {
8 menuentry "Quantal Quetzel 12.10" {
9 menuentry "Quantal Quetzel 12.10 (Recovery Mode)" {
10 menuentry "Quantal Quetzel Generic 12.10" {
11 menuentry "Quantal Quetzel 12.10 Generic (Recovery Mode)" {
12 menuentry "Windows 7" {

That picture is on Lucid and it uses grub 1.98, I believe Maverick Meerkat and anything after that and before Quantal uses grub 1.99.
Quantal uses grub 2.00.

The wiki is broken down into Lucid at the top (1.3 in the table of contents) and Maverick and later towards the bottom (1.4).
There are just a couple of differences between 1.99 and 2.00 in 05_debian_theme.
Pretty much everything else is the same.
Grub 1.99 gives an erroneous error when selecting windows but, still goes into windows.
Grub 2.00 does not give any error when selecting windows which is why I am glad Precise is getting grub 2.0 in January. At least that is what I heard.

The wiki is a lot more straight forward than that How to. It became pretty convoluted and it was closed for editing. The Forum's policy is How Tos should be in wiki format.

So, be sure and use the wiki on the first post of this thread or in my signature (green links).
Let me know what you think and if you use it post your grub menu when you are done. :)

Thanks for the post! :D

Cavsfan
October 30th, 2012, 02:59 PM
Here is my current grub2 menu customized on Precise grub 1.99:

http://ompldr.org/tZzJ5cg (http://ompldr.org/vZzJ5cg)

The normal font color is yellow and the highlight font color is white.

Cavsfan
October 30th, 2012, 03:02 PM
Here is my current grub2 menu customized on Quantal grub 2.00:

http://ompldr.org/tZzJ5cw (http://ompldr.org/vZzJ5cw)

The normal font color is cyan and the highlight font color is light-red.

bogan
October 30th, 2012, 08:23 PM
Hi!, Cavsfan,

Thanks for your response, Post #7, for some reason my subscription advisory did not pick it up.

In Quantal with grub 2.00 and Grub Customizer 3, the 'old command' showed exactly what was displayed on the screen, apart from the first three odd extra bits.

Weirdly, the 'new command', you suggested, shows not only what is displayed, but in addition, it shows the entries complete with part of the script for each:
alan@alan-MS-7616:~$ grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0
0 menuentry "Ubuntu 3.5.0-18 Linux 12.1 (on sda10)" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b5aab3a2-0086-4a12-9276-46bb5a615038
1 menuentry "Memory test (memtest86+)" {
2 menuentry "Ubuntu 12.10 (12.10)" --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-cee38717-6980-4485-a047-124edb4d5a23
3 menuentry "Ubuntu Quantel (12.10) on USB" --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-7608b1e5-b5ea-4563-ad94-8cf496b9f95f
4 menuentry "Ubuntu 3.5.0-18 (12.10) on sdb7 External" --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-7608b1e5-b5ea-4563-ad94-8cf496b9f95f
5 menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os $menuentry_id_option 'osprober-chain-CC9240F39240E394
6 menuentry "Ubuntu 3.2.0-33pae (12.04.1) ( on sda5)" --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-a8ecbe4f-fc2d-40a1-b261-1b62d74e7130
alan@alan-MS-7616:~$ Line 2 is actually the entry for the USB OS and line 3, labelled 'USB', is actually a duplicate of the sda5 entry line6, which is very confusing.

I have had this problem of duplicate entries for some time and Posted about it but got no response; Grub customizer adds them on Saving the configuration.

As far as I can see, to use your system, I would need to start with virgin installations of all the OSs, none of them having run Grub Customizer, as the duplicates get copied from one OS to another by update-grub.

Chao!, bogan.

Cavsfan
October 30th, 2012, 09:02 PM
Hi!, Cavsfan,

Thanks for your response, Post #7, for some reason my subscription advisory did not pick it up.

In Quantal with grub 2.00 and Grub Customizer 3, the 'old command' showed exactly what was displayed on the screen, apart from the first three odd extra bits.

Weirdly, the 'new command', you suggested, shows not only what is displayed, but in addition, it shows the entries complete with part of the script for each:
alan@alan-MS-7616:~$ grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0
0 menuentry "Ubuntu 3.5.0-18 Linux 12.1 (on sda10)" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b5aab3a2-0086-4a12-9276-46bb5a615038
1 menuentry "Memory test (memtest86+)" {
2 menuentry "Ubuntu 12.10 (12.10)" --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-cee38717-6980-4485-a047-124edb4d5a23
3 menuentry "Ubuntu Quantel (12.10) on USB" --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-7608b1e5-b5ea-4563-ad94-8cf496b9f95f
4 menuentry "Ubuntu 3.5.0-18 (12.10) on sdb7 External" --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-7608b1e5-b5ea-4563-ad94-8cf496b9f95f
5 menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os $menuentry_id_option 'osprober-chain-CC9240F39240E394
6 menuentry "Ubuntu 3.2.0-33pae (12.04.1) ( on sda5)" --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-a8ecbe4f-fc2d-40a1-b261-1b62d74e7130
alan@alan-MS-7616:~$ Line 2 is actually the entry for the USB OS and line 3, labelled 'USB', is actually a duplicate of the sda5 entry line6, which is very confusing.

I have had this problem of duplicate entries for some time and Posted about it but got no response; Grub customizer adds them on Saving the configuration.

As far as I can see, to use your system, I would need to start with virgin installations of all the OSs, none of them having run Grub Customizer, as the duplicates get copied from one OS to another by update-grub.

Chao!, bogan.

Hi bogan!

It's likely to be your /etc/fstab that is causing the multiple entries.
I mention this in 1.7 of the wiki.
In terminal enter sudo blkid to get your paritions and UUIDs.

In my case I just have an ext4 partition mounted at / and a swap file for each system so only 2 entries appear in my fstab.


cavsfan@cavsfan-desktop:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda2 during installation
UUID=a162dc8a-e4df-4b79-b4c3-524761ff7ae1 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda3 during installation
UUID=2a80f59e-e7c3-418e-aab2-ab5d19255a2f none swap sw 0 0Just make sure your fstab is correct according to blkid.

If you want copies of all of the grub files I can give them to you. Just let me know what Ubuntu you need it for.
It looks like Quantal Quetzal 12.10 is that correct. No use doing a total install just to get new grub files.

I installed the 3 Ubuntus I have again just to keep the grub files untouched in case someone needed them like you.

I will login to my generic Quantal install and post copies of all the grub files and you can just copy and paste them into the contents of your grub files.
That should allow you to "start over".
:)

bogan
October 30th, 2012, 09:47 PM
Hi!, Cavsfan,

Thanks again. I am not sure what to look for in /etc/fstab, it looks much like yours except there is a entry for /home, and for some reason it also lists the Swap from the 12.10 USB, but not the one from 12.10 sdb7 [perhaps the later was not mounted].
alan@alan-MS-7616:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
[Text deleted]
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda10 during installation
UUID=b5aab3a2-0086-4a12-9276-46bb5a615038 / ext4 errors=remount-ro 0 1
# /home was on /dev/sda11 during installation
UUID=adc771a1-313c-47ae-8725-3c89b89bbfa2 /home ext4 defaults 0 2
# swap was on /dev/sda6 during installation
UUID=a74af1d9-f7f9-4453-97e7-b9e3f370dca4 none swap sw 0 0
# swap was on /dev/sdb3 during installation
UUID=9a74bb15-1215-4774-8419-f2908ee62d2e none swap sw 0 0
alan@alan-MS-7616:~$I have one virgin 12.10 installation in which I deliberately did not run Grub Customizer, so it would be 12.04.1 for which I might need the grub files.

Presumably I will need to replace the files in all the other installations, as they interact; as well as deleting all the Grub Customizer files.

Chao!, bogan.

Cavsfan
October 30th, 2012, 09:54 PM
Here is how the original grub files as in /etc/grub.d/ appear:

cavsfan@cavsfan-MS-7529:~$ cd /etc/grub.d/
cavsfan@cavsfan-MS-7529:/etc/grub.d$ ls -l
total 72
-rwxr-xr-x 1 root root 7541 Oct 14 13:36 00_header
-rwxr-xr-x 1 root root 5488 Oct 4 05:30 05_debian_theme
-rwxr-xr-x 1 root root 10891 Oct 14 13:36 10_linux
-rwxr-xr-x 1 root root 10258 Oct 14 13:36 20_linux_xen
-rwxr-xr-x 1 root root 1688 Oct 11 10:10 20_memtest86+
-rwxr-xr-x 1 root root 10976 Oct 14 13:36 30_os-prober
-rwxr-xr-x 1 root root 1426 Oct 14 13:36 30_uefi-firmware
-rwxr-xr-x 1 root root 214 Oct 14 13:36 40_custom
-rwxr-xr-x 1 root root 216 Oct 14 13:36 41_custom
-rw-r--r-- 1 root root 483 Oct 14 13:36 README
I would think /etc/default/grub might be one you need:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"/etc/grub.d/05_debian_theme:

#!/bin/sh
set -e

# grub-mkconfig helper script.
# Copyright (C) 2010 Alexander Kurtz <kurtz.alex@googlemail.com>
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.

# Include the GRUB helper library for grub-mkconfig.
. /usr/share/grub/grub-mkconfig_lib

# We want to work in /boot/grub/ only.
test -d /boot/grub; cd /boot/grub

# Set the location of a possibly necessary cache file for the background image.
# NOTE: This MUST BE A DOTFILE to avoid confusing it with user-defined images.
BACKGROUND_CACHE=".background_cache"

set_default_theme(){
# Set a monochromatic theme for Ubuntu.
echo "${1}set menu_color_normal=white/black"
echo "${1}set menu_color_highlight=black/light-gray"

if [ -e /lib/plymouth/themes/default.grub ]; then
sed "s/^/${1}/" /lib/plymouth/themes/default.grub
fi
}

module_available(){
local module
for module in "${1}.mod" */"${1}.mod"; do
if [ -f "${module}" ]; then
return 0
fi
done
return 1
}

set_background_image(){
# Step #1: Search all available output modes ...
local output
for output in ${GRUB_TERMINAL_OUTPUT}; do
if [ "x$output" = "xgfxterm" ]; then
break
fi
done

# ... and check if we are able to display a background image at all.
if ! [ "x${output}" = "xgfxterm" ]; then
return 1
fi

# Step #2: Check if the specified background image exists.
if ! [ -f "${1}" ]; then
return 2
fi

# Step #3: Search the correct GRUB module for our background image.
local reader
case "${1}" in
*.jpg|*.JPG|*.jpeg|*.JPEG) reader="jpeg";;
*.png|*.PNG) reader="png";;
*.tga|*.TGA) reader="tga";;
*) return 3;; # Unknown image type.
esac

# Step #4: Check if the necessary GRUB module is available.
if ! module_available "${reader}"; then
return 4
fi

# Step #5: Check if GRUB can read the background image directly.
# If so, we can remove the cache file (if any). Otherwise the backgound
# image needs to be cached under /boot/grub/.
if is_path_readable_by_grub "${1}"; then
rm --force "${BACKGROUND_CACHE}.jpeg" \
"${BACKGROUND_CACHE}.png" "${BACKGROUND_CACHE}.tga"
elif cp "${1}" "${BACKGROUND_CACHE}.${reader}"; then
set -- "${BACKGROUND_CACHE}.${reader}" "${2}" "${3}"
else
return 5
fi

# Step #6: Prepare GRUB to read the background image.
if ! prepare_grub_to_access_device "`${grub_probe} --target=device "${1}"`"; then
return 6
fi

# Step #7: Everything went fine, print out a message to stderr ...
echo "Found background image: ${1}" >&2

# ... and write our configuration snippet to stdout. Use the colors
# desktop-base specified. If we're using a user-defined background, use
# the default colors since we've got no idea how the image looks like.
# If loading the background image fails, use the default theme.
echo "insmod ${reader}"
echo "if background_image `make_system_path_relative_to_its_root "${1}"`; then"
if [ -n "${2}" ]; then
echo " set color_normal=${2}"
fi
if [ -n "${3}" ]; then
echo " set color_highlight=${3}"
fi
if [ -z "${2}" ] && [ -z "${3}" ]; then
echo " true"
fi
echo "else"
set_default_theme " "
echo "fi"
}

# Earlier versions of grub-pc copied the default background image to /boot/grub
# during postinst. Remove those obsolete images if they haven't been touched by
# the user. They are still available under /usr/share/images/desktop-base/ if
# desktop-base is installed.
while read checksum background; do
if [ -f "${background}" ] && [ "x`sha1sum "${background}"`" = "x${checksum} ${background}" ]; then
echo "Removing old background image: ${background}" >&2
rm "${background}"
fi
done <<EOF
648ee65dd0c157a69b019a5372cbcfea4fc754a5 debian-blueish-wallpaper-640x480.png
0431e97a6c661084c59676c4baeeb8c2f602edb8 debian-blueish-wallpaper-640x480.png
968ecf6696c5638cfe80e8e70aba239526270864 debian-blueish-wallpaper-640x480.tga
11143e8c92a073401de0b0fd42d0c052af4ccd9b moreblue-orbit-grub.png
d00d5e505ab63f2d53fa880bfac447e2d3bb197c moreblue-orbit-grub.png
f5b12c1009ec0a3b029185f6b66cd0d7e5611019 moreblue-orbit-grub.png
EOF

# Include the configuration of desktop-base if available.
if [ -f "/usr/share/desktop-base/grub_background.sh" ]; then
. "/usr/share/desktop-base/grub_background.sh"
fi

# First check whether the user has specified a background image explicitly.
# If so, try to use it. Don't try the other possibilities in that case
# (#608263).
if [ -n "${GRUB_BACKGROUND+x}" ]; then
set_background_image "${GRUB_BACKGROUND}" || set_default_theme
exit 0
fi

# Next search for pictures the user put into /boot/grub/ and use the first one.
for background in *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.tga *.TGA; do
if set_background_image "${background}"; then
exit 0
fi
done

# Next try to use the background image and colors specified by desktop-base.
if set_background_image "${WALLPAPER}" "${COLOR_NORMAL}" "${COLOR_HIGHLIGHT}"; then
exit 0
fi

# Finally, if all of the above fails, use the default theme.
set_default_theme/etc/grub.d/10_linux

#! /bin/sh
set -e

# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.

prefix="/usr"
exec_prefix="${prefix}"
datarootdir="${prefix}/share"

. "${datarootdir}/grub/grub-mkconfig_lib"

export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"

CLASS="--class gnu-linux --class gnu --class os"

if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
else
OS="${GRUB_DISTRIBUTOR}"
CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
fi

# loop-AES arranges things so that /dev/loop/X can be our root device, but
# the initrds that Linux uses don't like that.
case ${GRUB_DEVICE} in
/dev/loop/*|/dev/loop[0-9])
GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
# We can't cope with devices loop-mounted from files here.
case ${GRUB_DEVICE} in
/dev/*) ;;
*) exit 0 ;;
esac
;;
esac

if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
|| ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
|| uses_abstraction "${GRUB_DEVICE}" lvm; then
LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi

GRUBFS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`"

if [ x"$GRUBFS" = x ]; then
GRUBFS="$(stat -f --printf=%T / || true)"
fi

case x"$GRUBFS" in
xbtrfs)
rootsubvol="`make_system_path_relative_to_its_root /`"
rootsubvol="${rootsubvol#/}"
if [ "x${rootsubvol}" != x ]; then
GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
fi;;
xzfs)
rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`
bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"
LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs}"
;;
esac

title_correction_code=

for word in $GRUB_CMDLINE_LINUX_DEFAULT; do
if [ "$word" = splash ]; then
GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT \$vt_handoff"
fi
done

# add crashkernel option if we have the required tools
if [ -x "/usr/bin/makedumpfile" ] && [ -x "/sbin/kexec" ]; then
GRUB_CMDLINE_EXTRA="$GRUB_CMDLINE_EXTRA crashkernel=384M-2G:64M,2G-:128M"
fi

linux_entry ()
{
os="$1"
version="$2"
type="$3"
args="$4"

if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
fi
if [ x$type != xsimple ] ; then
case $type in
recovery)
title="$(gettext_printf "%s, with Linux %s (recovery mode)" "${os}" "${version}")" ;;
*)
title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;;
esac
if [ x"$title" = x"$GRUB_ACTUAL_DEFAULT" ] || [ x"Previous Linux versions>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then
replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')"
quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)"
title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;"
grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")"
fi
echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
else
echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
fi
echo "recordfail" | sed "s/^/$submenu_indentation/"
if [ x$type != xrecovery ] ; then
save_default_entry | sed -e "s/^/\t/"

echo " gfxmode \$linux_gfx_mode" | sed "s/^/$submenu_indentation/"
fi

echo " insmod gzio" | sed "s/^/$submenu_indentation/"

if [ x$dirname = x/ ]; then
if [ -z "${prepare_root_cache}" ]; then
prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/")"
fi
printf '%s\n' "${prepare_root_cache}" | sed "s/^/$submenu_indentation/"
else
if [ -z "${prepare_boot_cache}" ]; then
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
fi
printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
fi
if [ x$type != xsimple ]; then
message="$(gettext_printf "Loading Linux %s ..." ${version})"
sed "s/^/$submenu_indentation/" << EOF
echo '$(echo "$message" | grub_quote)'
EOF
fi
if test -d /sys/firmware/efi && test -e "${linux}.efi.signed"; then
sed "s/^/$submenu_indentation/" << EOF
linux ${rel_dirname}/${basename}.efi.signed root=${linux_root_device_thisversion} ro ${args}
EOF
else
sed "s/^/$submenu_indentation/" << EOF
linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
EOF
fi
if test -n "${initrd}" ; then
# TRANSLATORS: ramdisk isn't identifier. Should be translated.
if [ x$type != xsimple ]; then
message="$(gettext_printf "Loading initial ramdisk ...")"
sed "s/^/$submenu_indentation/" << EOF
echo '$(echo "$message" | grub_quote)'
EOF
fi
sed "s/^/$submenu_indentation/" << EOF
initrd ${rel_dirname}/${initrd}
EOF
fi
sed "s/^/$submenu_indentation/" << EOF
}
EOF
}

machine=`uname -m`
case "x$machine" in
xi?86 | xx86_64)
list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
done` ;;
*)
list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
done` ;;
esac

case "$machine" in
i?86) GENKERNEL_ARCH="x86" ;;
mips|mips64) GENKERNEL_ARCH="mips" ;;
mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;;
arm*) GENKERNEL_ARCH="arm" ;;
*) GENKERNEL_ARCH="$machine" ;;
esac

prepare_boot_cache=
prepare_root_cache=
boot_device_id=
title_correction_code=

cat << 'EOF'
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
EOF

# Use ELILO's generic "efifb" when it's known to be available.
# FIXME: We need an interface to select vesafb in case efifb can't be used.
if [ "x$GRUB_GFXPAYLOAD_LINUX" != x ]; then
echo "set linux_gfx_mode=$GRUB_GFXPAYLOAD_LINUX"
else
cat << EOF
if [ "\${recordfail}" != 1 ]; then
if [ -e \${prefix}/gfxblacklist.txt ]; then
if hwmatch \${prefix}/gfxblacklist.txt 3; then
if [ \${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
EOF
fi
cat << EOF
export linux_gfx_mode
if [ "\${linux_gfx_mode}" != "text" ]; then load_video; fi
EOF

# Extra indentation to add to menu entries in a submenu. We're not in a submenu
# yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
submenu_indentation=""

is_first_entry=true
while [ "x$list" != "x" ] ; do
linux=`version_find_latest $list`
case $linux in
*.efi.signed)
# We handle these in linux_entry.
list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
continue
;;
esac
gettext_printf "Found linux image: %s\n" "$linux" >&2
basename=`basename $linux`
dirname=`dirname $linux`
rel_dirname=`make_system_path_relative_to_its_root $dirname`
version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
alt_version=`echo $version | sed -e "s,\.old$,,g"`
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"

initrd=
for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
"initrd-${version}" "initramfs-${version}.img" \
"initrd.img-${alt_version}" "initrd-${alt_version}.img" \
"initrd-${alt_version}" "initramfs-${alt_version}.img" \
"initramfs-genkernel-${version}" \
"initramfs-genkernel-${alt_version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
if test -e "${dirname}/${i}" ; then
initrd="$i"
break
fi
done

config=
for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
if test -e "${i}" ; then
config="${i}"
break
fi
done

initramfs=
if test -n "${config}" ; then
initramfs=`grep CONFIG_INITRAMFS_SOURCE= "${config}" | cut -f2 -d= | tr -d \"`
fi

if test -n "${initrd}" ; then
gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2
elif test -z "${initramfs}" ; then
# "UUID=" and "ZFS=" magic is parsed by initrd or initramfs. Since there's
# no initrd or builtin initramfs, it can't work here.
linux_root_device_thisversion=${GRUB_DEVICE}
fi

if [ "x$is_first_entry" = xtrue ]; then
linux_entry "${OS}" "${version}" simple \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}"

submenu_indentation="\t"

if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
fi
# TRANSLATORS: %s is replaced with an OS name
echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"
fi

linux_entry "${OS}" "${version}" advanced \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}"
if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
if [ -x /lib/recovery-mode/recovery-menu ]; then
linux_entry "${OS}" "${version}" recovery \
"recovery nomodeset ${GRUB_CMDLINE_LINUX}"
else
linux_entry "${OS}" "${version}" recovery \
"single nomodeset ${GRUB_CMDLINE_LINUX}"
fi
fi

list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
is_first_entry=false
done

# If at least one kernel was found, then we need to
# add a closing '}' for the submenu command.
if [ x"$is_first_entry" != xtrue ]; then
echo '}'
fi

echo "$title_correction_code"

/etc/grub.d/30_os-prober

#! /bin/sh
set -e

# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.

prefix="/usr"
exec_prefix="${prefix}"
datarootdir="${prefix}/share"

export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"

. "${datarootdir}/grub/grub-mkconfig_lib"

found_other_os=

make_timeout () {
if [ "x${found_other_os}" = "x" ] ; then
if [ "x${1}" != "x" ] ; then
if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
verbose=
else
verbose=" --verbose"
fi

if [ "x${1}" = "x0" ] ; then
cat <<EOF
if [ "x\${timeout}" != "x-1" ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep$verbose --interruptible 3 ; then
set timeout=0
fi
fi
fi
EOF
else
cat << EOF
if [ "x\${timeout}" != "x-1" ]; then
if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
set timeout=0
fi
fi
EOF
fi
fi
fi
}

adjust_timeout () {
if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
cat <<EOF
if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
EOF
make_timeout "${GRUB_HIDDEN_TIMEOUT_BUTTON}" "${GRUB_TIMEOUT_BUTTON}"
echo else
make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
echo fi
else
make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
fi
}

if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
adjust_timeout
exit 0
fi

if [ -z "`which os-prober 2> /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then
# missing os-prober and/or linux-boot-prober
adjust_timeout
exit 0
fi

OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`"
if [ -z "${OSPROBED}" ] ; then
# empty os-prober output, nothing doing
adjust_timeout
exit 0
fi

osx_entry() {
found_other_os=1
if [ x$2 = x32 ]; then
# TRANSLATORS: it refers to kernel architecture (32-bit)
bitstr="$(gettext "(32-bit)")"
else
# TRANSLATORS: it refers to kernel architecture (64-bit)
bitstr="$(gettext "(64-bit)")"
fi
# TRANSLATORS: it refers on the OS residing on device %s
onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
cat << EOF
menuentry '$(echo "${LONGNAME} $bitstr $onstr" | grub_quote)' --class osx --class darwin --class os \$menuentry_id_option 'osprober-xnu-$2-$(grub_get_device_id "${DEVICE}")' {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
cat << EOF
load_video
set do_resume=0
if [ /var/vm/sleepimage -nt10 / ]; then
if xnu_resume /var/vm/sleepimage; then
set do_resume=1
fi
fi
if [ \$do_resume = 0 ]; then
xnu_uuid ${OSXUUID} uuid
if [ -f /Extra/DSDT.aml ]; then
acpi -e /Extra/DSDT.aml
fi
if [ /kernelcache -nt /System/Library/Extensions ]; then
$1 /kernelcache boot-uuid=\${uuid} rd=*uuid
else
$1 /mach_kernel boot-uuid=\${uuid} rd=*uuid
if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
xnu_mkext /System/Library/Extensions.mkext
else
xnu_kextdir /System/Library/Extensions
fi
fi
if [ -f /Extra/Extensions.mkext ]; then
xnu_mkext /Extra/Extensions.mkext
fi
if [ -d /Extra/Extensions ]; then
xnu_kextdir /Extra/Extensions
fi
if [ -f /Extra/devprop.bin ]; then
xnu_devprop_load /Extra/devprop.bin
fi
if [ -f /Extra/splash.jpg ]; then
insmod jpeg
xnu_splash /Extra/splash.jpg
fi
if [ -f /Extra/splash.png ]; then
insmod png
xnu_splash /Extra/splash.png
fi
if [ -f /Extra/splash.tga ]; then
insmod tga
xnu_splash /Extra/splash.tga
fi
fi
}
EOF
}

used_osprober_linux_ids=

wubi=

for OS in ${OSPROBED} ; do
DEVICE="`echo ${OS} | cut -d ':' -f 1`"
LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`"
LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`"
BOOT="`echo ${OS} | cut -d ':' -f 4`"

if [ -z "${LONGNAME}" ] ; then
LONGNAME="${LABEL}"
fi

gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&2

case ${BOOT} in
chain)

case ${LONGNAME} in
Windows*)
if [ -z "$wubi" ]; then
if [ -x /usr/share/lupin-support/grub-mkimage ] && \
/usr/share/lupin-support/grub-mkimage --test; then
wubi=yes
else
wubi=no
fi
fi
if [ "$wubi" = yes ]; then
echo "Skipping ${LONGNAME} on Wubi system" >&2
continue
fi
;;
esac

found_other_os=1
onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
cat << EOF
menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"

case ${LONGNAME} in
Windows\ Vista*|Windows\ 7*|Windows\ Server\ 2008*)
;;
*)
cat << EOF
drivemap -s (hd0) \${root}
EOF
;;
esac

cat <<EOF
chainloader +1
}
EOF
;;
linux)
LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
prepare_boot_cache=
boot_device_id=
is_first_entry=true
title_correction_code=
OS="${LONGNAME}"

for LINUX in ${LINUXPROBED} ; do
LROOT="`echo ${LINUX} | cut -d ':' -f 1`"
LBOOT="`echo ${LINUX} | cut -d ':' -f 2`"
LLABEL="`echo ${LINUX} | cut -d ':' -f 3 | tr '^' ' '`"
LKERNEL="`echo ${LINUX} | cut -d ':' -f 4`"
LINITRD="`echo ${LINUX} | cut -d ':' -f 5`"
LPARAMS="`echo ${LINUX} | cut -d ':' -f 6- | tr '^' ' '`"

if [ -z "${LLABEL}" ] ; then
LLABEL="${LONGNAME}"
fi

if [ "${LROOT}" != "${LBOOT}" ]; then
LKERNEL="${LKERNEL#/boot}"
LINITRD="${LINITRD#/boot}"
fi

if [ -z "${prepare_boot_cache}" ]; then
prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")"
[ "${prepare_boot_cache}" ] || continue
fi

found_other_os=1
onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
recovery_params="$(echo "${LPARAMS}" | grep 'single\|recovery')" || true
counter=1
while echo "$used_osprober_linux_ids" | grep 'osprober-gnulinux-$LKERNEL-${recovery_params}-$counter-$boot_device_id' > /dev/null; do
counter=$((counter+1));
done
if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${DEVICE}")"
fi
used_osprober_linux_ids="$used_osprober_linux_ids 'osprober-gnulinux-$LKERNEL-${recovery_params}-$counter-$boot_device_id'"

if [ "x$is_first_entry" = xtrue ]; then
cat << EOF
menuentry '$(echo "$OS" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' {
EOF
save_default_entry | sed -e "s/^/\t/"
printf '%s\n' "${prepare_boot_cache}"
cat << EOF
linux ${LKERNEL} ${LPARAMS}
EOF
if [ -n "${LINITRD}" ] ; then
cat << EOF
initrd ${LINITRD}
EOF
fi
cat << EOF
}
EOF
echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'osprober-gnulinux-advanced-$boot_device_id' {"
is_first_entry=false
fi
title="${LLABEL} $onstr"
cat << EOF
menuentry '$(echo "$title" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-$LKERNEL-${recovery_params}-$boot_device_id' {
EOF
save_default_entry | sed -e "s/^/\t\t/"
printf '%s\n' "${prepare_boot_cache}" | sed -e "s/^/\t/"
cat << EOF
linux ${LKERNEL} ${LPARAMS}
EOF
if [ -n "${LINITRD}" ] ; then
cat << EOF
initrd ${LINITRD}
EOF
fi
cat << EOF
}
EOF
if [ x"$title" = x"$GRUB_ACTUAL_DEFAULT" ] || [ x"Previous Linux versions>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then
replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')"
quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)"
title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;"
grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")"
fi
done
if [ x"$is_first_entry" != xtrue ]; then
echo '}'
fi
echo "$title_correction_code"
;;
macosx)
OSXUUID="`${grub_probe} --target=fs_uuid --device ${DEVICE} 2> /dev/null`"
osx_entry xnu_kernel 32
osx_entry xnu_kernel64 64
;;
hurd)
found_other_os=1
onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
cat << EOF
menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class hurd --class gnu --class os \$menuentry_id_option 'osprober-gnuhurd-/boot/gnumach.gz-false-$(grub_get_device_id "${DEVICE}")' {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
grub_device="`${grub_probe} --device ${DEVICE} --target=drive`"
mach_device="`echo "${grub_device}" | sed -e 's/(\(hd.*\),msdos\(.*\))/\1s\2/'`"
grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`"
case "${grub_fs}" in
*fs) hurd_fs="${grub_fs}" ;;
*) hurd_fs="${grub_fs}fs" ;;
esac
cat << EOF
multiboot /boot/gnumach.gz root=device:${mach_device}
module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\
--multiboot-command-line='\${kernel-command-line}' \\
--host-priv-port='\${host-port}' \\
--device-master-port='\${device-port}' \\
--exec-server-task='\${exec-task}' -T typed '\${root}' \\
'\$(task-create)' '\$(task-resume)'
module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
}
EOF
;;
*)
echo -n " "
# TRANSLATORS: %s is replaced by OS name.
gettext_printf "%s is not yet supported by grub-mkconfig.\n" "${LONGNAME}" >&2
;;
esac
done

adjust_timeout

Cavsfan
October 30th, 2012, 10:13 PM
Hi!, Cavsfan,

Thanks again. I am not sure what to look for in /etc/fstab, it looks much like yours except there is a entry for /home, and for some reason it also lists the Swap from the 12.10 USB, but not the one from 12.10 sdb7 [perhaps the later was not mounted].
alan@alan-MS-7616:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
[Text deleted]
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda10 during installation
UUID=b5aab3a2-0086-4a12-9276-46bb5a615038 / ext4 errors=remount-ro 0 1
# /home was on /dev/sda11 during installation
UUID=adc771a1-313c-47ae-8725-3c89b89bbfa2 /home ext4 defaults 0 2
# swap was on /dev/sda6 during installation
UUID=a74af1d9-f7f9-4453-97e7-b9e3f370dca4 none swap sw 0 0
# swap was on /dev/sdb3 during installation
UUID=9a74bb15-1215-4774-8419-f2908ee62d2e none swap sw 0 0
alan@alan-MS-7616:~$I have one virgin 12.10 installation in which I deliberately did not run Grub Customizer, so it would be 12.04.1 for which I might need the grub files.

Presumably I will need to replace the files in all the other installations, as they interact; as well as deleting all the Grub Customizer files.

Chao!, bogan.

Bogan,
You should only have whatever is for the system you are logged into in fstab.
It looks like you have 2 swaps and you should only have one. If you originally set it up with / and home, you should have those 2 plus the swap file for that system.

You should also not have that [Text deleted] comment as it does not have # before it.
As I installed each additional system fstab pulled in all of the swap files and I had to edit it gksu gedit /etc/fstab each time.

Labelling the partition is especially helpful when you have multiple systems.
It is mentioned in 1.6 of the wiki but, here is the command:
sudo tune2fs -L Quantal /dev/sda7
You can probably use the files I posted above. Let me know if you need anything else.

Ciao!

bogan
October 31st, 2012, 11:41 AM
Hi!, Cavsfan,

I copy/pasted the contents of /etc/fstab and Posted it, [after deleting the text paragraph to make it smaller - the " [Text deleted]" was my addition -.

This morning after reading your two Posts, I went to /etc/fstab in all the Ubuntu installations on this computer and found most of them had 3 or 4 extra swap entries, which I deleted.

Edit. Some of them were for partitions on HDDisks that no longer exist!

It will be interesting to see if it makes any difference.

Running the 'new command' on an OS that had not run grub Customizer worked correctly, showing all the Alternative options and partition labels.

Could you please explain the command "sudo tune2fs -L Quantal /dev/sda7"
Where, in what file does it place the title?
Does it have to be run from each of the Os to be titled?
Will it work in the standard Grub2 +Grub Customizer set-up? or only with your system?

I guess I need to study your Wiki in more detail.

Chao!, bogan.

.

Cavsfan
October 31st, 2012, 02:31 PM
Hi!, Cavsfan,

I copy/pasted the contents of /etc/fstab and Posted it, [after deleting the text paragraph to make it smaller - the " [Text deleted]" was my addition -.

This morning after reading your two Posts, I went to /etc/fstab in all the Ubuntu installations on this computer and found most of them had 3 or 4 extra swap entries, which I deleted.

Edit. Some of them were for partitions on HDDisks that no longer exist!

It will be interesting to see if it makes any difference.

Running the 'new command' on an OS that had not run grub Customizer worked correctly, showing all the Alternative options and partition labels.

Could you please explain the command "sudo tune2fs -L Quantal /dev/sda7"
Where, in what file does it place the title?
Does it have to be run from each of the Os to be titled?
Will it work in the standard Grub2 +Grub Customizer set-up? or only with your system?

I guess I need to study your Wiki in more detail.

Chao!, bogan.

.

That is exactly what happened to me: each time I installed or reinstalled a Ubuntu the fstab for that installation would contain the old original swap file,
the new one and all of the swap files from every other Ubuntu on my machine.

This is why I thought it necessary to add that info in 1.7 of the wiki.

The label command drs305 also gave me. It makes partitions easier to identify rather than looking at a UUID.
Here his my output of sudo blkid:

/dev/sda1: LABEL="C:" UUID="1CFC7A8DFC7A60C6" TYPE="ntfs"
/dev/sda2: LABEL="Lucid" UUID="a162dc8a-e4df-4b79-b4c3-524761ff7ae1" TYPE="ext4"
/dev/sda3: UUID="2a80f59e-e7c3-418e-aab2-ab5d19255a2f" TYPE="swap"
/dev/sda5: LABEL="Precise" UUID="3b8b1954-24e6-4a5e-9074-70a1a94ed4be" TYPE="ext4"
/dev/sda6: UUID="82c51b29-023f-4964-99b6-67b45a49527f" TYPE="swap"
/dev/sda7: LABEL="Quantal" UUID="b5fc902c-0bf0-45b3-95a1-29f3c46dfe6a" TYPE="ext4"
/dev/sda8: UUID="69ac3efc-8a8a-4056-89e0-59bb81c2f468" TYPE="swap"
/dev/sda9: LABEL="Lucid-Generic" UUID="109c11d0-71e3-41a4-87da-9e81535499a5" TYPE="ext4"
/dev/sda10: UUID="24aa8c8b-53dc-4ecc-852b-ff2c25c8b342" TYPE="swap"
/dev/sda11: LABEL="Precise-Generic" UUID="50104efb-d918-45a9-985e-a70c60e87ac0" TYPE="ext4"
/dev/sda12: UUID="139390a6-2fe1-4ff2-b650-88ae3b0586c1" TYPE="swap"
/dev/sda13: UUID="580e8c62-78ce-44a2-93e3-ccebd37c3acc" TYPE="ext4" LABEL="Quantal-Generic"
/dev/sda14: UUID="ec3048b8-c644-435a-93bb-08bb4975d0db" TYPE="swap"
/dev/sdb1: LABEL="Fantom" UUID="78B8D1A1B8D15DE6" TYPE="ntfs" As you can see Quantal is installed on /dev/sda7 and the above command was used to add the label.
Since it must be run as sudo, it can be run from any installation.

Example: sudo tune2fs -L {label} {devicename}.

So, when I login to Lucid for example, I see a partition (drive) named Precise, Quantal, etc.
It would probably just show the UUID otherwise. Which would make it a lot more difficult to identify.

bogan
October 31st, 2012, 06:37 PM
Hi!, Cavsfan,

WoW! "sudo tune2fs -L Quantal /dev/sda7" looks like just what I need, the problem with duplicates is made worse because they just say: eg"Ubuntu 12.10 (12.10)", and the only way to know which of three 12.10s on the computer, each refer to, is to use 'e' edit in the Grub Menu and check out the 'hd1:msdos7' entry in the script.

Similarly in Grub Customizer, there is no telling which is which, as the entries do not stay in the same order in the menu.

One more question: in: 'sudo tune2fs -L {label} {devicename}', can the 'label' have spaces in it? & if so, must the label be in quotes? For instance: "Quantal on USB". Or should I add a hyphen as you have used?

I do not think I need the Grub files, as when Grub Customer replaces them with Proxy versions, the originals are saved in a 'proxifiedScripts' folder, but without their numbers.

At the moment, things are not going well: the USB 12.10 with no GC, which previously was exempt from the duplicates problem, has suddenly produced two duplicates in its own grub menu, and two duplicates of its entries have appeared in the grub menu of my main Ubuntu OS: Whilst the grub menu of 11.10 has no less than 24 entries, where there should only be seven [ or 12 with recoveries] and my main OS had 34!.

For the moment I have fixed things by editing /boot/grub/grub.cfg in my main OS, but of course, that will not survive a kernal update or update-grub.

Sorry to be such a persistent nuisance.

Chao!, bogan.

Cavsfan
October 31st, 2012, 08:23 PM
Hi!, Cavsfan,

WoW! "sudo tune2fs -L Quantal /dev/sda7" looks like just what I need, the problem with duplicates is made worse because they just say: eg"Ubuntu 12.10 (12.10)", and the only way to know which of three 12.10s on the computer, each refer to, is to use 'e' edit in the Grub Menu and check out the 'hd1:msdos7' entry in the script.

Similarly in Grub Customizer, there is no telling which is which, as the entries do not stay in the same order in the menu.

One more question: in: 'sudo tune2fs -L {label} {devicename}', can the 'label' have spaces in it? & if so, must the label be in quotes? For instance: "Quantal on USB". Or should I add a hyphen as you have used?

I do not think I need the Grub files, as when Grub Customer replaces them with Proxy versions, the originals are saved in a 'proxifiedScripts' folder, but without their numbers.

At the moment, things are not going well: the USB 12.10 with no GC, which previously was exempt from the duplicates problem, has suddenly produced two duplicates in its own grub menu, and two duplicates of its entries have appeared in the grub menu of my main Ubuntu OS: Whilst the grub menu of 11.10 has no less than 24 entries, where there should only be seven [ or 12 with recoveries] and my main OS had 34!.

For the moment I have fixed things by editing /boot/grub/grub.cfg in my main OS, but of course, that will not survive a kernal update or update-grub.

Sorry to be such a persistent nuisance.

Chao!, bogan.

I think the label command will work with spaces if you put quotes around the text. I would just use sudo tune2fs -L "Quantal on USB" /dev/sda7 and that will work.
As a matter of fact I believe the quotes work better.
I just changed all my generic installs with spaces in between. And that is how they appear when I click on Places.


/dev/sda1: LABEL="C:" UUID="1CFC7A8DFC7A60C6" TYPE="ntfs"
/dev/sda2: LABEL="Lucid" UUID="a162dc8a-e4df-4b79-b4c3-524761ff7ae1" TYPE="ext4"
/dev/sda3: UUID="2a80f59e-e7c3-418e-aab2-ab5d19255a2f" TYPE="swap"
/dev/sda5: LABEL="Precise" UUID="3b8b1954-24e6-4a5e-9074-70a1a94ed4be" TYPE="ext4"
/dev/sda6: UUID="82c51b29-023f-4964-99b6-67b45a49527f" TYPE="swap"
/dev/sda7: LABEL="Quantal" UUID="b5fc902c-0bf0-45b3-95a1-29f3c46dfe6a" TYPE="ext4"
/dev/sda8: UUID="69ac3efc-8a8a-4056-89e0-59bb81c2f468" TYPE="swap"
/dev/sda9: LABEL="Lucid Generic" UUID="109c11d0-71e3-41a4-87da-9e81535499a5" TYPE="ext4"
/dev/sda10: UUID="24aa8c8b-53dc-4ecc-852b-ff2c25c8b342" TYPE="swap"
/dev/sda11: LABEL="Precise Generic" UUID="50104efb-d918-45a9-985e-a70c60e87ac0" TYPE="ext4"
/dev/sda12: UUID="139390a6-2fe1-4ff2-b650-88ae3b0586c1" TYPE="swap"
/dev/sda13: UUID="580e8c62-78ce-44a2-93e3-ccebd37c3acc" TYPE="ext4" LABEL="Quantal Generic"
/dev/sda14: UUID="ec3048b8-c644-435a-93bb-08bb4975d0db" TYPE="swap"
/dev/sdb1: LABEL="Fantom" UUID="78B8D1A1B8D15DE6" TYPE="ntfs"Never used the grub-customizer myself. I have always preferred my way which ranch hand taught me.
He is a pretty smart guy with Ubuntu and Linux!

Other than making a couple mods to 2-3 files the big thing is /etc/grub.d/06_custom (saved from 40_custom).

Here is the contents of my 06_custom file in Quantal and it displays what I want it to display with no exceptions.


#!/bin/sh
echo 1>&2 "Adding Ubuntu Lucid Lynx 10.04, Precise Pangolin 12.04, Quantal Quetzal 12.10 and Windows 7"
exec tail -n +4 $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 "Lycid Lynx 10.04" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro quiet splash
initrd /initrd.img
}
menuentry "Lycid Lynx 10.04 (Recovery Mode)" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro single
initrd /initrd.img
}
menuentry "Lycid Lynx Generic 10.04" {
set root=(hd0,9)
linux /vmlinuz root=/dev/sda9 ro quiet splash
initrd /initrd.img
}
menuentry "Lycid Lynx Generic 10.04 (Recovery Mode)" {
set root=(hd0,9)
linux /vmlinuz root=/dev/sda9 ro single
initrd /initrd.img
}
menuentry "Precise Pangolin 12.04" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro quiet splash
initrd /initrd.img
}
menuentry "Precise Pangolin 12.04 (Recovery Mode)" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro single
initrd /initrd.img
}
menuentry "Precise Pangolin Generic 12.04" {
set root=(hd0,11)
linux /vmlinuz root=/dev/sda11 ro quiet splash
initrd /initrd.img
}
menuentry "Precise Pangolin Generic 12.04 (Recovery Mode)" {
set root=(hd0,11)
linux /vmlinuz root=/dev/sda11 ro single
initrd /initrd.img
}
menuentry "Quantal Quetzal 12.10" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro quiet splash
initrd /initrd.img
}
menuentry "Quantal Quetzal 12.10 (Recovery Mode)" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro single
initrd /initrd.img
}
menuentry "Quantal Quetzal Generic 12.10" {
set root=(hd0,13)
linux /vmlinuz root=/dev/sda13 ro quiet splash
initrd /initrd.img
}
menuentry "Quantal Quetzal Generic 12.10 (Recovery Mode)" {
set root=(hd0,13)
linux /vmlinuz root=/dev/sda13 ro single
initrd /initrd.img
}
menuentry "Windows 7" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 1CFC7A8DFC7A60C6
chainloader +1
}Other than changing what is in red, you would just change what is between the quotes to whatever you want
because you will be the only one that sees it.

Then making it executable sudo chmod +x /etc/grub.d/06_custom and
then sudo update-grub of course.

And you are not a nuisance! You wouldn't believe how long it took me to work up the courage to make these changes to my machine!
But, I am glad I did. You see my screen above and they are the same on all three installs. The 06_custom file above matches what is displayed on my pictures above.
Since I am leaving the generic installs untouched but, they still are bootable from where my grub is installed.
I have customized all three Ubuntus for the wiki but, I have my boot grub2 on Lucid which is on a primary partition.

EDIT: In answer to your question, I would get all the grub files back to their original state before I tried my method.
I don't think my method will work on files that have been customized by grub-customizer.
If you need anything other than what I already posted above just let me know.

Cavsfan
October 31st, 2012, 08:59 PM
After you get all of your grub files back to default.

First enter this in terminal to create the font. You will see errors but, it will still work:


sudo grub-mkfont --output=/boot/grub/DejaVuSansMono.pf2 \
--size=24 /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf
Here are my files on Quantal with the changes/additions in red:
gksu gedit /etc/default/grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=12
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=60
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_FONT=/boot/grub/DejaVuSansMono.pf2

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1920x1200-24

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"The red 12 indicates the default which is the 13 line down (windows 7) for my wife.


cavsfan@cavsfan-desktop:~$ grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0
0 menuentry "Lucid Lynx" {
1 menuentry "Lucid Lynx (Recovery Mode)" {
2 menuentry "Lucid Lynx Generic" {
3 menuentry "Lucid Lynx Generic (Recovery Mode)" {
4 menuentry "Precise Pangolin 12.04" {
5 menuentry "Precise Pangolin 12.04 (Recovery Mode)" {
6 menuentry "Precise Pangolin Generic 12.04" {
7 menuentry "Precise Pangolin 12.04 Generic (Recovery Mode)" {
8 menuentry "Quantal Quetzel 12.10" {
9 menuentry "Quantal Quetzel 12.10 (Recovery Mode)" {
10 menuentry "Quantal Quetzel Generic 12.10" {
11 menuentry "Quantal Quetzel 12.10 Generic (Recovery Mode)" {
12 menuentry "Windows 7" {I have a 60 second timeout because I am slow sometimes and need that time. Then there is my screen resolution 1920x1200-24 (24 is color bit depth).
Then there is also the font line that has to be added.

You must move 1 picture that is the resolution of your screen into /boot/grub/.
sudo cp picture.jpg /boot/grub/ The picture will not display unless it is precisely as specified by GRUB_GFXMODE above.

The following is dependant on finding that picture in that directory. It can be a .png .jpg .tga or .jpeg picture.

/etc/grub.d/05_debian_theme
(just 2 lines added after line 108:)


#!/bin/sh
set -e

# grub-mkconfig helper script.
# Copyright (C) 2010 Alexander Kurtz <kurtz.alex@googlemail.com>
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.

# Include the GRUB helper library for grub-mkconfig.
. /usr/share/grub/grub-mkconfig_lib

# We want to work in /boot/grub/ only.
test -d /boot/grub; cd /boot/grub

# Set the location of a possibly necessary cache file for the background image.
# NOTE: This MUST BE A DOTFILE to avoid confusing it with user-defined images.
BACKGROUND_CACHE=".background_cache"

set_default_theme(){
# Set a monochromatic theme for Ubuntu.
echo "${1}set menu_color_normal=white/black"
echo "${1}set menu_color_highlight=black/light-gray"

if [ -e /lib/plymouth/themes/default.grub ]; then
sed "s/^/${1}/" /lib/plymouth/themes/default.grub
fi
}

module_available(){
local module
for module in "${1}.mod" */"${1}.mod"; do
if [ -f "${module}" ]; then
return 0
fi
done
return 1
}

set_background_image(){
# Step #1: Search all available output modes ...
local output
for output in ${GRUB_TERMINAL_OUTPUT}; do
if [ "x$output" = "xgfxterm" ]; then
break
fi
done

# ... and check if we are able to display a background image at all.
if ! [ "x${output}" = "xgfxterm" ]; then
return 1
fi

# Step #2: Check if the specified background image exists.
if ! [ -f "${1}" ]; then
return 2
fi

# Step #3: Search the correct GRUB module for our background image.
local reader
case "${1}" in
*.jpg|*.JPG|*.jpeg|*.JPEG) reader="jpeg";;
*.png|*.PNG) reader="png";;
*.tga|*.TGA) reader="tga";;
*) return 3;; # Unknown image type.
esac

# Step #4: Check if the necessary GRUB module is available.
if ! module_available "${reader}"; then
return 4
fi

# Step #5: Check if GRUB can read the background image directly.
# If so, we can remove the cache file (if any). Otherwise the backgound
# image needs to be cached under /boot/grub/.
if is_path_readable_by_grub "${1}"; then
rm --force "${BACKGROUND_CACHE}.jpeg" \
"${BACKGROUND_CACHE}.png" "${BACKGROUND_CACHE}.tga"
elif cp "${1}" "${BACKGROUND_CACHE}.${reader}"; then
set -- "${BACKGROUND_CACHE}.${reader}" "${2}" "${3}"
else
return 5
fi

# Step #6: Prepare GRUB to read the background image.
if ! prepare_grub_to_access_device "`${grub_probe} --target=device "${1}"`"; then
return 6
fi

# Step #7: Everything went fine, print out a message to stderr ...
echo "Found background image: ${1}" >&2

# ... and write our configuration snippet to stdout. Use the colors
# desktop-base specified. If we're using a user-defined background, use
# the default colors since we've got no idea how the image looks like.
# If loading the background image fails, use the default theme.
echo "insmod ${reader}"
echo "if background_image `make_system_path_relative_to_its_root "${1}"`; then"
echo " set color_normal=cyan/black"
echo " set color_highlight=light-red/black"
if [ -n "${2}" ]; then
echo " set color_normal=${2}"
fi
if [ -n "${3}" ]; then
echo " set color_highlight=${3}"
fi
if [ -z "${2}" ] && [ -z "${3}" ]; then
echo " true"
fi
echo "else"
set_default_theme " "
echo "fi"
}

# Earlier versions of grub-pc copied the default background image to /boot/grub
# during postinst. Remove those obsolete images if they haven't been touched by
# the user. They are still available under /usr/share/images/desktop-base/ if
# desktop-base is installed.
while read checksum background; do
if [ -f "${background}" ] && [ "x`sha1sum "${background}"`" = "x${checksum} ${background}" ]; then
echo "Removing old background image: ${background}" >&2
rm "${background}"
fi
done <<EOF
648ee65dd0c157a69b019a5372cbcfea4fc754a5 debian-blueish-wallpaper-640x480.png
0431e97a6c661084c59676c4baeeb8c2f602edb8 debian-blueish-wallpaper-640x480.png
968ecf6696c5638cfe80e8e70aba239526270864 debian-blueish-wallpaper-640x480.tga
11143e8c92a073401de0b0fd42d0c052af4ccd9b moreblue-orbit-grub.png
d00d5e505ab63f2d53fa880bfac447e2d3bb197c moreblue-orbit-grub.png
f5b12c1009ec0a3b029185f6b66cd0d7e5611019 moreblue-orbit-grub.png
EOF

# Include the configuration of desktop-base if available.
if [ -f "/usr/share/desktop-base/grub_background.sh" ]; then
. "/usr/share/desktop-base/grub_background.sh"
fi

# First check whether the user has specified a background image explicitly.
# If so, try to use it. Don't try the other possibilities in that case
# (#608263).
if [ -n "${GRUB_BACKGROUND+x}" ]; then
set_background_image "${GRUB_BACKGROUND}" || set_default_theme
exit 0
fi

# Next search for pictures the user put into /boot/grub/ and use the first one.
for background in *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.tga *.TGA; do
if set_background_image "${background}"; then
exit 0
fi
done

# Next try to use the background image and colors specified by desktop-base.
if set_background_image "${WALLPAPER}" "${COLOR_NORMAL}" "${COLOR_HIGHLIGHT}"; then
exit 0
fi

# Finally, if all of the above fails, use the default theme.
set_default_themeThe custom menu entries will display at the top and after you are comfortable that they work
then you can make the rest of the files unexecutable as in 1.5 of the wiki.

bogan
November 1st, 2012, 11:04 PM
Hi!, Cavsfan,

I must have misunderstood you, as I thought using the "tune2fs -L" command would change the entry names in grub menu [ & in grub Customizer]. Big disappointment!!

The changes do show up in 'blkid' and in the left-hand Bookmarks list in Desktop Manager, - which is a great advantage - and also in Gparted, but strangely do not show up in Windows Disk manager.

I have reverted all the installations in this computer which had grub Customer and the results are that the grub menus now show the entries I expect, without any duplicates.

The duplicates are still there, however, and the 'new' grep menu entry command shows them in addition to those that actually display. which is rather disconcerting.
EDIT: I was wrong, the duplicates are there, but they are hidden in the Advanced Options sub-menus.

I have not altered the /etc/default/grub files and my grub backgrounds images are unchanged. Nor have I actually removed the Grub Customizer installlations, I have done just what Daniel Richter instructed in the GC 'How To'.

So I am all ready to take the plunge.

Chao!, bogan.

bogan
November 2nd, 2012, 07:08 PM
Hi!, Cavsfan,

1. Major query on your Wiki,"Making the custom Grub2 Menu entries", versions after Lucid.
For Lucid this does not apply as there is no 'echo' line, but it emphasises the first 5 lines must not be changed.

"Editing /etc/grub.d/40_custom:" section.
Instructions say: "first entry copied & pasted below the 5 lines above."

Example shows the 'echo' line as line2 between'#/bin/sh' and 'exec tail -n +3 $0'

2. Which UIID to use for Windows?
Your 'blkid' shows a single ntfs entry without a label, and the text says "You can see Windows is on sda1," whereas mine shows two entries, the first labeled "System Reseved" and the second "Boot".

Though Windows is actually on the Boot partition I checked the existing Grub menu script and the Windows entry shows the UUID of System Reserved being set. So I have done the same, as I understand it, the Windows bootloader is on the reserved partition, so that is what mus be set.

AFAIK. The separate System partition was introduced with Windows Vista, and is standard, perhaps not in XP.

3. Minor point: The illustration of blkid output with labels, is before the instruction for putting labels in. I found this very confusing at first reading, as my blkid showed partition labels yours did not, and no Linux labels, which yours displayed.

When I first tried the 'tune2fs -L' command I got a message about 'no magic number, could not find file system', not labeled.

All changes made except making the grub files not executeable and I am about to reboot and see what the result is.

Edit: The result was a disaster! This is what I got fromsudo update-grub:
root@alan-MS-7616:~# update-grub
Generating grub.cfg ...
Found background: /home/alan/Pictures/Lake_mapourika_NZ.tga
Found background image: /home/alan/Pictures/Lake_mapourika_NZ.tga
Found linux image: /boot/vmlinuz-3.5.0-18-generic
Found initrd image: /boot/initrd.img-3.5.0-18-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
Found Ubuntu 12.10 (12.10) on /dev/sda10
Found Windows Recovery Environment (loader) on /dev/sda4
Found Ubuntu 12.04.1 LTS (12.04) on /dev/sda5
Found Ubuntu 12.10 (12.10) on /dev/sdb7
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 127
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
root@alan-MS-7616:~# I am attaching my 06_custom file, I cannot see anything wrong other than that the (hd0,1) in the Windows entry is between single quotes as your is. [ I commented out the 'echo' line after this error.]

How can I tell what file the error in line 127 was found?
Edit2: Line 127 in /boot/grub/grub.cfg was the 'echo' line, with it commented out, sudo update-grub ran as above, but without errors.

Chao!, bogan.

The file would not upload, said: 'invalid file': maybe permissions were wrong- so here it is:
#!/bin/sh
exec tail -n +4 $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.
# echo "Adding Ubuntu Oneiric 10.10, Precise 12.04.1, Quantal 12.10 and Windows 7" >&2
menuentry "Quantal 12.10 USB sdc2" {
set root=(hd2,2)
linux /vmlinuz root=/dev/sdc2 ro quiet splash
initrd /initrd.img
}
menuentry "Quantal 12.10 USB sdc2 (Recovery)" {
set root=(hd2,2)
linux /vmlinuz root=/dev/sdc2 ro single
initrd /initrd.img
}
menuentry "Windows 7 on sda2" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set CC9240F39240E394
chainloader +1
}
menuentry "Quantal 12.10 sda10" {
set root=(hd0,10)
linux /vmlinuz root=/dev/sda10 ro quiet splash
initrd /initrd.img
}
menuentry "Quantal 12.10 sda10 (Recovery)" {
set root=(hd0,10)
linux /vmlinuz root=/dev/sda10 ro single
initrd /initrd.img
}
menuentry "Quantal 12.10 EXT sdb7" {
set root=(hd1,7)
linux /vmlinuz root=/dev/sdb7 ro quiet splash
initrd /initrd.img
}
menuentry "Quantal 12.10 EXT sdb7 (Recovery)" {
set root=(hd1,7)
linux /vmlinuz root=/dev/sdb7 ro single
initrd /initrd.img
}
menuentry "Precise 11.10 sda5" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro quiet splash
initrd /initrd.img
}
menuentry "Precise 11.10 sda5 (Recovery)" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro single
initrd /initrd.img
}

bogan
November 2nd, 2012, 08:47 PM
Hi!, Cavsfan,

First the good news: The new menu entries are AOK.

The new Windows menu entry works correctly, no error messages and no problems.

The bad news is: None of the Ubuntu entries work.

The sda10 & sda5 entries both say: 'No such partition', the others say: '"/vmlinuz not found".
Edit: Altering it to "/boot/vmlinuz" did not help, nor did adding the suffix '-3.5.0-18-generic'.
All the Ubuntu entries say: "Error: need to load the kernal first"

I am going to try altering (hd0,5) to (hd0,msdos5) & enclosing it in single quotes like the Windows entry.
Edit: neither changed anything.

Any advice earnestly awaited.

My guess is the Syntax error was because the alteration to the tail line was for the echo line to be line 2, or is it in the echo line itself.
Chao!, bogan.

Cavsfan
November 3rd, 2012, 03:10 PM
#!/bin/sh
exec tail -n +4 $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.
# echo "Adding Ubuntu Oneiric 10.10, Precise 12.04.1, Quantal 12.10 and Windows 7" >&2
menuentry "Quantal 12.10 USB sdc2" {
set root=(hd2,2)
linux /vmlinuz root=/dev/sdc2 ro quiet splash
initrd /initrd.img
}
menuentry "Quantal 12.10 USB sdc2 (Recovery)" {
set root=(hd2,2)
linux /vmlinuz root=/dev/sdc2 ro single
initrd /initrd.img
}
menuentry "Windows 7 on sda2" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set CC9240F39240E394
chainloader +1
}
menuentry "Quantal 12.10 sda10" {
set root=(hd0,10)
linux /vmlinuz root=/dev/sda10 ro quiet splash
initrd /initrd.img
}
menuentry "Quantal 12.10 sda10 (Recovery)" {
set root=(hd0,10)
linux /vmlinuz root=/dev/sda10 ro single
initrd /initrd.img
}
menuentry "Quantal 12.10 EXT sdb7" {
set root=(hd1,7)
linux /vmlinuz root=/dev/sdb7 ro quiet splash
initrd /initrd.img
}
menuentry "Quantal 12.10 EXT sdb7 (Recovery)" {
set root=(hd1,7)
linux /vmlinuz root=/dev/sdb7 ro single
initrd /initrd.img
}
menuentry "Precise 11.10 sda5" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro quiet splash
initrd /initrd.img
}
menuentry "Precise 11.10 sda5 (Recovery)" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro single
initrd /initrd.img
}


Enter gksu gedit /etc/grub.d/06_custom and remove the red # above and then enter sudo update-grub then the file should look similar to the one below:


#!/bin/sh
echo 1>&2 "Adding Ubuntu Lucid Lynx 10.04, Precise Pangolin 12.04, Quantal Quetzal 12.10 and Windows 7"
exec tail -n +4 $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 "Lycid Lynx 10.04" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro quiet splash
initrd /initrd.img
}

The exec tail -n +4 $0 says to execute the 4th line from the top which should be a menuentry line.
Since your echo command is commented out, the 4th line in your file is the set statement after the menuentry.

See if that fixes it. It should.

bogan
November 3rd, 2012, 06:56 PM
Hi!, Cavsfan,

You Posted:
Enter gksu gedit /etc/grub.d/06_custom and remove the red # above and then enter sudo update-grub then the file should look similar to the one below:I did as you suggested, and, as I expected, that brought back the Syntax error in Line 127.;
The echo line copied from the Wiki is :

echo "Adding Ubuntu Lucid Lynx 10.04, Precise Pangolin 12.04, Quantal Quetzal 12.10 and Windows 7" >&2 Whereas from your Post is:

echo 1>&2 "Adding Ubuntu Lucid Lynx 10.04, Precise Pangolin 12.04, Quantal Quetzal 12.10 and Windows 7"Adding the '1' to the last phrase, to make it:"xxxx Windows 7" 1>&2", still gave the Syntax error.
Placing the echo line as line 2 and putting the '1>&2' after 'echo', deleting the last phrase, got rid of the Syntax error.

Despite the apparent logic of your explanation, that is not what happened. The first entry was, and still is, correct.

At present, after the above changes, the part of /boot/grub/grub.cfg that is produced is:
### BEGIN /etc/grub.d/06_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.
menuentry "Quantal 12.10 USB sdc2" {
set root='hd2,2'
linux /vmlinuz root=/dev/sdc2 ro quiet splash
initrd /initrd.img
}Before, with the echo line commented out after the three text lines, it was printed out, but the first line " This file xxxxxx" was ommited.; note that the content of the echo line is not reproduced

The menu display remains the same andnone of the Ubuntu entries will work, behaving exactly as described in my last Post.

Chao!, bogan.

bogan
November 3rd, 2012, 08:05 PM
Hi!, Cavsfan,

I should, perhaps, have mentioned that I have, for safety's sake, conducted what I regard as an experiment, in the 12.10 installation in a SanDisk USB, which has its own Grub active when booted to USB from the Bios boot menu.

Of course, when the USB 12.10 is booted from the grub menu of my primary OS, sda10, the USB Grub menu also appears.

I did not see that this matters - and still do not see how it should make any difference - but clearly it does, because........

I have copy/pasted the 06_custom file from the USB, unchanged, to /etc/grub.d of sd10 and, Lo & Behold !!, all the entries work.

The only queer thing is that the Recovery entries boot directly to a root prompt without displaying a Recovery menu.

So the question is: WHY?? and, What alterations are needed to get the USB Ubuntu to recognise the partitions in sda, and find the vmlinuz & initrd.img files? - which are there in /boot/ of the USB, as well as all the other OS's.

Chao!, bogan.

Cavsfan
November 3rd, 2012, 08:55 PM
Hi!, Cavsfan,

I should, perhaps, have mentioned that I have, for safety's sake, conducted what I regard as an experiment, in the 12.10 installation in a SanDisk USB, which has its own Grub active when booted to USB from the Bios boot menu.

Of course, when the USB 12.10 is booted from the grub menu of my primary OS, sda10, the USB Grub menu also appears.

I did not see that this matters - and still do not see how it should make any difference - but clearly it does, because........

I have copy/pasted the 06_custom file from the USB, unchanged, to /etc/grub.d of sd10 and, Lo & Behold !!, all the entries work.

The only queer thing is that the Recovery entries boot directly to a root prompt without displaying a Recovery menu.

So the question is: WHY?? and, What alterations are needed to get the USB Ubuntu to recognise the partitions in sda, and find the vmlinuz & initrd.img files? - which are there in /boot/ of the USB, as well as all the other OS's.

Chao!, bogan.

I thought that maybe you had grub on the USB drive and maybe that would not work and I do not expect that it will work.
Did you install grub on sd10 sudo grub-install /dev/sd10 ?

For this to work, you have to have grub installed along with the picture and everything else on the same partition.

The Wiki assumes that you have untouched grub files and that you copy and paste exactly as stated in the wiki.
Then when you enter sudo update-grub it changes the files a bit as you see them. Like when you look at 06_custom; it is no longer like it says in the wiki because Grub2 has changed it.
My Quantal install is somewhat finicky when I boot into recovery mode also. A lot of times it just hangs and I have to press the reset button.
I have had to boot up a couple of times to get it to work correctly. Not really sure when the last time I got into Quantal Recovery but, it should work.

On Lucid and Precise Recover work no problem - just Quantal doesn't always work.
I am not real fond of Quantal but, I keep it for the Grub2 version 2.00 and to support it for the wiki.

Here is my entire output of sudo grub-mkconfig on Quantal:


cavsfan@cavsfan-MS-7529:~$ sudo grub-mkconfig
[sudo] password for cavsfan:
Generating grub.cfg ...
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="12"

if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}

insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 b5fc902c-0bf0-45b3-95a1-29f3c46dfe6a
else
search --no-floppy --fs-uuid --set=root b5fc902c-0bf0-45b3-95a1-29f3c46dfe6a
fi
if loadfont /boot/grub/DejaVuSansMono.pf2 ; then
set gfxmode=1920x1200-24
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=60
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 b5fc902c-0bf0-45b3-95a1-29f3c46dfe6a
else
search --no-floppy --fs-uuid --set=root b5fc902c-0bf0-45b3-95a1-29f3c46dfe6a
fi
Found background image: nature-hd-wallpaper_1920x1200.jpg
insmod jpeg
if background_image /boot/grub/nature-hd-wallpaper_1920x1200.jpg; then
set color_normal=cyan/black
set color_highlight=light-red/black
true
else
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30; then
clear
fi
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/06_custom ###
Adding Ubuntu Lucid Lynx 10.04, Precise Pangolin 12.04, Quantal Quetzal 12.10 and Windows 7
# 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 "Lycid Lynx 10.04" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro quiet splash
initrd /initrd.img
}
menuentry "Lycid Lynx 10.04 (Recovery Mode)" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro single
initrd /initrd.img
}
menuentry "Lycid Lynx Generic 10.04" {
set root=(hd0,9)
linux /vmlinuz root=/dev/sda9 ro quiet splash
initrd /initrd.img
}
menuentry "Lycid Lynx Generic 10.04 (Recovery Mode)" {
set root=(hd0,9)
linux /vmlinuz root=/dev/sda9 ro single
initrd /initrd.img
}
menuentry "Precise Pangolin 12.04" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro quiet splash
initrd /initrd.img
}
menuentry "Precise Pangolin 12.04 (Recovery Mode)" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro single
initrd /initrd.img
}
menuentry "Precise Pangolin Generic 12.04" {
set root=(hd0,11)
linux /vmlinuz root=/dev/sda11 ro quiet splash
initrd /initrd.img
}
menuentry "Precise Pangolin Generic 12.04 (Recovery Mode)" {
set root=(hd0,11)
linux /vmlinuz root=/dev/sda11 ro single
initrd /initrd.img
}
menuentry "Quantal Quetzal 12.10" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro quiet splash
initrd /initrd.img
}
menuentry "Quantal Quetzal 12.10 (Recovery Mode)" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro single
initrd /initrd.img
}
menuentry "Quantal Quetzal Generic 12.10" {
set root=(hd0,13)
linux /vmlinuz root=/dev/sda13 ro quiet splash
initrd /initrd.img
}
menuentry "Quantal Quetzal Generic 12.10 (Recovery Mode)" {
set root=(hd0,13)
linux /vmlinuz root=/dev/sda13 ro single
initrd /initrd.img
}
menuentry "Windows 7" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 1CFC7A8DFC7A60C6
chainloader +1
}
### END /etc/grub.d/06_custom ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### 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 ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###As you can see that does not resemble my 06_custom file at all.

bogan
November 3rd, 2012, 09:56 PM
Hi!, Cavsfan,

You Posted:
The Wiki assumes that you have untouched grub files and that you copy and paste exactly as stated in the wiki.
Then when you enter sudo update-grub it changes the files a bit as you see them. Like when you look at 06_custom; it is no longer like it says in the wiki because Grub2 has changed it. And:
As you can see [ in output of sudo grub-mkconfig ]that does not resemble my 06_custom file at all. We do not seem to be on the same wavelength.

My Grub files [ in both sda10 & sdc2 } are certainly not untouched but I don't think the alterations in any way affect the operation of your system. I did "copy and paste exactly as stated in the wiki."

I only altered the 'Labels' and 'hdx,x' and 'sdxX' entries. The error in the 'echo' line is in the Wiki.

Running 'sudo update-grub' has not altered the contents of my 06_custom file at all.

As far as I can see, the part of 'sudo grub-mkconfig' concerned, is exactly the same as the 06_custom file in Wiki, other than it has many more entries. The same thing applies to the relevant entries in /boot/grub/grub.cfg.
Did you install grub on sd10 sudo grub-install /dev/sd10 ? I did not need to, grub2 was already installed in sda10 as my main OS.

What I do not understand is that from sda10 your system can find Windows, sda5, sdb7, & sdc2, in Internal HDD, External sata/usb HDD, & Sandisk USB; and from the USB sdc2 can find Windows, & sdb7, but not sda10 or sda5.

Are you saying, in effect, that there is no way to get your system to work from a bootable external drive with its own grub2 installed?.

Chao!, bogan.

Cavsfan
November 3rd, 2012, 10:32 PM
Hi!, Cavsfan,

You Posted: And: We do not seem to be on the same wavelength.

My Grub files are certainly not untouched but I don't think the alterations in any way affect the operation of your system. I did "copy and paste exactly as stated in the wiki."

I only altered the 'Labels' and 'hdx,x' and 'sdxX' entries. The error in the 'echo' line is in the Wiki.

Running 'sudo update-grub' has not altered the contents of my 06_custom file at all.

As far as I can see, the part of 'sudo grub-mkconfig' concerned, is exactly the same as the 06_custom file in Wiki, other than it has many more entries. The same thing applies to the relevant entries in /boot/grub/grub.cfg. I did not need to, grub2 was already installed in sda10 as my main OS.

What I do not understand is that from sda10 your system can find Windows, sda5, sdb7, & sdc2, in Internal HDD, External sata/usb HDD, & Sandisk USB; and from the USB sdc2 can find Windows, & sdb7, but not sda10 or sda5.

Are you saying, in effect, that there is no way to get your system to work from a bootable external drive with its own grub2 installed?.

Chao!, bogan.

You were correct about the echo line and I have fixed the Wiki.
Check it out now. I believe I have it correct.

I have no idea if one could add this customization to a USB drive but, I also don't understand why you would want to.

I really prefer to have my grub installed on a primary partition instead of logical ones let alone if I had a USB drive connected.
Grub-rescue is not something I like to see.

I have my grub installed on Lucid and will keep it there except to test until I upgrade that to Precise but, I have until April '13 to do so.

Cavsfan
November 3rd, 2012, 11:11 PM
Bogan, I just tried Quantal Recovery on my custom system and it did not go any where. It just displayed a bunch of stuff and stopped.

So, I went to my Quantal generic where the grub is untouched and installed grub there.

I booted into Recovery after that and the menu did come up but, when I selected Failsafe mode, it said something about the files would
be read only and mounted according to fstab and then stopped. It would not do any thing so I had to press reset.
While there I double checked fstab and it was correct.
Luckily I made it back into my Lucid install to install grub.

So, this custom grub in Quantal does not permit failsafe mode and apparently neither does generic Quantal.

I didn't try any other options but that must be a bug in Quantal Recovery.

Edit: You can also label partitions in GParted by clicking on the partition and then label.

Ciao!

bogan
November 4th, 2012, 11:23 AM
Hi!, Cavsfan,

Thanks for your last two responses, you Posted:
I have no idea if one could add this customization to a USB drive but, I also don't understand why you would want to.The USB is my emergency backup, its Grub has entries for not only the OS's on this computer but also my other desktop.

SO, if any of the horrifying crashes I read about in the Forum, occurred to me - so far, at least, I have never had one that prevented me accessing at least one of the Ubuntu OS's - I can do so by Bios booting to the USB in either computer.

As long as Grub Customizer was working OK - despite the nuisance of duplicate entries - I was able to rename the entries in the menu so I knew which of ten entries was which.

With GC messing up things in 12.10 and applying name changes I made to the wrong entries, the arrangement, both on my main OS, sda10, and the USB became chaotic, with up to 24 entries all saying: "Ubuntu 12.10 ( 12.10)" without any sdaX mention.

That is why I decided to try your system, so I could have sensible, meaning-full labels, without having to re-edit '/boot/grub/grub.cfg' every time anything altered, or 'update-grub' was run.

The normal 12.10 boot to Recovery goes to a drop down menu in Read only mode,; the option to drop to a terminal goes to a root prompt requiring a root password.

With the two I tried in the custom entries, they went to a text display quite different to any I have previously seen, including a line that said: " system will be reset to Read/Write in the following recovery sequence" [ or words to that effect ] and then went direct to a root text terminal prompt - without needing to login or give a password -
service lightdm start then went to the normal greeter login screen.

I will check out the other recovery boot entries and see if I get anything like you reported.

Chao!, bogan.

bogan
November 4th, 2012, 12:47 PM
Hi!, Cavsfan,

I have tried out the recovery entries in both my main & USB Quantal OS's, both the standard & the 06_custom versions.

Without going into details I can only say there is a disconcerting unpredictability about the results.

Generally, the custom entries on the USB do not work, [ as already reported ] whilst those in the main, sda10, OS, work, also as already described, ending just after the " boot scripts. [done]" lines with a root prompt, but no recovery menu. On one occaision I got a momentary error message before the boot text, and on another It hung up after the " set Swap sda6" line, two lines on from the' boot script' lines. 'Alt+ REIBUS' produced its usuall shut down messages but did not close.

The 'normal' grub menu recovery entries in both OS's ran normally to Recovery Menus and the 'Drop to root shell' options all gave root terminal prompts not requiring log-in or password. { I did not get the demand for a root password that I had had previously.}

There were several discrepancies in the exact point in the boot text dislplay at which it went to the Menu window, and in the behaviour after entering 'reboot' from the prompt. Sometimes it flashed the GUI log-in screen, or a window saying it was 'in fail safe low res', most times merely a blank screen.

But mostly it returned to the Recovery Menu window and hung there for 40 seconds or so, before breaking up and quitting.

I did not actually try the Failsafe option in the menu, but I will do so and edit this accordingly.
EDIT: The results of trying Recovery>FailSafe were complex, so I am Posting it separately.

Chao!, bogan.

stinkeye
November 4th, 2012, 01:24 PM
Hi Cavsfan,
thanks for the wiki.
Changed the plymouth background to black as well, for a much nicer boot.

bogan
November 4th, 2012, 01:45 PM
Hi!, Cavsfan,

The results of trying Recovery>FailSafe were complex so I am Posting it separately.

Choosing failsafe from the 'normal', 'Ubuntu', grub menu items, in both sda10 and the USB, showed 'fsck' and its results, but then hung with a flashing cursor.

I then remembered I had seen this before, and found a workround: Press 'Ctrl+c' +'Return' and after 20 seconds or so it goes to a continued text display and then to the GUI log-in screen..

Doing the same with the 12.04.1 recovery entry, had a different result, it gave a full screen of a different text display, including 'Fatal Server error' & 'No Screen found', ending with " Server exited with error '1'" [ or some such message ] and again hung there.

Once again: Pressing: 'Ctrl+c' + 'Return' caused it to exit to a normal GUI login screen, despite all the warnings.

I have no idea how to tell if the GUI is actually in 'FailSafe' or not, it appears quite normal to me and 'echo $DESKTOP_SESSION' gives: "ubuntu" as usual.

The other OS's, for some reason, I was unable to test, as the recovery options are hidden in the 'Advanced Options' entry and selecting that entry, instead of showing the recovery entry, as the others did, merely returned to a different Grub menu, still showing the 06_custom entries, but below the old grub1,99 entries, without the 'Advanced Options'. Dont Ask!

Chao!, bogan.

Cavsfan
November 4th, 2012, 02:44 PM
Hi Cavsfan,
thanks for the wiki.
Changed the plymouth background to black as well, for a much nicer boot.

You're welcome! :) Since the custom menuentries are now correct for grub 1.99 and 2.00 perhaps you'd like to add them.
They will initially appear at the top and if you don't like them you can just make 06_custom unexecutable and you are back to normal.


I then remembered I had seen this before, and found a workround: Press 'Ctrl+c' +'Return' and after 20 seconds or so it goes to a continued text display and then to the GUI log-in screen...

I could not successfully get into safe mode in recovery on either installation of Quantal. I don't like special work arounds for things that should just work.

As I stated I like LTS versions and just have Quantal on here for the grub version 2.00 and for the wiki.
Thanks for getting me to realize I did have that echo command incorrect in the wiki. :)

bogan
November 4th, 2012, 10:06 PM
Hi!, Cavsfan,

This Recovery business is going from very strange to downright weird!

I mentioned that in Quantal, the Grub menu was correct with the 0_6custom entries at the top and the 'normal' grub2.00 entries, including Additional Options, for each, below.

Whilst the main OS Quantal, sda10, Additional Options entry, and some others, worked as expected when selected, showing the standard and recovery entries, [plus some duplicates]; which, when 'e' was pressed showed the correct scripts; the one for Quantal on the external HDD, sdb7, did not.

It displayed what at first sight looked like the 0_6custom entries at the top and the 'pre-grub 2.00' grub2 entries, excluding Additional Options or recovery options, for each, below; and that is what I reported.

However, on further examination, I find I missed an obvious error: all the entries - except Windows & Memtest - both new custom, and old 'normal entries, had the correct Labels, but the same suffix added: " on sdb7".

Pressing 'e' showed all the entries had scripts for sdb7 and all were of the 'normal' grub2 type, not the shortened version used in the Wiki.

Whereas the 'normal' entries mostly had the files in the last two lines identified as eg. /boot/vmlinuz-3.5.0-18-generic, in the 06_custom entries the last two lines were as in the Wiki, without the suffixes or UIID's.

Just to make things even weirder: when I selected the "Quantal sda10 on sb7" entry with 'Enter' or 'Ctrl+x' from the script, it actually booted into the Quantal on the USB. Furthermore it did so bypassing the usb's own Grub menu!

Whereas the "Precise 12.04.1 on sb7" did boot into 12.04.1 on sb7, but in a very low-res display.

The same thing happened with sda5, all the entries had sdb5 suffixes and scripts.

Chao!, a bewildered bogan.

Cavsfan
November 5th, 2012, 04:36 PM
Hi!, Cavsfan,

This Recovery business is going from very strange to downright weird!

I mentioned that in Quantal, the Grub menu was correct with the 0_6custom entries at the top and the 'normal' grub2.00 entries, including Additional Options, for each, below.

Whilst the main OS Quantal, sda10, Additional Options entry, and some others, worked as expected when selected, showing the standard and recovery entries, [plus some duplicates]; which, when 'e' was pressed showed the correct scripts; the one for Quantal on the external HDD, sdb7, did not.

It displayed what at first sight looked like the 0_6custom entries at the top and the 'pre-grub 2.00' grub2 entries, excluding Additional Options or recovery options, for each, below; and that is what I reported.

However, on further examination, I find I missed an obvious error: all the entries - except Windows & Memtest - both new custom, and old 'normal entries, had the correct Labels, but the same suffix added: " on sdb7".

Pressing 'e' showed all the entries had scripts for sdb7 and all were of the 'normal' grub2 type, not the shortened version used in the Wiki.

Whereas the 'normal' entries mostly had the files in the last two lines identified as eg. /boot/vmlinuz-3.5.0-18-generic, in the 06_custom entries the last two lines were as in the Wiki, without the suffixes or UIID's.

Just to make things even weirder: when I selected the "Quantal sda10 on sb7" entry with 'Enter' or 'Ctrl+x' from the script, it actually booted into the Quantal on the USB. Furthermore it did so bypassing the usb's own Grub menu!

Whereas the "Precise 12.04.1 on sb7" did boot into 12.04.1 on sb7, but in a very low-res display.

The same thing happened with sda5, all the entries had sdb5 suffixes and scripts.

Chao!, a bewildered bogan.

Bogan, have you taken a look at the fstab on each install. When several of my fstabs had multiple entries of the swap file it displayed the normal grub menu as if everything was installed on sda2 and when I chose Lucid (which is on sda2) it booted into a low-res display.
It seems that grub reads fstab.

I am thinking that the problems you mention are limited to Quantal. I never have had any problems whatsoever with anything before Quantal.
My Quantal install is finicky at times. Sometimes I have to logout and back in a couple of times before Compiz doesn't break at login.
But, that always fixes it.
I definitely hope it is not grub 2.00 that is causing the problems, it seems to work great.

bogan
November 5th, 2012, 08:42 PM
Hi!, Cavsfan,

I just checked out all the fstab files on this computer, the only one that had an extra swap entry was the Quantal on the USB, which has not been involved in these recent recovery explorations.

I deleted the one on the internal HDD, sda6, and ran
sudo update-grub on both the usb and sda10, my main Quantal OS. It made no difference to the incorrect entries in the 'Advcanced Options' affected.

I think the following may shed some light on your problem with recovery with Quantal; on the other hand it complicates things more than ever, so perhaps not.

AFAIK. up to, but not including, Precise, grub2 v 1.98 & 1.99 used 'single' as the boot option in the grub menu script for booting to recovery, as you do in your Wiki.
Whereas, grub2 v2.00 uses 'recovery nomodeset'.

Calling a Quantal OS from grub2 installed in a Quantal OS using 'single', boots directly into a Root text terminal prompt, without showing a Recovery menu.

Doing so, using 'recovery nomodeset' boots to a Recovery menu. [ I presume the 'nomodeset' is precautionary, rather the necessary, as it seems to make no difference, at least on my set-up.

What happens if that is done calling a Quantal OS from grub v 1.99 on other OS's, I do not know, and there are obvious complex possibilities with the other combinations.

Of all the combinations I have tried, the only thing I can say, with any certainty, is that in none of them did the 'Failsafe mode' menu selection work, wihout exception it showed a 'xserver fatal error' and hung up, - but wait about 40 seconds and it went direct to the GUI login screen.

Do you know how to tell if the system is in 'Failsafe' or not?

'echo $RUNLEVEL' gives no output; presumably 'cat var/run/utmp' should show something, but it looks like garbage to me, whilst: 'cat /var/log/wtmp' is even worse; 'telinit' does not seem to have an option to report its current value.

Cavsfan
November 7th, 2012, 05:10 PM
I tried this yesterday and my custom entry for Quantal recovery did not go anywhere. It just hung.
I just changed "ro single" to "ro recovery nomodeset" sudo update-grub and rebooted and that brought up a root shell prompt which I could login to by entering "login" first.
So I guess that is better than just hanging. I added that to the wiki so that at least a root shell login appears.

But, not the normal recovery menu that I would like to see.

I installed grub on my generic (default grub 2.00) Quantal install and booted into Recovery and there was a normal menu but,
when I selected failsafe graphics mode, a box popped up and it said it was switching to a read-only mode and would attach anything in fstab.

But, when I hit enter it just hung. I to press reset to reboot.
So, the problem is with Quantal itself. It will not go into failsafe graphics mode no matter what.

Thanks Bogan! :)

Cavsfan
November 8th, 2012, 04:24 PM
Through experience I have learned that it is best if you restore these custom files to their original state prior to upgrading Ubuntu versions.
So, in the Community Wiki in my signature I have added how to do so and provided a link with the original file contents.
They can be copied and pasted into the files and Grub2 will be back to it's original state.

Cavsfan
November 14th, 2012, 08:40 PM
Using the label command tune2fs as mentioned in the wiki comes in handy.

This is the output of sudo blkid;

/dev/sda1: LABEL="C:" UUID="1CFC7A8DFC7A60C6" TYPE="ntfs"
/dev/sda2: LABEL="Lucid" UUID="a162dc8a-e4df-4b79-b4c3-524761ff7ae1" TYPE="ext4"
/dev/sda3: UUID="2a80f59e-e7c3-418e-aab2-ab5d19255a2f" TYPE="swap"
/dev/sda5: LABEL="Precise" UUID="3b8b1954-24e6-4a5e-9074-70a1a94ed4be" TYPE="ext4"
/dev/sda6: UUID="82c51b29-023f-4964-99b6-67b45a49527f" TYPE="swap"
/dev/sda7: LABEL="Quantal" UUID="b5fc902c-0bf0-45b3-95a1-29f3c46dfe6a" TYPE="ext4"
/dev/sda8: UUID="69ac3efc-8a8a-4056-89e0-59bb81c2f468" TYPE="swap"
/dev/sda9: LABEL="Lucid Generic" UUID="109c11d0-71e3-41a4-87da-9e81535499a5" TYPE="ext4"
/dev/sda10: UUID="24aa8c8b-53dc-4ecc-852b-ff2c25c8b342" TYPE="swap"
/dev/sda11: LABEL="Precise-Generic" UUID="50104efb-d918-45a9-985e-a70c60e87ac0" TYPE="ext4"
/dev/sda12: UUID="139390a6-2fe1-4ff2-b650-88ae3b0586c1" TYPE="swap"
/dev/sda13: LABEL="Quantal-Generic" UUID="580e8c62-78ce-44a2-93e3-ccebd37c3acc" TYPE="ext4"
/dev/sda14: UUID="ec3048b8-c644-435a-93bb-08bb4975d0db" TYPE="swap"
/dev/sdb1: LABEL="Fantom" UUID="78B8D1A1B8D15DE6" TYPE="ntfs"
BTW I labeled the Windows 7 C: drive from within Windows.

Here is what the benefit is when looking at the drives in Ubuntu 12.04 Gnome Classic:

http://ompldr.org/tZ2FpaQ (http://ompldr.org/vZ2FpaQ)

I think otherwise you would be looking at their UUIDs.

bogan
November 15th, 2012, 10:17 PM
Hi!, Cavsfan,

I set up your system in my main computer, and, for some unknown reason, 'tune2fs' limited any Labels to 16 characters, truncating anything longer.

I also discovered why I had problems with a combination of internal HDD, external eSata /usb HDD and an USB Sandisk.

When I set things up the SanDisk was sdb, the eSata HDD was sdc. and the Ubuntu on the internal HDD was sde.

Later, when I started up again, I plugged the USB [ for safety ] into a socket on the back panel, instead of one on the front, [ as it had been ].

That must have been connected to an USB hub with a higher priority, with the result that when booted, the USB SanDisk was sda, the eSata was sde, and the HDD was sdf.

So while the orthodox system still worked using disk ID's, your system could not find the partitions it was looking for.

In other words it is essential that all drives are plugged in to the same sockets as when set-up.

The sdx's I am stating from memory, so they may not be entirely correct, but you will get the idea.

Incidently, a bit off topic, I have Posted in several threads a warning about the 310 nvidia driver with 6xxx & 7xxx series cards:
http://ubuntuforums.org/showthread.php?t=1743535

Chao!, bogan.

Cavsfan
November 16th, 2012, 05:02 PM
Hi!, Cavsfan,

I set up your system in my main computer, and, for some unknown reason, 'tune2fs' limited any Labels to 16 characters, truncating anything longer.

I also discovered why I had problems with a combination of internal HDD, external eSata /usb HDD and an USB Sandisk.

When I set things up the SanDisk was sdb, the eSata HDD was sdc. and the Ubuntu on the internal HDD was sde.

Later, when I started up again, I plugged the USB [ for safety ] into a socket on the back panel, instead of one on the front, [ as it had been ].

That must have been connected to an USB hub with a higher priority, with the result that when booted, the USB SanDisk was sda, the eSata was sde, and the HDD was sdf.

So while the orthodox system still worked using disk ID's, your system could not find the partitions it was looking for.

In other words it is essential that all drives are plugged in to the same sockets as when set-up.

The sdx's I am stating from memory, so they may not be entirely correct, but you will get the idea.

Incidently, a bit off topic, I have Posted in several threads a warning about the 310 nvidia driver with 6xxx & 7xxx series cards:
http://ubuntuforums.org/showthread.php?t=1743535

Chao!, bogan.

Thanks for that info bogan! I can imagine that if you did something to alter the partitions that could cause chaos.
I don't really suggest using any USB drives but, if you do I suggest always plugging them back in the same place they
were initially plugged in if you have included them in this customization.

I have one USB drive - a 1TB drive which I use for backup. I never unplug it and it always has power.
It is formatted NTFS so it works well with both windows and Ubuntu.
My PC just goes to sleep or suspends after an hour of no use.

About the Nvidia drivers, I have not added any drivers to any of my installs except Lucid.
With Lucid it was a piece of cake but, I have not been successful with any other version of Ubuntu at upgrading the driver.

I tried the xswat ppa on Precise and that ended in a clean install. Thankfully that was on a test install.
But, I learned my lesson: as you said the xswat ppa works for some and not for others.
It only takes one time for me. I have a Geforce 9800 GT.
:)

Cavsfan
November 16th, 2012, 10:42 PM
Something else I found out is that when you re-install a Ubuntu or install more than one, the fstab pulls in the ext4 where it was installed as
well as where it is now installed. Every swapfile gets pulled into fstab also.

If you have multiple Ubuntus like I do (6) that makes the boot menu look really bad after initially installing a 2nd, 3rd or re-installing any of them.
My default grub2 menu after installing Precise and Quantal had everything on sda2 where my good Lucid install is. I knew something was weird from
that. It said Lucid was on sda2, Precise was on sda2, Quantal was on sda2!

Luckily after cleaning up all of the /etc/fstab files on each and every one, they all point to the correct partitions now.

That is also mentioned in the wiki - cleaning up fstab.

Cavsfan
November 19th, 2012, 07:05 PM
I set up your system in my main computer, and, for some unknown reason, 'tune2fs' limited any Labels to 16 characters, truncating anything longer.

I looked at the man page for tune2fs and it mentions a 16 character limit.
Although it mentioned ext2 file systems, I believe it still holds true.

I also don't think it likes spaces but, am not absolutely certain.
My "Quantal-Generic" label kept disappearing.
Not sure if it was caused by a space or not but, it has stuck for quite a while now.

I initially thought there was a limit on partitions you could label but, I don't think that is true either.

oldfred
November 19th, 2012, 07:32 PM
It gets more confusing with gpt(GUID). Now there are two labels. One is the gpt partition and the other is the file system.

My older Maverick label or MAVERICK gpt partition label. I now use the same label for both as I do not know for sure which tools show which label.

bogan
November 19th, 2012, 07:34 PM
Hi!, Cavsfan,

The first time I tried 'tune2fs' it allowed me to use "Quantal 12.10 EXT sdb7 Recovery"- 30 Characters - the second time only 16, that's why I mentioned it.

The only partitions it would not let me Label were the Swaps, and empty Partitions, it complained it could not find a file system.
227411

Edit: I have not had any problems with spaces, as long as I use double quotes to enclose the whole Label, though I did not use any in the Screenshot.

Chao!, bogan.

Cavsfan
November 19th, 2012, 08:45 PM
I see what you mean oldfred with the 2 labels. I noticed that you can also label the partitions in GParted as well as with the command.

And bogan I see you are right. I labeled my one partition "Lucid Generic" with a space and it took.
EDIT: I didn't know that you had tried 30 characters. I looked in Lucid and in Quantal at the man page and it mentioned 16 char limit.

I labelled Quantal-Generic a dozen times and each time it would disappear for some reason that I didn't understand.
So, I kept re-labelling it and I guess at some point it gave up and took the label. :D

You can see how my partitions are all labelled on page 4 post #40 and here is what they look like in GParted:

227412

Cavsfan
November 20th, 2012, 10:20 PM
The old How To that this thread has evolved from is now closed.
It has links pointing to this thread.

The old How to had some errors in it, which I could not fix because of the change in policy.
However the Wiki in my signature and on the 1st post of this thread works very well on all versions of grub2.
I have had Debian Squeeze installed and it worked well with that too.

Feel free to post any screenshots of your custom grub2 screens, questions, problems or any thing else concerning the WIki here.

ChinaJustin
November 26th, 2012, 02:28 AM
Cavsfan,

Glad to see you got the previous thread up into a Wiki. VERY nice, and much easier to read/understand, that's for sure!

Just did the process on my dual-boot Windows 7 / Linux Mint 13, and have a question on some of the menu entries.

Currently, when I boot, my grub shows my normal Linux and Linux recovery mode options, a previous kernel option, Windows 7, and then three other Windows 7 options: one for the recovery environment (which I want to keep) on sda4, one that points to the small "SYSTEM" partition on sda1 but still boots into Windows 7 directly when I select it, and one that points to sda2 (so basically a repeat of my custom entry for Windows 7). I want to get rid of those last two but keep the recovery environment option. Is there any way to do that?

Here's my blkid output:


/dev/sda1: LABEL="System" UUID="E034F94D34F92766" TYPE="ntfs"
/dev/sda2: LABEL="TI106231W0C" UUID="32FC2690FC264E83" TYPE="ntfs"
/dev/sda4: LABEL="HDDRECOVERY" UUID="38F653DCF6539948" TYPE="ntfs"
/dev/sda5: UUID="2f60dfb5-580e-4508-a50c-345a04aed051" TYPE="ext4"
/dev/sda6: UUID="6e9ac2d0-0427-43ca-90ab-24656665b14d" TYPE="swap"
/dev/sda7: LABEL="Data" UUID="C61606BE1606B00B" TYPE="ntfs"
/dev/sdb1: LABEL="MyPassport" UUID="16DC46E5DC46BF2D" TYPE="ntfs"
And my custom_06 file:


#!/bin/sh
echo 1>&2 "Adding LinuxMint Maya and Windows 7"
exec tail -n +4 $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 "LinuxMint 13 - Maya" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro quiet splash
initrd /initrd.img
}
menuentry "LinuxMint 13 - Maya (Recovery Mode)" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro single
initrd /initrd.img
}
menuentry "Windows 7" {
insmod ntfs
set root='(hd0,2)'
search --no-floppy --fs-uuid --set 32FC2690FC264E83
chainloader +1
}And then when I ran that grep command I saw a few posts back, here's the output:


0 menuentry "LinuxMint 13 - Maya" {
1 menuentry "LinuxMint 13 - Maya (Recovery Mode)" {
2 menuentry "Windows 7" {
3 menuentry 'Linux Mint 13 Cinnamon 64-bit, 3.2.0-33-generic (/dev/sda5)
4 menuentry 'Linux Mint 13 Cinnamon 64-bit, 3.2.0-33-generic (/dev/sda5) -- recovery mode
5 submenu "Previous Linux versions" {
6 menuentry 'Linux Mint 13 Cinnamon 64-bit, 3.2.0-32-generic (/dev/sda5)
7 menuentry 'Linux Mint 13 Cinnamon 64-bit, 3.2.0-32-generic (/dev/sda5) -- recovery mode
8 menuentry 'Linux Mint 13 Cinnamon 64-bit, 3.2.0-23-generic (/dev/sda5)
9 menuentry 'Linux Mint 13 Cinnamon 64-bit, 3.2.0-23-generic (/dev/sda5) -- recovery mode
10 menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {
11 menuentry "Windows 7 (loader) (on /dev/sda2)" --class windows --class os {
12 menuentry "Windows Recovery Environment (loader) (on /dev/sda4)" --class windows --class os {
So I want to get rid of 10 and 11 but not 12. If I chmod -x the os_prober, I'm afraid it'll get rid of the WRE option. Am I right? And if so, is there a way, again, to get rid of 10 and 11 but keep 12? I'm thinking I could do another entry like my Windows 7 one, just change the uuid and the root, but what about the search and chainloader commands? Anything extra I would need to put in since it's a recovery environment?

oldfred
November 26th, 2012, 05:34 AM
Are you sure you want to keep 12. That is the vendor recovery which erases your entire drive. Best never to accidentally run it.

Both Windows and the Vendor call there partitions recovery. I really consider the 100MB Windows the boot/repair partition. And you can delete that if you have a separate Windows repairCD and can boot directly in the Windows main c: drive.

Once you make a set of vendor recovery DVDs you do not even need the Vendor recovery and it is better to have a backup of Windows.

I suggest backing up grub.cfg. And copy any additional entries you want into 40 custom or where you want then. Then turn off os-prober. You can turn it back on if you want it to find a new install, copy an entry and then turn off again.

The vendor recovery DVDs are just an image of your drive as purchased. If you have housecleaned a lot of cruft normally included, run many updates with many reboots, and added software you may want a full back up.
Backup windows before install - post by Mark Phelps
http://ubuntuforums.org/showthread.php?t=2040149
http://ubuntuforums.org/showthread.php?t=1626990
http://www.macrium.com/reflectfree.asp

ChinaJustin
November 26th, 2012, 10:32 AM
I guess I don't need to keep 12. I made a Recovery Environment CD already if I really needed it, and I made the Toshiba Recovery Discs (with its wonderful bloatware) already, too. I just like to keep those partitions on their out of general principle and redundancy.

I'll just go ahead and take os_prober out of the equation. Hadn't thought about the fact I already have the discs if necessary. Thanks, oldfred!

Cavsfan
November 26th, 2012, 05:19 PM
Thanks oldfred for pointing that out!

Right ChinaJustin. I believe making 10_linux and 30_os-prober both unexecutable and then sudo update-grub should do it.
This is from 1.5 in the Wiki - Final changes.
You can always login to recovery and make them executable if needed.

Also don't forget to label the drives as mentioned in 1.6 of the Wiki.

You can see an example of how that looks like on page 4 post #40 of this thread.

ChinaJustin
November 28th, 2012, 09:10 AM
Yeah, I just tried the labeling thing... but it's weird:


/dev/sda1: LABEL="System" UUID="E034F94D34F92766" TYPE="ntfs"
/dev/sda2: LABEL="TI106231W0C" UUID="32FC2690FC264E83" TYPE="ntfs"
/dev/sda4: LABEL="HDDRECOVERY" UUID="38F653DCF6539948" TYPE="ntfs"
/dev/sda5: UUID="14812599-e129-4ed1-8bca-ed5743b08254" TYPE="ext4" LABEL="Maya"
/dev/sda6: UUID="6e9ac2d0-0427-43ca-90ab-24656665b14d" TYPE="swap"
/dev/sda7: LABEL="Data" UUID="C61606BE1606B00B" TYPE="ntfs"


So it put my "Maya" label way out at the end... and when I tried doing the tune2fs on sda2 (to change it from the letters/numbers to "Windows 7"), it gave me:


tune2fs 1.42 (29-Nov-2011)
tune2fs: Bad magic number in super-block while trying to open /dev/sda2
Couldn't find valid filesystem superblock.


Any way to get the label at the FRONT, and what does that error message mean? Any way to get it to work?

Cavsfan
November 28th, 2012, 02:43 PM
Yeah, I just tried the labeling thing... but it's weird:


/dev/sda1: LABEL="System" UUID="E034F94D34F92766" TYPE="ntfs"
/dev/sda2: LABEL="TI106231W0C" UUID="32FC2690FC264E83" TYPE="ntfs"
/dev/sda4: LABEL="HDDRECOVERY" UUID="38F653DCF6539948" TYPE="ntfs"
/dev/sda5: UUID="14812599-e129-4ed1-8bca-ed5743b08254" TYPE="ext4" LABEL="Maya"
/dev/sda6: UUID="6e9ac2d0-0427-43ca-90ab-24656665b14d" TYPE="swap"
/dev/sda7: LABEL="Data" UUID="C61606BE1606B00B" TYPE="ntfs"
So it put my "Maya" label way out at the end... and when I tried doing the tune2fs on sda2 (to change it from the letters/numbers to "Windows 7"), it gave me:


tune2fs 1.42 (29-Nov-2011)
tune2fs: Bad magic number in super-block while trying to open /dev/sda2
Couldn't find valid filesystem superblock.
Any way to get the label at the FRONT, and what does that error message mean? Any way to get it to work?

The label normally displays on the right soon after you enter the label command and subsequently will show on the left, but that doesn't matter. It will only show up that way in the terminal.
The important thing is that it will be labeled inside Mint.

You can enter man tune2fs in terminal and it will show the options.
However it only mentions labeling ext2 files systems.

The only things you can label with this command are ext4 partitions. You cannot label swapfiles or Windows partitions from outside of Windows.

In Windows I clicked on Computer and then C drive and properties and labeled my C drive "C:".
Here is the output of my sudo blkid:

/dev/sda1: LABEL="C:" UUID="1CFC7A8DFC7A60C6" TYPE="ntfs"
/dev/sda2: LABEL="Lucid" UUID="a162dc8a-e4df-4b79-b4c3-524761ff7ae1" TYPE="ext4"
/dev/sda3: UUID="2a80f59e-e7c3-418e-aab2-ab5d19255a2f" TYPE="swap"
/dev/sda5: LABEL="Precise" UUID="3b8b1954-24e6-4a5e-9074-70a1a94ed4be" TYPE="ext4"
/dev/sda6: UUID="82c51b29-023f-4964-99b6-67b45a49527f" TYPE="swap"
/dev/sda7: LABEL="Quantal" UUID="b5fc902c-0bf0-45b3-95a1-29f3c46dfe6a" TYPE="ext4"
/dev/sda8: UUID="69ac3efc-8a8a-4056-89e0-59bb81c2f468" TYPE="swap"
/dev/sda9: LABEL="Lucid Generic" UUID="109c11d0-71e3-41a4-87da-9e81535499a5" TYPE="ext4"
/dev/sda10: UUID="24aa8c8b-53dc-4ecc-852b-ff2c25c8b342" TYPE="swap"
/dev/sda11: LABEL="Precise-Generic" UUID="50104efb-d918-45a9-985e-a70c60e87ac0" TYPE="ext4"
/dev/sda12: UUID="139390a6-2fe1-4ff2-b650-88ae3b0586c1" TYPE="swap"
/dev/sda13: LABEL="Quantal-Generic" UUID="580e8c62-78ce-44a2-93e3-ccebd37c3acc" TYPE="ext4"
/dev/sda14: UUID="ec3048b8-c644-435a-93bb-08bb4975d0db" TYPE="swap"
/dev/sdb1: LABEL="Fantom" UUID="78B8D1A1B8D15DE6" TYPE="ntfs"

oldfred
November 28th, 2012, 05:01 PM
For a neater display, you can do this - but you have to post in code tags to make it preserve format:


fred@fred-Precise:~$ sudo blkid -c /dev/null -o list
device fs_type label mount point UUID
-------------------------------------------------------------------------------
/dev/sda1 ntfs WinXP (not mounted) 04B05B70B05B6768
/dev/sda2 ext3 backup /mnt/backup 13a684e4-2849-4566-9528-21cd07028a9a
/dev/sda4 vfat SHARE (not mounted) 46CD-C9B2
/dev/sdb2 ext4 Maverick (not mounted) 0eea4e95-ea0a-4745-80d4-57bf2bbc9d69
/dev/sdb3 swap (not mounted) 00c4e383-cf30-4b54-9a9f-d46953e3966e
/dev/sdb4 ext4 MavData (not mounted) 431ba9e5-c72c-41c2-ba82-d8ee052336ff
/dev/sdc1 ext3 grub (not mounted) 9e16ad9c-c5f8-4b5a-b2b3-20dfc71a422f
/dev/sdc2 ntfs Shared /mnt/shared 44332FD360AA9657
/dev/sdc4 ext2 bios_gpt (not mounted) bbda6045-bb8a-4666-8bd4-04b3945ca581
/dev/sdc5 ext4 Karmic (not mounted) 117412d5-2dbe-4011-8aec-ae310d1ee6c7
/dev/sdc6 ext3 Data /mnt/data a55e6335-616f-4b10-9923-e963559f2b05
/dev/sdc7 ext4 LUCID (not mounted) 5e25282c-9c54-45df-9e79-514011e98648
/dev/sdc8 ext4 Test (not mounted) af29c61a-34e9-48eb-9c94-afcb4bb61582
/dev/sdc9 vfat OLDG (not mounted) F6A6-705D
/dev/sdc10 ext4 newhome (not mounted) b8a7e331-a716-4ac1-bf58-6ac515606c6d
/dev/sdc11 swap <swap> 09367687-86d1-4fd0-9b81-2787d3196159
/dev/sdc12 ext4 Puppy (not mounted) 07e2a08d-37ca-4cf1-877b-f02b0eabcbca
/dev/sdc13 ext4 natty (not mounted) 318fd41e-4210-4960-a0d9-ee9b48388d69
/dev/sdc14 ext4 kubuntu (not mounted) 0b3034c1-d991-45f5-a7ea-9265125e6b05
/dev/sdc15 swap <swap> 2c05178d-1e0e-4ae8-80e6-a700dc0d6eb9
/dev/sdc16 ext4 oneiric (not mounted) 63d146fd-1c63-4b31-95c5-ab52e2892283
/dev/sdc17 ext4 server (not mounted) 63045773-e42a-46eb-9e96-b93428542527
/dev/sdc18 ext4 (not mounted) 117e0c31-7e16-4e8b-90b7-a3c688a34f26
/dev/sdd1 vfat EFI (not mounted) 7B30-5ACA
/dev/sdd3 ext4 Precise / adc013e9-a23d-4a36-849b-3faeac005667
/dev/sdd4 ext4 Quantal (not mounted) 94e634d0-39fb-4994-a685-8ee34747a240
fred@fred-Precise:~$

Cavsfan
November 28th, 2012, 06:08 PM
Sweet! Thanks for that tip Oldfred! I'll make note of that!

ChinaJustin, check out this picture. This is the main benefit of using the label command:

http://ompldr.org/vZ2FpaQ

Cavsfan
November 28th, 2012, 06:17 PM
This is what sudo blkid -c /dev/null -o list produces for me. What am I doing wrong? Does it have to be edited in a text editor first?

device fs_type label mount point UUID
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/dev/sda1 ntfs C: (not mounted) 1CFC7A8DFC7A60C6
/dev/sda2 ext4 Lucid / a162dc8a-e4df-4b79-b4c3-524761ff7ae1
/dev/sda3 swap <swap> 2a80f59e-e7c3-418e-aab2-ab5d19255a2f
/dev/sda5 ext4 Precise (not mounted) 3b8b1954-24e6-4a5e-9074-70a1a94ed4be
/dev/sda6 swap (not mounted) 82c51b29-023f-4964-99b6-67b45a49527f
/dev/sda7 ext4 Quantal (not mounted) b5fc902c-0bf0-45b3-95a1-29f3c46dfe6a
/dev/sda8 swap (not mounted) 69ac3efc-8a8a-4056-89e0-59bb81c2f468
/dev/sda9 ext4 Lucid Generic (not mounted) 109c11d0-71e3-41a4-87da-9e81535499a5
/dev/sda10 swap (not mounted) 24aa8c8b-53dc-4ecc-852b-ff2c25c8b342
/dev/sda11 ext4 Precise-Generic (not mounted) 50104efb-d918-45a9-985e-a70c60e87ac0
/dev/sda12 swap (not mounted) 139390a6-2fe1-4ff2-b650-88ae3b0586c1
/dev/sda13 ext4 Quantal-Generic (not mounted) 580e8c62-78ce-44a2-93e3-ccebd37c3acc
/dev/sda14 swap (not mounted) ec3048b8-c644-435a-93bb-08bb4975d0db
/dev/sdb1 ntfs Fantom /media/Fantom 78B8D1A1B8D15DE6

bogan
November 28th, 2012, 06:45 PM
Hi!, cavsfan,

It worked for me, and I did not do anything out of the ordinary [ Edit: Other than having to fiddle with the Terminal size to get a readable display. My first attempt had a display similar to yours but not so exagerated]:
alan@alan-MS-7616:~$ sudo blkid -c /dev/null -o list
device fs_type label mount point UUID
--------------------------------------------------------------------------------------------
/dev/sda1 ntfs System Reserved (not mounted) CC9240F39240E394
/dev/sda2 ntfs Boot (not mounted) A8D04A41D04A15CA
/dev/sda4 ntfs (not mounted) 368837118836CF5D
/dev/sda5 ext4 Precise-sda5 (not mounted) a8ecbe4f-fc2d-40a1-b261-1b62d74e7130
/dev/sda6 swap <swap> a74af1d9-f7f9-4453-97e7-b9e3f370dca4
/dev/sda7 vfat (not mounted) CB27-6560
/dev/sda8 ext4 Home-sda5 (not mounted) 0a1beb1a-9c4b-45f7-a35b-a2689cf63a5d
/dev/sda9 vfat (not mounted) CC02-1DAF
/dev/sda10 ext4 Quantal-sda10 / b5aab3a2-0086-4a12-9276-46bb5a615038
/dev/sda11 ext4 Home-sda10 /home adc771a1-313c-47ae-8725-3c89b89bbfa2
/dev/sdb1 ntfs Simulator (not mounted) 20D6C693D6C6691C
/dev/sdb2 ntfs Backup (not mounted) CE5C7F585C7F3A73
/dev/sdb5 ext4 Home-sdb7 (not mounted) 390eaeec-0d84-4599-99e0-b2a770f9e61c
/dev/sdb6 ext4 (not mounted) 2d70c299-9315-45e6-85ad-3464c794f407
/dev/sdb7 ext4 Quantal-EXT-sdb7 (not mounted) 7608b1e5-b5ea-4563-ad94-8cf496b9f95f
/dev/sdb8 ext4 (not mounted) 8222255f-143c-4e48-8127-66cc43237a8c
/dev/sdc1 ntfs Switch /media/alan/Switch 3EB698C5B6987ED9
/dev/sdc2 ext4 Quantal-USB-sdc2 /media/alan/Quantal-USB-sdc2 cee38717-6980-4485-a047-124edb4d5a23
/dev/sdc3 swap (not mounted) 9a74bb15-1215-4774-8419-f2908ee62d2e
alan@alan-MS-7616:~$ Running 12.10.[ Unlabelled partitions are empty.]

Chao!, bogan.

oldfred
November 28th, 2012, 06:48 PM
You seem to have a lot of extra spaces. I do not edit. Did it look ok in terminal before copying?

My post is just as is, but over the versions blkid has changed. What version of Ubuntu are you running. Mine is Precise.

Maybe somewhere I added something but oldfred certainly does not remember. Your output looks the same except for all the extra spaces.

bogan
November 28th, 2012, 07:10 PM
HI!, cavsfan,

My Post #58 edited.

Try altering the Terminal size, or using a Terminal, if you were using a full screen Console.

Were you using Lucid ?

Chao!, bogan.

Cavsfan
November 28th, 2012, 08:13 PM
Yeah, it has to be the terminal size. I have a 28' monitor and had it full screen at the time.
Let me see what I can do.

OK that was it. Check this out:


cavsfan@cavsfan-desktop:~$ sudo blkid -c /dev/null -o list
[sudo] password for cavsfan:
device fs_type label mount point UUID
--------------------------------------------------------------------------------------------------------------------------------
/dev/sda1 ntfs C: (not mounted) 1CFC7A8DFC7A60C6
/dev/sda2 ext4 Lucid / a162dc8a-e4df-4b79-b4c3-524761ff7ae1
/dev/sda3 swap <swap> 2a80f59e-e7c3-418e-aab2-ab5d19255a2f
/dev/sda5 ext4 Precise (not mounted) 3b8b1954-24e6-4a5e-9074-70a1a94ed4be
/dev/sda6 swap (not mounted) 82c51b29-023f-4964-99b6-67b45a49527f
/dev/sda7 ext4 Quantal (not mounted) b5fc902c-0bf0-45b3-95a1-29f3c46dfe6a
/dev/sda8 swap (not mounted) 69ac3efc-8a8a-4056-89e0-59bb81c2f468
/dev/sda9 ext4 Lucid Generic (not mounted) 109c11d0-71e3-41a4-87da-9e81535499a5
/dev/sda10 swap (not mounted) 24aa8c8b-53dc-4ecc-852b-ff2c25c8b342
/dev/sda11 ext4 Precise-Generic (not mounted) 50104efb-d918-45a9-985e-a70c60e87ac0
/dev/sda12 swap (not mounted) 139390a6-2fe1-4ff2-b650-88ae3b0586c1
/dev/sda13 ext4 Quantal-Generic (not mounted) 580e8c62-78ce-44a2-93e3-ccebd37c3acc
/dev/sda14 swap (not mounted) ec3048b8-c644-435a-93bb-08bb4975d0db
/dev/sdb1 ntfs Fantom /media/Fantom 78B8D1A1B8D15DE6
cavsfan@cavsfan-desktop:~$
We'll have to keep the terminal size in mind I guess. It looks good now.

Thanks! :)

oldfred
November 28th, 2012, 08:32 PM
I have a 28' monitor

I thought I had a good sized monitor as my vision is not that great, but a 28 foot (28' ) monitor. :P

Cavsfan
November 29th, 2012, 05:50 PM
I thought I had a good sized monitor as my vision is not that great, but a 28 foot (28' ) monitor. :P

HA! Typo - 28 inch monitor! I guess not even this monitor helps my vision! :D

EDIT: I meant to say that yes I was using Lucid.

Cavsfan
December 15th, 2012, 09:27 PM
I added Raring Ringtail 13.04 as the 8th system on my Grub2 menu.

http://ompldr.org/tZ3BpcQ (http://ompldr.org/vZ3BpcQ)

It uses Grub version 2.00 just like Quantal Quetzal.

The normal login to Raring gives a quick shell logon screen but, quickly goes into Raring.

The Recovery option takes you to a shell login prompt.


grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0
Returns:

0 menuentry "Lycid Lynx 10.04" {
1 menuentry "Lycid Lynx 10.04 (Recovery Mode)" {
2 menuentry "Lycid Lynx Generic 10.04" {
3 menuentry "Lycid Lynx Generic 10.04 (Recovery Mode)" {
4 menuentry "Precise Pangolin 12.04" {
5 menuentry "Precise Pangolin 12.04 (Recovery Mode)" {
6 menuentry "Precise Pangolin Generic 12.04" {
7 menuentry "Precise Pangolin Generic 12.04 (Recovery Mode)" {
8 menuentry "Quantal Quetzal 12.10" {
9 menuentry "Quantal Quetzal 12.10 (Recovery Mode)" {
10 menuentry "Quantal Quetzal Generic 12.10" {
11 menuentry "Quantal Quetzal Generic 12.10 (Recovery Mode)" {
12 menuentry "Raring Ringtail 13.04" {
13 menuentry "Raring Ringtail 13.04 (Recovery Mode)" {
14 menuentry "Windows 7" {

It always defaults to 14 Windows 7 so in case of a reboot my wife is good to go with Windows 7.

Cavsfan
December 16th, 2012, 03:55 PM
BTW, when I installed Raring Ringtail 13.04, it pulled in 6 other swapfiles into /etc/fstab.
So, it had the partition my ext4 was on and 7 swapfiles; the right one and the 6 from the other Ubuntus on my system.

This is why I mentioned this in section 1.7 of the wiki.

Cavsfan
December 16th, 2012, 09:20 PM
I changed my Grub2 picture and I also noticed that in the Grub2 documentation that drs305 had written that black
can be used as a color without it making the font transparent.
So, black/black is acceptable but, only if you have a background image. If you have no image, the font will be transparent or invisible.

The wiki has been updated to reflect the above.
These are not the most ideal colors, but it shows that black can be used when an image is present.

This is with color_normal=black/black
and color_highlight=light-green/black.

http://ompldr.org/tZ3B6eA (http://ompldr.org/vZ3B6eA)

Cavsfan
December 17th, 2012, 07:05 PM
OK, this is the last one for a while. I am not very good at matching backgrounds to colors but, I believe this one looks pretty good. :)

http://ompldr.org/tZ3FkdA (http://ompldr.org/vZ3FkdA)

The font colors are color_normal=cyan/black
and color_highlight=light-cyan/black

Cavsfan
January 6th, 2013, 04:15 PM
Added a link at the bottom of the wiki to link back to this thread to post questions, etc.

Cavsfan
January 8th, 2013, 10:39 PM
Got rid of the extra systems and cleaned it up a bit but, I still like this background.
This is on Grub 2.00 on Raring Ringtail 13.04.
I just have the 5 OS's on it now.

http://ompldr.org/taDI4aA (http://ompldr.org/vaDI4aA)

Cavsfan
January 13th, 2013, 09:28 PM
I learned from cariboo907 that you can have one single swapfile for all of your Ubuntus.
So, I simplified my partitions and gained some room at the same time.


cavsfan@cavsfan-MS-7529:~$ sudo blkid
[sudo] password for cavsfan:
/dev/sda1: LABEL="C:" UUID="1CFC7A8DFC7A60C6" TYPE="ntfs"
/dev/sda2: LABEL="Lucid" UUID="a162dc8a-e4df-4b79-b4c3-524761ff7ae1" TYPE="ext4"
/dev/sda3: UUID="2a80f59e-e7c3-418e-aab2-ab5d19255a2f" TYPE="swap"
/dev/sda5: LABEL="Precise" UUID="3b8b1954-24e6-4a5e-9074-70a1a94ed4be" TYPE="ext4"
/dev/sda6: LABEL="Quantal" UUID="b5fc902c-0bf0-45b3-95a1-29f3c46dfe6a" TYPE="ext4"
/dev/sda7: LABEL="Raring" UUID="a6b7ac97-488f-4e87-b6af-247fcbf6df77" TYPE="ext4"
/dev/sdb1: LABEL="Fantom" UUID="78B8D1A1B8D15DE6" TYPE="ntfs"I had to edit each /etc/stab file and get the swap file to point to sda3 and the UUID above and everything is good.

Just don't make the same mistake I made by not moving my grub to my main Ubuntu on sda2 which was untouched.
I had grub installed on Raring and after deleting swapfiles, resizing/moving partitions, upon reboot I was looking at grub recovery :(
I recovered with my Lucid live CD pretty easily but, it would have been easier if I had thought before hand. :p


http://ompldr.org/taDI4aA (http://ompldr.org/vaDI4aA)

ChinaJustin
January 26th, 2013, 11:59 PM
(I accidentally posted this... well, somewhere else. I received two answers: 1) Check the Mint forums (by a mod :p) and 2) to use a different UUID in my grub.cfg. But now I'm copying and pasting HERE since I'm sure I'll get better answers. And this is where I meant it to go to begin with! ;))

Just did a clean install of Linux Mint Nadia (based on Ubuntu 12.10) and tried setting up my Grub 2.00 menu as normal. But ran into two problems:

1) When I run 'update-grub', I do not get the echo line from my 06_custom file. Also related to this problem is that my Grub menu items are the standard ones, and not the labels I wanted (i.e. "Windows Vista (/bootloader) on sdax" as opposed to just "Windows Vista").
2) When I chmod -x the os_prober file and run update-grub, it only "finds" my Vista partition. Now, I only have the kernel that came installed with LM 14, but I don't remember my only having one installed kernel being an issue before; as I recall, even with just one kernel it recognized and added the appropriate entry to the Grub menu. But now, if I run ubdate-grub and reboot, I just see my Vista partition.

Here is my 06_custom file:



#!/bin/sh
echo 1>&2 "Adding Linux Mint and Windows Vista"
exec tail -n +4 $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 "Linux Mint 14 - Nadia" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro quiet splash
initrd /initrd.img
}
menuentry "Linux Mint 14 - Nadia (Recovery Mode)" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro single
initrd /initrd.img
}
menuentry "Windows Vista" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 32C2B4EDC2B4B707
chainloader +1
}
Ideas?

oldfred
January 27th, 2013, 01:28 AM
Grub2 2.00 it seems does not work with the old commands with echo. Actually the original post was to use a terminal's echo command to add lines to 40_custom and somehow that got picked up as part of what to post into 40_custom, so users copied & pasted it into their custom grub files. Old versions of grub tolerated various things but now it does not.

Remove the echo line.

first lines should just be:


#!/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.

ChinaJustin
January 27th, 2013, 01:48 AM
oldfred,

Thanks. So that takes care of any "echo"-ing that can be customized, but what about the issue of the "menuentry" not getting picked up on the grub update?

oldfred
January 27th, 2013, 05:32 PM
I used the same 40_custom thru several versions of Ubuntu/grub. But then with 1.99 it stopped working. It actually reported an error and wrote a backup grub.cfg file. It turned out I had a missing } and one stanza was always missing, but it was for something I had stopped booting and never really missed.
So any typo now can cause issues.

Are entries in grub.cfg?

Cavsfan
January 27th, 2013, 06:25 PM
oldfred,

Thanks. So that takes care of any "echo"-ing that can be customized, but what about the issue of the "menuentry" not getting picked up on the grub update?

Here is my 06_custom file on Grub 2.00 in Ubuntu Quantal Quetzel 12.10:


#!/bin/sh
echo 1>&2 "Adding Ubuntu Quantal Quetzal 12.10 and Windows 7"
exec tail -n +4 $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 "Quantal Quetzal 12.10" {
set root=(hd0,6)
linux /vmlinuz root=/dev/sda6 ro quiet splash
initrd /initrd.img
}
menuentry "Quantal Quetzal 12.10 (Recovery Mode)" {
set root=(hd0,6)
linux /vmlinuz root=/dev/sda6 ro single
initrd /initrd.img
}
menuentry "Windows 7" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 1CFC7A8DFC7A60C6
chainloader +1
}The exec tail -n +4 $0 line tells it to execute the 4th line from the top which is the 1st menuentry line.
You will only see the echo output from line 2 when you enter sudo update-grub in terminal.
It will list your picture and the echo line on line 2.
The menuentry lines are only what will display on your grub menu.

See this post by Drs305 on the old tutorial thread here (http://ubuntuforums.org/showpost.php?p=12034165&postcount=121).
(this is when grub 1.99 came out)

ChinaJustin
January 27th, 2013, 08:27 PM
The exec tail -n +4 $0 line tells it to execute the 4th line from the top which is the 1st menuentry line.
You will only see the echo output from line 2 when you enter sudo update-grub in terminal.
It will list your picture and the echo line on line 2.
The menuentry lines are only what will display on your grub menu.


According to oldfred, though, 2.00 doesn't do "echo" lines anymore:



Grub2 2.00 it seems does not work with the old commands with echo.


Are you saying it does for you, Cavsfan? Because it's not working for me, either.

Also, let me clarify from my previous post (#71):

When I run update-grub and then reboot my system, my menu entries on the grub menu do not reflect the changes I made in the 06_custom file as posted in post #71.

I don't really care about the "echo" command, because that's really just something for me to see and "ooo" and "ahh" at. But I really do want the menu entries to reflect what I want them to.

Also, why would "chmod -x"-ing the os_prober file and running update-grub only find my Vista partition and not my base LinuxMint kernels? (I only have the kernels from the clean install: no updates).

EDIT: OK, so apparently, I forgot to chmod +x my 06_custom file. After reading oldfred's question about whether the entries were even in the grub.cfg file or not, I found that they weren't. I thought that I HAD done the chmod +x command, so either it didn't take... or I didn't do it. For the sake of my sanity and personal image, I'm saying it didn't take. :wink:

oldfred
January 27th, 2013, 08:46 PM
I do not see an error. But my 40_customs have always had +3?

A while back there were some issues with extra spaces at an end of line or the end of the file. Impossible to visually tell if that is an issue or not anymore.

If you have turned off os-prober then only entires you have added in your 06 or 40 custom will be added. Is you 06_custom have execute bit set?

In /etc/default/grub I added this:
gksudo gedit /etc/default/grub
GRUB_DISABLE_OS_PROBER=true
or turn off executeable bit
sudo chmod a-x /etc/grub.d/30_os-prober

sudo chmod 755 /etc/grub.d/06_custom
or
sudo chmod a+x /etc/grub.d/06_custom

Did you check your grub.cfg to see if boot stanza are there?

Cavsfan
January 27th, 2013, 10:47 PM
OK, so apparently, I forgot to chmod +x my 06_custom file.

That will do it every time! I thought that may be the problem. ChinaJustin if you recall you were the one asking the question about why the exec tail -n +3 $0 line did not work with the echo lines on every entry.
That is when Drs305 stepped in and told us that when grub went to 1.99

This is from Lucid - grub 1.98:


#!/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.
echo "Lucid Lynx 10.04" >&2
cat << EOF
menuentry "Lucid Lynx 10.04" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro quiet splash
initrd /initrd.img
}
EOF
Which as Drs305 said changed to this in grub 1.99 and 2.00.
Changing the 3 to 4 and adding the echo line as the 2nd line causes the first executable line to be the 4th line down (the 1st menuentry).
Or you could leave it a 3 and leave out the echo as you stated since you are the only one to see it when you type sudo update-grub in terminal is fine too.


#!/bin/sh
echo 1>&2 "Adding Ubuntu Lucid Lynx and Windows 7"
exec tail -n +4 $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.
echo "Lucid Lynx 10.04" >&2
cat << EOF
menuentry "Lucid Lynx 10.04" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro quiet splash
initrd /initrd.img
}
EOF
echo "Lucid Lynx 10.04 (Recovery Mode)" >&2
cat << EOF
menuentry "Lucid Lynx 10.04 (Recovery Mode)" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro single
initrd /initrd.img
}
EOF
echo "Windows 7 Loader" >&2
cat << EOF
menuentry "Windows 7" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 1cfc7a8dfc7a60c6
chainloader +1
}
EOF


Oldfred, at that time all I had installed was Lucid with grub 1.98 so I was not keeping up with the times like I should have been.
Bogan pointed out that my tutorial was wrong and when that finally got through my thick head, I fixed it.
So, the new wiki is a lot better as it splits it between grub 1.98, 1.99 and 2.00.
I need to update it with the grub versions instead of the Ubuntu versions because they can change but, the grub version is what is important.
But, come April grub 1.98 will be a thing of the past.

The reason I say to save 40_custom as 06_custom is that even when you have 10_linux and 30_os-prober executable, the custom display will be on top and be static.
If you save the 40_custom file, the custom entries will be on the bottom and change when the other 2 files are made executable.

Now I have 4 Ubuntu versions installed so I can at least try to keep up. :)

Cavsfan
February 15th, 2013, 04:10 PM
I upgraded my main install Lucid Lynx 10.04 LTS to Precise Pangolin 12.04.2 LTS yesterday.
It upgraded Grub from version 1.98 to 1.99. I didn't restore my default grub but, I did take the installers version of every file it asked about.

When you have edited a file it asks if you want to keep your version or take the installers version.
Of course to get the full benefits of version 1.99 I took the installers version of /etc/default/grub and /etc/grub.d/05_debian_theme.

When it automatically did the update-grub command I seen an error on line 59 message and it would not have been bootable as it was.

When it asked to reboot to complete the upgrade I said no (n).

I then made my 06_custom file unexecutable: sudo chmod -x /etc/grub.d/06_custom and of course sudo update-grub and I got no errors.

So then I knew it was safe to reboot.
The customized 06_custom file from grub 1.98 will not work with grub version 1.99 so I had to edit it like the wiki says for grub versions 1.99 and 2.00.

They only real operational difference I notice with grub 1.99 is when I select Windows 7 (or probably any windows os), I see an erroneous error:

Error: No argument specified.

Press any key to contiue...which means nothing and you can just wait or press enter and it will go into windows just fine.

So, I guess the most important things are when doing an upgrade to a newer version of grub it to accept the installers versions of any file is asks about and also make 06_custom unexecutable.
You must do this before you reboot if you see that grub has an error or it probably will boot with a grub rescue prompt.

Cavsfan
February 16th, 2013, 08:27 PM
Added some info in the Introduction which is underlined about what to do if you do not restore your grub files
before upgrading from one version of Ubuntu to another if the grub files are updated to another version.

bogan
February 16th, 2013, 09:52 PM
Hi!, Cavsfan,

Pity I did not see your Yesterday's Post, before I updated/upgraded 12.04.1 to 12.04.2.

As my grub menus were already so corrupted, and I was doing a clean format & install, I did not think it mattered. Besides, I had forgotten your similar advice in the original 'How To'.

In fact I made a real snafu of it anyway, I had used 'tune2fs' to label the partitions, and got them the wrong way round; root & home!!

So I formatted the old home and installed 12.04.2 on it, and the new home went on top of 12.04.1.

It is a wonder any of it worked. The new Grub Menu had 69 entry lines, but the first 22 were OK !! Though it included two 12.04.2 entries, one for sda5 & the other for sda8. The later seemed to be perfectly normal. See my Post:
http://ubuntuforums.org/showthread.php?t=2116405

So I have reformatted both and reinstalled; now the new 12.04.2 Grub Menu has 88 entries, all except the first two are corrupt, but all are displayed.

Edit: I just checked the 12.04.2 fstab, and it had a extra swap entry which I deleted, & ran 'update-grub, but it made no difference.

But at least the Grub menus in my two 12.10 partitions are use-able, and apparently visually correct, as far as I have checked and tried them.

This despite the following command showing 43 entry lines when only the first 20 are displayed, the rest being corrupted.
grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0 Do you know whether, if I delete the /boot/grub/grub.cfg file completely, a new one will be created by 'update-grub' ?, or should I delete only the corrupt text, leaving the skeleton file in place.??

Chao!, bogan.

oldfred
February 16th, 2013, 09:59 PM
@bogan
If you keep going will you get an infinite number of entries?

The update grub always creates a new grub.cfg except when I had a typo in my 40_custom. Then it gave an error and wrote it with a different name something like grub.cfg.err.

I have so many old installs on several drives that I have to turn os-prober off. Then I add my own entries into 40_custom. I also learned from Ranch Hand, but cavsfan did a good job on documenting how to boot a partition not a specific kernel.

bogan
February 16th, 2013, 10:18 PM
Hi!, oldfred,

I have run 'update-grub' 8 or 9 times since reinstalling and it has stuck at 88 lines.

There has been a conflict for a long time, ever since 12.10 was released and Grub Customizer could not handle the Additional Options sub-menus, and Grub 2.00 does not seem to like multiple Grubs in multiple drives, especially when three are running Grub 2.00 on different drives, and another is running Grub 1.99.

I saw a comment that Grub 2 does not check the hardware, but reads the already existing files and duplicates them. [I think from DRS305?]

At one stage, before the 12.04.2 snafu, I could only get into my external HDD, by Booting from BIOS to the UsbStick and using the Grub Menu there to boot into the Ext HDD.

At least that problem seems to have gone away.

Edit: I did not turn off os_prober as Cavsfan's system would not boot to external installations, it could not find the initial boot files and complained it needed a kernal to be installed first.
Chao!, bogan.

Cavsfan
February 16th, 2013, 11:35 PM
I also learned from Ranch Hand, but Cavsfan did a good job on documenting how to boot a partition not a specific kernel.

Thanks! :) When all of this made sense to me I asked Ranch Hand if he thought it would be a good idea to make a tutorial out of the concept and he thought it would.
So I did it. It was actually a good thing it went to wiki as it had become convoluted and the wiki is fairly clear.
It will become much better after April when Grub 1.98 is no longer supported.

Through experience we learned that the custom entry will boot the last installed kernel and not the latest numbered kernel.


Hi!, oldfred,

I have run 'update-grub' 8 or 9 times since reinstalling and it has stuck at 88 lines.

There has been a conflict for a long time, ever since 12.10 was released and Grub Customizer could not handle the Additional Options sub-menus, and Grub 2.00 does not seem to like multiple Grubs in multiple drives, especially when three are running Grub 2.00 on different drives, and another is running Grub 1.99.

I saw a comment that Grub 2 does not check the hardware, but reads the already existing files and duplicates them. [I think from DRS305?]

At one stage, before the 12.04.2 snafu, I could only get into my external HDD, by Booting from BIOS to the UsbStick and using the Grub Menu there to boot into the Ext HDD.

At least that problem seems to have gone away.

Edit: I did not turn off os_prober as Cavsfan's system would not boot to external installations, it could not find the initial boot files and complained it needed a kernal to be installed first.
Chao!, bogan.

Bogan,
Leaving the 06_custom file executable will give you all of your original (custom) entries at the top plus the ones that display from 10_linux and 30_os-prober.
That will double (at least) the entries.
My main concern was that upgrading from Lucid Lynx with Grub 1.98 to Precise Pangolin with Grub 1.99 was that the 06_custom file will not work with Grub 1.99.
As you well know. You are the one that got me to fix the tutorial. I was complacent with only Lucid Lynx 10.04 LTS installed on my PC and did not know that grub changed.
Drs305 originally pointed out the difference. Since then I have had each of the latest Ubuntus installed.

I did not restore the default grub files as my own instructions said to do either.

What alarmed me was after everything was upgraded to Precise and it did update-grub it said there was an error on line 59.
So, when it asked me to press Y to reboot, I knew that would end up bad. I pressed n instead and knew I had better fix it first.
I made 06_custom unexecutable and the output of update-grub then did not return any errors.
Then I rebooted. Everything was fine.
That is when I realized the vast difference between 06_custom in Grub 1.98 and 1.99.
I cheated a bit though as I had another Precise install and simply copied that over and edited it.

So, I guess if nothing else always accept the installer's version of all of the grub files so that you benefit from the newer version but, make sure you make 06_custom unexecutable.
Then there should be no problems upon upgrading.

Drs305 also helped me partition my drive so that I could have this many installs and that was pretty tedious.
I had used Windows 7, Ubuntu Lucid, my swap and the extended partition as my 4 physical partitions.
I did not know how to move more of the space from my windows partition over to the extended partition until Drs305 helped me.

This command is virtually worthless unless you have a 06_custom but, here is what I have:


cavsfan@cavsfan-desktop:~$ cat /etc/grub.d/06_custom | grep menuentry | awk '{ print $1 " " $2 " " $3 }' | nl --starting-line-number=0
0 menuentry "Precise Pangolin
1 menuentry "Precise Pangolin
2 menuentry "Lucid Lynx
3 menuentry "Lucid Lynx
4 menuentry "Precise Pangolin2
5 menuentry "Precise Pangolin2
6 menuentry "Quantal Quetzal
7 menuentry "Quantal Quetzal
8 menuentry "Raring Ringtail
9 menuentry "Raring Ringtail
10 menuentry "Windows 7"
So, my main install is Precise at the top. I'll keep Lucid until April 13th. The 2nd Precise will become what ever the next version of Ubuntu is.
Then the order will be resequenced. What is so cool about it is that the partitions may be all out of sequence but,
with the 06_custom file you can make them appear in any order you want. :D

bogan
February 17th, 2013, 11:34 AM
HI!, Cavsfan,

Thanks for your response, I thought I should Post the actual GrubMenu grep output,as the pattern is clear. This from the Grub of my main hdd 12.10 having just altered the 'Titles' in its 06_custom file.

The actual 12.10 Grub Boot menu displays only the first 20 lines; whereas the 12.04.2 Grub 1.99-2ubuntu displays all of them, plus a lot more and garbage besides.
:~$ grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0
0 menuentry "Quantal sda10" {
1 menuentry "Quantal sda10 (Recovery)" {
2 menuentry "Windows 7 on sda1" {
3 menuentry "Quantal USB sdc2" {
4 menuentry "Quantal USB sdc2 (Recovery)" {
5 menuentry "Quantal EXT sdb7" {
6 menuentry "Quantal EXT sdb7 (Recovery)" {
7 menuentry "Precise 12.04.2 sda8" {
8 menuentry "Precise 12.04.2 sda8 (Recovery)" {
9 menuentry 'Ubuntu
10 submenu 'Advanced options for Ubuntu
11 menuentry 'Ubuntu, with Linux 3.5.0-24-generic
12 menuentry 'Ubuntu, with Linux 3.5.0-24-generic (recovery mode)
13 menuentry "Memory test (memtest86+)" {
14 menuentry "Memory test (memtest86+, serial console 115200)" {
15 menuentry 'Windows 7 (loader) (on /dev/sda1)
16 menuentry 'Windows Recovery Environment (loader) (on /dev/sda4)
17 menuentry 'Ubuntu 12.04.2 LTS (12.04)
18 submenu 'Advanced options for Ubuntu 12.04.2 LTS (12.04)
19 menuentry 'Ubuntu, with Linux 3.5.0-23-generic (on /dev/sda8)
20 menuentry 'Ubuntu, with Linux 3.5.0-23-generic (recovery mode) (on /dev/sda8)

[ from EXT HDD sdb7, note titles are previous versions]

21 menuentry 'Ubuntu 12.10 (12.10)
22 submenu 'Advanced options for Ubuntu 12.10 (12.10)
23 menuentry 'Quantal 12.10 USB sdc2 (on /dev/sdb7)
24 menuentry 'Quantal 12.10 USB sdc2 (Recovery) (on /dev/sdb7)
25 menuentry 'Quantal 12.10 sda10 (on /dev/sdb7)
26 menuentry 'Quantal 12.10 sda10 (Recovery) (on /dev/sdb7)
27 menuentry 'Quantal 12.10 EXT sdb7 (on /dev/sdb7)
28 menuentry 'Quantal 12.10 EXT sdb7 (Recovery) (on /dev/sdb7)
29 menuentry 'Precise 11.10 sda5 (on /dev/sdb7)
30 menuentry 'Precise 11.10 sda5 (Recovery) (on /dev/sdb7)
31 menuentry 'Ubuntu (on /dev/sdb7)
32 menuentry 'Ubuntu, with Linux 3.5.0-23-generic (on /dev/sdb7)
33 menuentry 'Ubuntu, with Linux 3.5.0-23-generic (recovery mode) (on /dev/sdb7)
34 menuentry 'Ubuntu 12.10 (12.10) (on /dev/sdb7)
35 menuentry 'Ubuntu 12.10 (12.10) (on /dev/sdb7)

[ from EXT USB sdc2, note it has no 06-custom file]

36 menuentry 'Ubuntu 12.10 (12.10)
37 submenu 'Advanced options for Ubuntu 12.10 (12.10)
38 menuentry 'Ubuntu (on /dev/sdc2)
39 menuentry 'Ubuntu, with Linux 3.5.0-23-generic (on /dev/sdc2)
40 menuentry 'Ubuntu, with Linux 3.5.0-23-generic (recovery mode) (on /dev/sdc2)
41 menuentry 'Ubuntu 12.10 (12.10) (on /dev/sdc2)
42 menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sdc2)
43 menuentry 'Ubuntu 12.10 (12.10) (on /dev/sdc2)
:~$ Nearly all of the entries with spurious '(on /dev/sdxX)' suffixes are corrupt inside and lead to 'initramfs' prompt hang ups, or no kernal found errors.

LInes 29 & 30 are ancient relics of an overlong night session.

I do not know if this clears things up a bit, or makes it even more obscure.

Chao!, bogan.

oldfred
February 17th, 2013, 02:31 PM
If you are only seeing 20 lines is that video mode for grub.

And then do you have that little tiny arrow aat the lower right side of the box? That says you have more entries & can scroll down?

bogan
February 17th, 2013, 04:02 PM
Hi!, oldfred,

Thanks for the suggestion.

My Grub is set to 1920x1080 and the grub box fills it except for an inch or so all round.

The20 lines - actually 21, as displayed - fills about a quarter of the box and there is no 'Little Arrow' visible.

I am not complaining - far from it - the rest of the 48 are effectively garbage.

Chao!, bogan.

Cavsfan
February 17th, 2013, 05:23 PM
HI!, Cavsfan,

Thanks for your response, I thought I should Post the actual GrubMenu grep output,as the pattern is clear. This from the Grub of my main hdd 12.10 having just altered the 'Titles' in its 06_custom file.

The actual 12.10 Grub Boot menu displays only the first 20 lines; whereas the 12.04.2 Grub 1.99-2ubuntu displays all of them, plus a lot more and garbage besides.
:~$ grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0
0 menuentry "Quantal sda10" {
1 menuentry "Quantal sda10 (Recovery)" {
2 menuentry "Windows 7 on sda1" {
3 menuentry "Quantal USB sdc2" {
4 menuentry "Quantal USB sdc2 (Recovery)" {
5 menuentry "Quantal EXT sdb7" {
6 menuentry "Quantal EXT sdb7 (Recovery)" {
7 menuentry "Precise 12.04.2 sda8" {
8 menuentry "Precise 12.04.2 sda8 (Recovery)" {
9 menuentry 'Ubuntu
10 submenu 'Advanced options for Ubuntu
11 menuentry 'Ubuntu, with Linux 3.5.0-24-generic
12 menuentry 'Ubuntu, with Linux 3.5.0-24-generic (recovery mode)
13 menuentry "Memory test (memtest86+)" {
14 menuentry "Memory test (memtest86+, serial console 115200)" {
15 menuentry 'Windows 7 (loader) (on /dev/sda1)
16 menuentry 'Windows Recovery Environment (loader) (on /dev/sda4)
17 menuentry 'Ubuntu 12.04.2 LTS (12.04)
18 submenu 'Advanced options for Ubuntu 12.04.2 LTS (12.04)
19 menuentry 'Ubuntu, with Linux 3.5.0-23-generic (on /dev/sda8)
20 menuentry 'Ubuntu, with Linux 3.5.0-23-generic (recovery mode) (on /dev/sda8)

[ from EXT HDD sdb7, note titles are previous versions]

21 menuentry 'Ubuntu 12.10 (12.10)
22 submenu 'Advanced options for Ubuntu 12.10 (12.10)
23 menuentry 'Quantal 12.10 USB sdc2 (on /dev/sdb7)
24 menuentry 'Quantal 12.10 USB sdc2 (Recovery) (on /dev/sdb7)
25 menuentry 'Quantal 12.10 sda10 (on /dev/sdb7)
26 menuentry 'Quantal 12.10 sda10 (Recovery) (on /dev/sdb7)
27 menuentry 'Quantal 12.10 EXT sdb7 (on /dev/sdb7)
28 menuentry 'Quantal 12.10 EXT sdb7 (Recovery) (on /dev/sdb7)
29 menuentry 'Precise 11.10 sda5 (on /dev/sdb7)
30 menuentry 'Precise 11.10 sda5 (Recovery) (on /dev/sdb7)
31 menuentry 'Ubuntu (on /dev/sdb7)
32 menuentry 'Ubuntu, with Linux 3.5.0-23-generic (on /dev/sdb7)
33 menuentry 'Ubuntu, with Linux 3.5.0-23-generic (recovery mode) (on /dev/sdb7)
34 menuentry 'Ubuntu 12.10 (12.10) (on /dev/sdb7)
35 menuentry 'Ubuntu 12.10 (12.10) (on /dev/sdb7)

[ from EXT USB sdc2, note it has no 06-custom file]

36 menuentry 'Ubuntu 12.10 (12.10)
37 submenu 'Advanced options for Ubuntu 12.10 (12.10)
38 menuentry 'Ubuntu (on /dev/sdc2)
39 menuentry 'Ubuntu, with Linux 3.5.0-23-generic (on /dev/sdc2)
40 menuentry 'Ubuntu, with Linux 3.5.0-23-generic (recovery mode) (on /dev/sdc2)
41 menuentry 'Ubuntu 12.10 (12.10) (on /dev/sdc2)
42 menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sdc2)
43 menuentry 'Ubuntu 12.10 (12.10) (on /dev/sdc2)
:~$ Nearly all of the entries with spurious '(on /dev/sdxX)' suffixes are corrupt inside and lead to 'initramfs' prompt hang ups, or no kernal found errors.

LInes 29 & 30 are ancient relics of an overlong night session.

I do not know if this clears things up a bit, or makes it even more obscure.

Chao!, bogan.

Bogan,
I have found along with Drs305's help that when you re-install a Ubuntu it leaves /etc/fstab with more than one entry.
It will have where the ext4 was initially installed and where it is currently installed.
It also repeats swap files as well if you have more than one.

An admin here told me I just need one swap file and every time I install it will pick that swap file up.
So, I no longer have trouble with multiple swap files in fstab.

That would explain why it says everything is on sdb7 and sdc2.
Not quite sure which fstab but, it is probably the install you are reporting these entries from.

So, I would start checking /etc/fstab files.
A simple way to check is with cat:


cavsfan@cavsfan-desktop:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda2 during installation
UUID=a162dc8a-e4df-4b79-b4c3-524761ff7ae1 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda3 during installation
UUID=2a80f59e-e7c3-418e-aab2-ab5d19255a2f none swap sw 0 0
You can even check fstab files on other installs:
This is while in Precise looking at Quantal:

cavsfan@cavsfan-desktop:~$ cat /media/Quantal/etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda7 during installation
UUID=b5fc902c-0bf0-45b3-95a1-29f3c46dfe6a / ext4 errors=remount-ro 0 1
# swap was on /dev/sda3 during installation
UUID=2a80f59e-e7c3-418e-aab2-ab5d19255a2f none swap sw 0 0


Hope this helps.

bogan
February 17th, 2013, 06:58 PM
Hi!, Cavsfan,

Thanks for the response.

I was mind-full from our previous exchange of the need to check fstab, and I checked them all . Only the fstab of the newest install had an extra 'Swap', which I deleted, the other entries were all OK.

As previously, doing so did not change the Additional Option entries being suffixed by spurious (on /dev/sdb7) or (on/dev/sdc2) suffixes, the scripts inside are also corrupted with altered hdxX -msdosX and sdxX values.

I worked out the answer to the puzzle of the 21 line display, out of 44:

The 21 lines includes 13 actual working Ubuntu OS entries, the rest are 4 Additional Option sub-menu lines and 4 Windows & Memtest lines.

The 44 include those, but also the expanded Additional Option sub-menus, and this is where the errors show up:

The base 12.10 and the new 12.04.2 expand correctly giving two lines each, normal & recovery; one shows the same pair, but adds three other entries, whilst the last shows, in addition, the whole list from the '06_custom' file in the external HDD, sdb7.

I am going to deactivate the '06-custom in sdb7, which I do not use - I can not boot from it directly - and see what difference it makes.

Chao!, bogan.

Cavsfan
February 17th, 2013, 08:25 PM
Hi!, Cavsfan,

Thanks for the response.

I was mind-full from our previous exchange of the need to check fstab, and I checked them all . Only the fstab of the newest install had an extra 'Swap', which I deleted, the other entries were all OK.

As previously, doing so did not change the Additional Option entries being suffixed by spurious (on /dev/sdb7) or (on/dev/sdc2) suffixes, the scripts inside are also corrupted with altered hdxX -msdosX and sdxX values.

I worked out the answer to the puzzle of the 21 line display, out of 44:

The 21 lines includes 13 actual working Ubuntu OS entries, the rest are 4 Additional Option sub-menu lines and 4 Windows & Memtest lines.

The 44 include those, but also the expanded Additional Option sub-menus, and this is where the errors show up:

The base 12.10 and the new 12.04.2 expand correctly giving two lines each, normal & recovery; one shows the same pair, but adds three other entries, whilst the last shows, in addition, the whole list from the '06_custom' file in the external HDD, sdb7.

I am going to deactivate the '06-custom in sdb7, which I do not use - I can not boot from it directly - and see what difference it makes.

Chao!, bogan.

Glad you are getting it figured out! Let me know how it goes.

bogan
February 18th, 2013, 10:59 PM
Hi!, Cavsfan,

As I proposed, I deactivated the 06_custom file in the external HDD sb7 12.10 installation, and deleted the spurious entries in /boot/grub/grub.cfg, before running 'update-grub'.

I then went round all the installations and deleted similar files in each before running each 'update-grub' in turn.
This resulted in reducing the number of grub menu entries in 12.10, from 44 to 34, and those in 12.04.2 from 88 to 64, though of the latter, only the first few entries are normal and usable, the rest are single lines and either end at: "class os {" or " menuentries option-id".[ or something like that.]

Best of all it has got rid of the historical old entries for OS's & Partitions that no longer exist, and most of the duplicate entries. So that is a great improvement.

The spurious '( on /dev/sdxX)' suffixes still occur in the Additional Options sub-menus, but they have no effect; though the altered partition references, in the scripts, cause problems, I just have to remember which work and which need editing.

It seems clear that the combination of grub 1.99 & 2.00 with multiple drives, results in 12.04 being unable to handle the new sub-menus.

Chao!, bogan.

Cavsfan
February 19th, 2013, 05:52 PM
It seems clear that the combination of grub 1.99 & 2.00 with multiple drives, results in 12.04 being unable to handle the new sub-menus.

Bogan,
I am glad you are getting your system sorted out. The custom grub file does not look at any sub-menus.

The only way a sub-menu would display is if you have 10_linux executable.

It only looks at whatever you put in 06_custom which can only contain the latest installed kernel on each Ubuntu.
I do not believe that grub versions interfere with each other on other OSs.
If you have grub installed on your Precise install, your PC should be using Grub 1.99 and every OS should be looked at by the Grub that is installed on Precise.

If you have your grub installed on Quantal or Raring then Grub 2.00 will be in control. There is very little difference between 1.99 and 2.00 that I have found.

The one thing is the error (erroneous) when I select Windows 7. I just press enter or wait and it goes into Windows fine.

I remember Drs305 trying to help get rid of that erroneous error but, since he did not have any windows os, we did not get there from here.

But, what I am saying is that when you login to another Ubuntu that does not have the grub installed on and enter sudo update-grub it does not effect the grub that appears at boot.

offgridguy
February 19th, 2013, 06:23 PM
Interesting thread, I will have to try this, Thanks.

Cavsfan
February 19th, 2013, 07:44 PM
Interesting thread, I will have to try this, Thanks.

You are welcome. :D Just a couple of things: when you get to the part that says to edit /etc/grub.d/40_custom be sure and save it as /etc/grub.d/06_custom, leaving /etc/grub.d/40_custom as is.
Then make it executable and remember to enter sudo update-grub.

This way you have not really made any drastic changes. The custom menu will display at the top and all of the normal boot entries will display below that.

When you have made absolute sure everything works as expected in the custom section, then make /etc/grub.d/20_memtest86+, /etc/grub.d/10_linux and /etc/grub.d/30_os-prober unexecutable.

Then you will have a nice custom screen that appears at boot time and you never have to change it unless you want to or you add or remove a Ubuntu or another OS.
Or if you upgrade to another version of Ubuntu and the Grub version changes. The wiki has that covered too.
It works with Ubuntu, Debian, Mint, all Windows OSs and probably others.

bogan
February 19th, 2013, 09:41 PM
Hi!, Cavsfan,

Thanks for your elucidation, I was aware of the facts and implications of what you describe, and that, by keeping 30_os-prober executable i was going against your advice.

I did so because the 06_custom entries for OS's on disks other than the host, would not work, giving ' the kernal must be installed first' or 'initrd file not found' messages.

You Posted:
But, what I am saying is that when you login to another Ubuntu that does not have the grub installed on and enter sudo update-grub it does not effect the grub that appears at boot. I agree that that is what is supposed to be the case, but the reverse is not the case if both have their 30_os-prober files executable:
When 'sudo update-grub' is entered in a Ubuntu that does have grub installed on it, but does not have control, and that grub configuration is altered, the next time 'sudo update-grub' is entered in the Ubuntu that does have control, the changes to the non-controlling grub will be reflected in the grub that appears at boot, [And, of course, in the /boot/grub/grub.cfg files in both.]

That at least is my experience with both of my Desktop computers and is reflected in the improvement in the displayed menus following my described editing exercise.

it is also inevitable whilst grub takes its data from other drives from their existing files, rather than addressing the hardware & firmware. [Apologies if that is the wrong terminology, and for the convoluted sentences.]

Chao!, bogan,

Cavsfan
February 19th, 2013, 11:22 PM
Hi!, Cavsfan,

Thanks for your elucidation, I was aware of the facts and implications of what you describe, and that, by keeping 30_os-prober executable i was going against your advice.

I did so because the 06_custom entries for OS's on disks other than the host, would not work, giving ' the kernal must be installed first' or 'initrd file not found' messages.

You Posted:I agree that that is what is supposed to be the case, but the reverse is not the case if both have their 30_os-prober files executable:
When 'sudo update-grub' is entered in a Ubuntu that does have grub installed on it, but does not have control, and that grub configuration is altered, the next time 'sudo update-grub' is entered in the Ubuntu that does have control, the changes to the non-controlling grub will be reflected in the grub that appears at boot, [And, of course, in the /boot/grub/grub.cfg files in both.]

That at least is my experience with both of my Desktop computers and is reflected in the improvement in the displayed menus following my described editing exercise.

it is also inevitable whilst grub takes its data from other drives from their existing files, rather than addressing the hardware & firmware. [Apologies if that is the wrong terminology, and for the convoluted sentences.]

Chao!, bogan,

Bogan,
Thanks for that explication. It does make sense that sudo update-grub would have an effect on 30_os-prober and/or 10_linux as well as the grub.cfg file when other drives with Ubuntus installed on them are involved.
As update-grub would definitely have to examine those other drives and include what it finds.

I was just thinking about the 06_custom file by itself along with only one drive. It cannot be altered by another Ubuntu.
I have edited another Ubuntu's 06_custom file but, I knew that executing sudo update-grub would have to be performed while in that OS.

You must have a fairly prodigious system with so many installations.
I only have a 500GB drive with all of my systems on it. I have a 1TB USB drive but, I only use it for backing my windows 7 installation up which is done automatically once per week.
Of course I also use it to backup my Ubuntus if I need to re-install.

So, I guess you have your Grub all corrected now pointing to the right installs?

bogan
February 20th, 2013, 01:59 PM
Hi!, Cavsfan,

You Posted:
So, I guess you have your Grub all corrected now pointing to the right installs?I wish!

The 06_custom entries now, and the other entries on the main OS grub menu, are all Ok, and the Additional Options sub menus are mostly correct. All the entries are OK in the USB stick.

The two 12.04 OS's on the Internal HDD are only correct for the host OS , Windows, & Mem test; the rest, all 58 of them, are garbage. An example of what they produce is this:
> 65 menuentry "Precise 12.04.2 sda8 (on /dev/sda10)' --class gnu-linux --class gnu --class os $menuentry_id_option
66 menuentry "Precise 12.04.2 sda8 (Recovery) (on /dev/sda10)' --class gnu-linux --class gnu --class os $menuentry_id_option
67 menuentry "Ubuntu (on /dev/sda10)' --class gnu-linux --class gnu --class os $menuentry_id_option
68 menuentry "Ubuntu, with Linux 3.5.0-24-generic (on /dev/sda10)' --class gnu-linux --class gnu --class os $menuentry_id_option
69 menuentry "Ubuntu, with Linux 3.5.0-24-generic (recovery mode) (on /dev/sda10)' --class gnu-linux --class gnu --class os $menuentry_id_option However, as the only time I use those grubs is following a kernal or grub update, I can live with that.

In all this, two of the things I have learnt are perhaps important enough to pass on in the Wicki:

First:
With multiple OS's on multiple drives capable of being booted from Bios boot selection, only the main OS should have 06_custom files activated, to avoid confusion. Especially if a drive is on a mobile HDD or USB stick,used with multiple computers.
This is because the 'sdxX' mount settings alter according to which drive is selected to boot from. For example: my USB back-up OS stick, can be sda, sdc, or sdf.

Second:
The 'spurious' suffixes on groups of menu entries, eg ( on sdb7) are not spurious at all, they tell you from which partition Grub got the data in that section, they do not have any effect on operation.

Chao!, bogan.

Cavsfan
February 20th, 2013, 08:45 PM
Thanks Bogan. I'll try to incorporate that 1st one into the wiki when I can.
I don't really understand the 2nd one.

I have always been of the opinion that your main install should have the grub installed on it.
But, because Precise uses Grub 1.99 which gives that error when selecting windows,
I installed my grub on Quantal Quetzal 10.10 install which uses grub 2.00.

This is just my opinion but, I believe one should keep it simple and have all of your installs on one drive.

However having said that it is totally up to each individual but, perhaps this custom Grub setup may not
be for those as yourself who have usb sticks, etc. connected with operating systems installed on them.

But, what would you have if you made all of your 06_custom files unexecutable and 10_linux and 30_os-prober files executable?
I believe you said it would be a huge mess.
That is not the fault of this wiki's effects. Didn't you say you had used grub-customizer and have things left over from that?
It would seem to be an inherent problem to Ubuntu/Linux having a combination of hard drives, usb sticks, etc. with many Ubuntus installed on them

I have a 500GB drive: about 300GB is used by windows 7, about 60 or 80GB for my main Precise install and approximately 20GB set aside for each of my other 4 Ubuntus.
I could even free up more from my windows partition if I wanted.

But, I don't use all 5 Ubuntus. I have them installed so I can try to keep up with the wiki.
So, why have so many installs? That is a rhetorical question but, you see my point.

bogan
February 21st, 2013, 10:34 AM
Hi!, Cavsfan,

You Posted:
So, why have so many installs? In order to answer forum queries with info relevant to the OP's actual situation, and in order to back-up and to transfer data from one computer to another, which are not on the same network, and without Internet or Cloud.

I agree that I am sure some of my problems resulted from Grub Customizer not being able to deal with the Grub2 Additional Options sub-menus. I have not tried the latest version of GC - too risky.

The one thing I really do not understand is that some of the corruption was from entries for OS's and partitions that have not existed for months, if not years.

If I had a choice, I would only have Grub on the main OS of the main HDD and the USB; but I do not have that choice as kernal updates reinstall and update the Grub in the OS being updated.

Chao!, bogan.

oldfred
February 21st, 2013, 03:00 PM
I always turn off os-prober and just use my own 40_custom. But I do not boot into my other installs often, and most of them I have set to install to sda, but my BIOS boots from sdc, so any reinstall to sda does not matter.

But someone posted that if you uncheck (with spacebar) all entries, grub will not reinstall to any MBR. I have not tried it.

#to get grub2 to remember where to reinstall on updates:
sudo dpkg-reconfigure grub-pc
#Enter thru first pages,spacebar to choose/unchoose drive, enter to accept, do not choose partitions


#To see what drive grub2 uses see this - grub-pc/install_devices:
sudo debconf-show grub-pc
sudo grub-probe -t device /boot/grub

bogan
February 21st, 2013, 05:36 PM
Hi!, oldfred,

You Posted:
But someone posted that if you uncheck (with spacebar) all entries, grub will not reinstall to any MBR. I have not tried it.Does that mean 'uncheck all entries' in sudo dpkg-reconfigure grub-pc?.

If so, would one not have to run 'sudo dpkg-reconfigure grub-pc' from every OS installed, except the one selected as Main?

Even then, I would have thought that an update to Grub, or a kernal update, would still upset things, as it does not give an option to choose where grub is to go.

Chao!, bogan.

oldfred
February 21st, 2013, 10:45 PM
It is every other install that you would have to run the dpkg command. You can check where grub will reinstall.

This is my laptop so it does not show much.


fred@A105-Precise:~$ sudo debconf-show grub-pc
[sudo] password for fred:
grub-pc/kopt_extracted: false
grub2/kfreebsd_cmdline:
grub2/device_map_regenerated:
* grub-pc/install_devices: /dev/disk/by-id/ata-FUJITSU_MHV2160BT_PL_NY07T6A28HNP
grub-pc/postrm_purge_boot_grub: false
grub-pc/install_devices_failed_upgrade: true
grub-pc/disk_description:
* grub2/linux_cmdline:
grub-pc/install_devices_empty: false
grub2/kfreebsd_cmdline_default: quiet
grub-pc/partition_description:
grub-pc/install_devices_failed: false
grub-pc/install_devices_disks_changed:
* grub2/linux_cmdline_default: quiet splash
grub-pc/chainload_from_menu.lst: true
grub-pc/hidden_timeout: false
grub-pc/mixed_legacy_and_grub2: true
grub-pc/timeout: 10

Cavsfan
February 21st, 2013, 11:51 PM
Hi!, Cavsfan,

You Posted:
So, why have so many installs? In order to answer forum queries with info relevant to the OP's actual situation, and in order to back-up and to transfer data from one computer to another, which are not on the same network, and without Internet or Cloud.

I agree that I am sure some of my problems resulted from Grub Customizer not being able to deal with the Grub2 Additional Options sub-menus. I have not tried the latest version of GC - too risky.

The one thing I really do not understand is that some of the corruption was from entries for OS's and partitions that have not existed for months, if not years.

If I had a choice, I would only have Grub on the main OS of the main HDD and the USB; but I do not have that choice as kernal updates reinstall and update the Grub in the OS being updated.

Chao!, bogan.

I understand Bogan, I was not trying to come off as being indifferent to your situation.
I hope you get it all sorted out.


I always turn off os-prober and just use my own 40_custom. But I do not boot into my other installs often, and most of them I have set to install to sda, but my BIOS boots from sdc, so any reinstall to sda does not matter.

But someone posted that if you uncheck (with spacebar) all entries, grub will not reinstall to any MBR. I have not tried it.

#to get grub2 to remember where to reinstall on updates:
sudo dpkg-reconfigure grub-pc
#Enter thru first pages,spacebar to choose/unchoose drive, enter to accept, do not choose partitions


#To see what drive grub2 uses see this - grub-pc/install_devices:
sudo debconf-show grub-pc
sudo grub-probe -t device /boot/grub

Thanks Oldfred for the commands. I don't want to attempt the first command.
The second didn't return anything I could understand but the third command returned where my grub is installed (sda7 Quantal) although I am on Raring: :D


cavsfan@cavsfan-MS-7529:~$ sudo debconf-show grub-pc
[sudo] password for cavsfan:
grub-pc/kopt_extracted: false
grub2/kfreebsd_cmdline:
grub2/device_map_regenerated:
* grub-pc/install_devices: /dev/disk/by-id/ata-Hitachi_HDP725050GLA360_GEA534RJ04DU5A
grub-pc/postrm_purge_boot_grub: false
grub-pc/install_devices_failed_upgrade: true
grub-pc/disk_description:
* grub2/linux_cmdline:
grub-pc/install_devices_empty: false
grub2/kfreebsd_cmdline_default: quiet
grub-pc/partition_description:
grub-pc/install_devices_failed: false
grub-pc/install_devices_disks_changed:
* grub2/linux_cmdline_default: quiet splash
grub-pc/chainload_from_menu.lst: true
grub-pc/hidden_timeout: true
grub-pc/mixed_legacy_and_grub2: true
grub-pc/timeout: 10
cavsfan@cavsfan-MS-7529:~$ sudo grub-probe -t device /boot/grub
/dev/sda7
cavsfan@cavsfan-MS-7529:~$

bogan
February 22nd, 2013, 12:07 AM
@oldfred, Thanks for that.

Hi!, Cavsfan,

You Posted:
But, what would you have if you made all of your 06_custom files unexecutable and 10_linux and 30_os-prober files executable?
I believe you said it would be a huge mess.I was not in anyway intending to imply that your Wicki was in anyway the cause of any of my 'huge mess'.

On the contrary it now fully serves the function for which I installed it: to give labels to the device launchers, and to identify the device entries in the Grub menu.

The problems I had with it - at first - were a function of my multible drives and the resulting changes in the Mount names the various OS's were given depending on which Boot drive was selected in Bios, and which Ports removable drives were plugged into. Once I had sorted that out and deactivated all but the Main OS 06_custom, it worked faultlessly.

The answer to your question is that with all the 06_custom files deactivated I get a fully useable menu with 12.10, but which has two disadvantages:
First: ubuntu entries apear as just: "Ubuntu" or Ubuntu 12.04.2 or 12.10", and it is necessary to open the Additional submenu to tell which is which, if more than one installation of the same version exists.

Second, some of the submenus have extra entries below the normal three, and some of them work, some do not, for reasons I do not understand; for example, one boots to the main 12.10 OS, but with a very low-res screen, too big for the display, which can not be scrolled to access things, and no GLX, so no launchers or panels.

But as those extra entries are redundant I can just ignore them, now that I have reduced the irritating 'huge mess' to a slight itch. Though the 12.04 menu is still only functional for the first Ubuntu, Memtest & Windows.

Thanks for putting up with my tortuous explanations.

Chao!, bogan.

Cavsfan
February 22nd, 2013, 05:16 PM
@oldfred, Thanks for that.

Hi!, Cavsfan,

You Posted: I was not in anyway intending to imply that your Wicki was in anyway the cause of any of my 'huge mess'.

On the contrary it now fully serves the function for which I installed it: to give labels to the device launchers, and to identify the device entries in the Grub menu.

The problems I had with it - at first - were a function of my multible drives and the resulting changes in the Mount names the various OS's were given depending on which Boot drive was selected in Bios, and which Ports removable drives were plugged into. Once I had sorted that out and deactivated all but the Main OS 06_custom, it worked faultlessly.

The answer to your question is that with all the 06_custom files deactivated I get a fully useable menu with 12.10, but which has two disadvantages:
First: ubuntu entries apear as just: "Ubuntu" or Ubuntu 12.04.2 or 12.10", and it is necessary to open the Additional submenu to tell which is which, if more than one installation of the same version exists.

Second, some of the submenus have extra entries below the normal three, and some of them work, some do not, for reasons I do not understand; for example, one boots to the main 12.10 OS, but with a very low-res screen, too big for the display, which can not be scrolled to access things, and no GLX, so no launchers or panels.

But as those extra entries are redundant I can just ignore them, now that I have reduced the irritating 'huge mess' to a slight itch. Though the 12.04 menu is still only functional for the first Ubuntu, Memtest & Windows.

Thanks for putting up with my tortuous explanations.

Chao!, bogan.

No problem Bogan! Take care and I hope you are able to manage all of your installations now,

Cavsfan
February 25th, 2013, 07:05 PM
The community wiki to create a custom Grub2 menu may be down part of the day on Feb 28th.
The same day the forum will be down part of the day. I need to make some minor changes, which should not take very long.
:popcorn:

Cavsfan
February 26th, 2013, 10:52 PM
I almost made a huge mistake the other day. I wanted to delete my 2nd Precise install.
So, I had Gparted up and was about to delete sda5. Then a stroke of luck occurred. ;) I realized I would be looking at grub rescue if I completed that operation.

At least I believe that is what would have happened.

My grub was installed on Quantal sda7 and the partitions would have all resequenced if I deleted sda5.

So I just formatted sda5 as ext4 instead preserving the partition sequence. :D

Then I just had to edit /etc/grub.d/06_custom and removed a couple of menuentries.
I also remembered to edit /etc/default/grub and subtracted the default line number by 2.

I am learning. :D

von Stalhein
February 27th, 2013, 08:36 AM
I almost made a huge mistake the other day. I wanted to delete my 2nd Precise install.

snip snip snip

I am learning. :D

Good!!!!

I am a huge fan of learning, and have done it many a time. In this case I'm more than happy for you to "learn" first and then tell us!!!
):P

Cavsfan
February 28th, 2013, 08:33 PM
I just edited the comunity wiki section 4 to refer to the grub version number vs. the Ubuntu version. I will clean it up a lot more replacing
Ubuntu version with Grub version in April when support for Oneiric Ocelot Ubuntu 11.10 and Lucid Lynx Ubuntu 10.04.4 LTS are dropped.
Then it will be just Grub version 1.99 which Precise Pangolin 12.04 LTS uses and Grub version 2.00 which everything after that uses.
There is only minor differences between Grub version 1.99 and Grub version 2.00.

Cavsfan
March 13th, 2013, 01:26 PM
With today's update of grub-pc in Raring, I accepted the installer's version (which one should always do to get the full benefit of the update) of /etc/default/grub and /etc/grub.d/05_debian_theme and then modified them again.
In 05_debian_theme the font colors moved from after line 108 to after line 114.

If you ever encounter an error while either the system is updating grub or you enter sudo update-grub you should make the 06_custom file unexecutable and then make 10_linux and 30_os-prober executable.
sudo chmod -x /etc/grub.d/06_custom
sudo chmod +x /etc/grub.d/10_linux
sudo chmod +x /etc/grub.d/30_os-prober

Always remember to enter sudo update-grub or the changes will not take effect. You do not want to re-boot with an error coming from grub. If you do you will probably be looking at grub recovery.
Then make the changes to the updated files.
Since Raring is still pre-release I will not update the community wiki until it is released in April.

ChinaJustin
March 14th, 2013, 09:07 AM
Hey, Cavsfan:

OK, so I'm using Mint 13 which has Grub 1.99.

I just updated the kernel, because this laptop I'm using has had some random hardware glitches, and I'm hoping that it was simply the older kernel version that comes with LM13.

But, just in case the newer kernel borked my system, I chmod -x'd the 10_linux file, installed the new kernel, then ran update-grub. Now, when Grub comes up, I have:

Linux Mint 13
Linux Mint 13 (recovery)
Windows 7
Linux Mint Maya (and then the new kernel version)
Linux Mint Maya (new kernel) (recovery)
Previous versions of Linux
(when you select the above, you get:)
Linux Mint Maya (previous kernel)
Linux Mint Maya (previous kernel) (recovery)

Now, the first two LM 13 entries are the new kernel, which is working fine so far. My questions are:

1) Is there any way to NOT have the second set of LM entries? I mean, my custom menu already gives me the newest kernel version, no need to have redundant entries for it. However, I do want to keep the entries for the previous kernels just in case.
2) How can I move the previous kernels so that they're all on the first/main menu (i.e. not have the "Previous versions of Linux" menu choice)?

Cavsfan
March 14th, 2013, 01:07 PM
Hey, Cavsfan:

OK, so I'm using Mint 13 which has Grub 1.99.

I just updated the kernel, because this laptop I'm using has had some random hardware glitches, and I'm hoping that it was simply the older kernel version that comes with LM13.

But, just in case the newer kernel borked my system, I chmod -x'd the 10_linux file, installed the new kernel, then ran update-grub. Now, when Grub comes up, I have:

Linux Mint 13
Linux Mint 13 (recovery)
Windows 7
Linux Mint Maya (and then the new kernel version)
Linux Mint Maya (new kernel) (recovery)
Previous versions of Linux
(when you select the above, you get:)
Linux Mint Maya (previous kernel)
Linux Mint Maya (previous kernel) (recovery)

Now, the first two LM 13 entries are the new kernel, which is working fine so far. My questions are:

1) Is there any way to NOT have the second set of LM entries? I mean, my custom menu already gives me the newest kernel version, no need to have redundant entries for it. However, I do want to keep the entries for the previous kernels just in case.
2) How can I move the previous kernels so that they're all on the first/main menu (i.e. not have the "Previous versions of Linux" menu choice)?

Enter in terminal cd /etc/grub.d/ and then enter ls -l and you should see what is executable.
I'm pretty sure the other entries are coming from /etc/grub.d/30_os-prober - chmod -x that file too. gksu chmod -x /etc/grub.d/30_os-prober
As the 06_custom file contains only what you put in it and displays only what you put between the quote marks. Also it can only contain the most recent kernel and it's recovery.
If you only have the 06_custom file executable, you will never see "Previous versions of Linux", etc.

ChinaJustin
March 14th, 2013, 02:23 PM
Yeah, my bad. I meant 30_os-prober. Fingers got ahead of my brain!

But see, I want the entries showing my previous kernels, just not the current one (since again, that's in my customized menu already). Is there any way to do that?

And I want ALL entries showing on the FIRST menu. Or are previous versions ALWAYS on a separate menu, while all other installs are on the main menu?

For example, here's what I want:

Linux Mint 13 (which is the current kernel obviously from my 06_custom file)
Linux Mint 13 (recovery)
Windows 7
Linux Mint 13 (previous kernel, not kernel from the above)
Linux Mint 13 (same, but with "recovery")
and then however many more kernels I may install

And that's it ... no "Previous Linux Versions" or anything. Your example of all your installs shows no "Previous Versions" selection. I'm assuming that that is because they are separate installs, NOT different kernels? And that if you had other kernels listed, they, too, would show up on some "Previous Versions" selection?

Cavsfan
March 14th, 2013, 03:51 PM
Yeah, my bad. I meant 30_os-prober. Fingers got ahead of my brain!

But see, I want the entries showing my previous kernels, just not the current one (since again, that's in my customized menu already). Is there any way to do that?

And I want ALL entries showing on the FIRST menu. Or are previous versions ALWAYS on a separate menu, while all other installs are on the main menu?

For example, here's what I want:

Linux Mint 13 (which is the current kernel obviously from my 06_custom file)
Linux Mint 13 (recovery)
Windows 7
Linux Mint 13 (previous kernel, not kernel from the above)
Linux Mint 13 (same, but with "recovery")
and then however many more kernels I may install

And that's it ... no "Previous Linux Versions" or anything. Your example of all your installs shows no "Previous Versions" selection. I'm assuming that that is because they are separate installs, NOT different kernels? And that if you had other kernels listed, they, too, would show up on some "Previous Versions" selection?

Actually, there is no way to display previous kernels and have them selectable. I have never needed to get to an older kernel although I have always kept the 2 newest kernels.
If I did I would temporarily make 10_linux or in your case 30_os-prober executable. Then when finished I would make them unexecutable.
The whole point of the "Custom Grub2 Menu" was to display the most recently installed kernel for each Ubuntu or Linux OS and recovery for that kernel plus a WIndows entry if you have one.

If you want the other kernels to display you will have to leave 30_os-prober in the mix. There is no other way around it.

ChinaJustin
March 14th, 2013, 05:21 PM
Fair enough. And I'm guessing the selectable "second" menu of "Previous Linux Versions" (wherein all additional kernels are shown) is set, too? No way to get it all onto just one page of the menu?

Cavsfan
March 14th, 2013, 05:50 PM
Fair enough. And I'm guessing the selectable "second" menu of "Previous Linux Versions" (wherein all additional kernels are shown) is set, too? No way to get it all onto just one page of the menu?

There is no way that I see to get previous kernels as in the submenus to display in this custom menu. How many times do you need to boot into older kernels anyway? I can't recall once myself.

oldfred
March 14th, 2013, 10:30 PM
In root there is the link to the current kernel, but there is also a like to the most previous kernel.

Link in / :
initrd.img.old
Viewing properties of link with my system I see this:
/boot/initrd.img-3.2.0-37-generic

But I have never need that link, as I would not normally want to boot older kernel.

Moose
March 15th, 2013, 04:39 AM
Instead of going through all of this tedious crap, why don't you just install Super Boot Manager and use it to install Burg? It has a themes repository with some pretty decent themes, all easily editable.

oldfred
March 15th, 2013, 03:39 PM
I do not believe burg is maintained. Last update was Oct 2010.

Cavsfan
March 15th, 2013, 05:12 PM
But I have never needed that link, as I would not normally want to boot older kernel.

My point exactly Oldfred! I have never needed or wanted to boot into an older kernel.


Instead of going through all of this tedious crap, why don't you just install Super Boot Manager and use it to install Burg? It has a themes repository with some pretty decent themes, all easily editable.

If you think this is tedious, it is not for you. BTW, no one is forcing you to use this method. I simply wanted a way to have the default line be static; not dynamic. Which is precisely what this method does.


I do not believe burg is maintained. Last update was Oct 2010.

As Oldfred mentions burg is not maintained. Maybe use Grub Customizer. See how that works out for you.

deadflowr
March 15th, 2013, 05:23 PM
Yep, this thread is about customizing the grub2 boot menu.
If you want to trick out your theme, look here:

http://ubuntuforums.org/showthread.php?t=1823915&highlight=grub+themes

Cavsfan
March 15th, 2013, 08:28 PM
Yep, this thread is about customizing the grub2 boot menu.
If you want to trick out your theme, look here:

http://ubuntuforums.org/showthread.php?t=1823915&highlight=grub+themes

That is good. Drs305 is a friend of mine. Not sure who will maintain that thread though as he is now retired.

This method customizes the Grub2 selections, changes the font, font size, font colors and adds a background pitcture.
Here is my most recent Grub picture for Precise Pangolin 12.04 LTS. I had the same one on all my installs but, that was confusing so I did this.

http://ompldr.org/taHJwaQ (http://ompldr.org/vaHJwaQ/Precise-grub-small.JPG)

The beauty is that no matter what kernels get installed on any of the 4 Ubuntus, the default line will never ever change.
This method may appear to be daunting but, it comes down to what is in one file /etc/grub.d/06_custom and a couple of other minor changes that need to be made.

deadflowr
March 15th, 2013, 09:10 PM
That is good. Drs305 is a friend of mine. Not sure who will maintain that thread though as he is now retired.

This method customizes the Grub2 selections, changes the font, font size, font colors and adds a background pitcture.
Here is my most recent Grub picture for Precise Pangolin 12.04 LTS. I had the same one on all my installs but, that was confusing so I did this.

http://ompldr.org/taHJwaQ (http://ompldr.org/vaHJwaQ/Precise-grub-small.JPG)

The beauty is that no matter what kernels get installed on any of the 4 Ubuntus, the default line will never ever change.
This method may appear to be daunting but, it comes down to what is in one file /etc/grub.d/06_custom and a couple of other minor changes that need to be made.

I think grubthemeartist has done a good job of keeping up with newer themes on that thread.
I agree the custom menu setup is a great thing.
I have a precise, and kubuntu precise, a quantal, and a raring (plus a windows xp) on my system, and without utilizing the custom file, finding the right distro took some special attention to kernel versions.
Now all distros are well defined, and I click far less to boot.
And simplfied booting is what it's supposed to be about.
Themes and fonts and backgrounds, though nice, aren't nearly as important to me as getting into the OS want I quickly.

Cavsfan
March 15th, 2013, 09:25 PM
I agree the custom menu setup is a great thing.
I have a precise, and kubuntu precise, a quantal, and a raring (plus a windows xp) on my system, and without utilizing the custom file, finding the right distro took some special attention to kernel versions.
Now all distros are well defined, and I click far less to boot.
And simplfied booting is what it's supposed to be about.
Themes and fonts and backgrounds, though nice, aren't nearly as important to me as getting into the OS want I quickly.

This method does exactly that: allows you to get to the OS of your choice quickly.

How much easier is hitting enter or moving the cursor up or down with the arrow keys to get to the OS of your choice?
This thread is about How to have a custom Grub2 menu that is maintenance free.

If your not going to post questions, etc. pertaining to this thread I suggest you create your own thread.

deadflowr
March 15th, 2013, 09:58 PM
This thread is about How to have a custom Grub2 menu that is maintenance free.

Got it.
Here's a question.
Last night, I decided to see about adding a menuentry for the .old file in the root directory, as oldfred mentioned.
It works fine, but I get the same message when hitting enter as I do booting into windows.

You know, that whole something something, press enter to continue thing.

menuentry "Good Kernel" { set root=(hd0,1)
linux /vmlinuz.old root=/dev/sda1 ro quiet splash
initrd /boot/initrd.img.old
}

Do you think I'd have to do anything to the entry to avoid that?

oldfred
March 15th, 2013, 11:54 PM
I get that error also on several of my newer installs. It slows boot but other than that I have not determined what the issue is. I thought for a while is was search for UUID line, but you so not have search in your entry, just a device setting.

Cavsfan
March 16th, 2013, 07:29 PM
Got it.
Here's a question.
Last night, I decided to see about adding a menuentry for the .old file in the root directory, as oldfred mentioned.
It works fine, but I get the same message when hitting enter as I do booting into windows.

You know, that whole something something, press enter to continue thing.

menuentry "Good Kernel" { set root=(hd0,1)
linux /vmlinuz.old root=/dev/sda1 ro quiet splash
initrd /boot/initrd.img.old
}

Do you think I'd have to do anything to the entry to avoid that?


I get that error also on several of my newer installs. It slows boot but other than that I have not determined what the issue is. I thought for a while is was search for UUID line, but you so not have search in your entry, just a device setting.

That erroneous error is mentioned in the wiki in Section 4.6 when selecting Windows:
https://help.ubuntu.com/community/MaintenanceFreeCustomGrub2Screen#Selecting_Windows _from_Grub_1.99

Is that the error you are talking about?

You can either wait or just press enter again and it goes ahead and does it.

I haven't seen it when selecting anything but Windows myself.
That is the only thing I don't like about Grub version 1.99. Grub 1.98 and 2.00 do not get that error.

oldfred
March 16th, 2013, 08:15 PM
That is the error I get on some of my boots, but it is not Windows.

I think it is my desktop boot from 12.04 to 12.10 both on my SSD. But I have to check and cannot do that until next week. (in Fla on laptop).

deadflowr
March 16th, 2013, 08:40 PM
Yep, grub 1.99.

grub 2.00 runs it as normal as the rest of the entries.

At this point it's more of an academic curiosity then a necessity.

Normally, I'd pull a Joe Dirt and say, "Why does it do that? well cuz it just does."

But my interest in it was little above normal.

It's doubtful that I'll ever boot into it (knock on wood for the stable kernels), but maybe someone who needs/wants an older kernel can glean something from it.

Cavsfan
March 17th, 2013, 04:06 PM
That is the error I get on some of my boots, but it is not Windows.

I think it is my desktop boot from 12.04 to 12.10 both on my SSD. But I have to check and cannot do that until next week. (in Fla on laptop).

Only selecting Windows 7 gives me that error. Selecting the other Ubuntu versions never has.


Yep, grub 1.99.

grub 2.00 runs it as normal as the rest of the entries.

At this point it's more of an academic curiosity then a necessity.

Normally, I'd pull a Joe Dirt and say, "Why does it do that? well cuz it just does."

But my interest in it was little above normal.

It's doubtful that I'll ever boot into it (knock on wood for the stable kernels), but maybe someone who needs/wants an older kernel can glean something from it.

I guess it would be logical for initrd.img.old and vmlinuz.old to provide the ability to boot into the previously installed kernel and that is fine if anyone wants to incorporate that into their menu.
But, I will leave that out of my wiki. I have never had the need to boot into an older kernel and if I did I would boot into recovery and make the appropriate files 10_linux or 30_os-prober executable.

Cavsfan
March 17th, 2013, 11:14 PM
Thanks deadflowr for figuring this out.

ChinaJustin, this should work on Mint as well. I'm not going to try this myself, but deadflowr has and it worked.
Here would be the 06_custom file for Grub 1.99 with just Precise and Windows or Mint and Windows as the text just displays whatever you desire:


#!/bin/sh
echo 1>&2 "Adding Precise Pangolin 12.04 Newest Kernel, Precise Pangolin 12.04 Previous Kernel and Windows"
exec tail -n +4 $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 "Precise Pangolin 12.04 Newest Kernel" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro quiet splash
initrd /initrd.img
}
menuentry "Precise Pangolin 12.04 Newest Kernel (Recovery Mode)" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro single
initrd /initrd.img
}
menuentry "Precise Pangolin 12.04 Previous Kernel" {
set root=(hd0,2)
linux /vmlinuz.old root=/dev/sda2 ro quiet splash
initrd /initrd.img.old
}
menuentry "Precise Pangolin 12.04 Previous Kernel (Recovery Mode)" {
set root=(hd0,2)
linux /vmlinuz.old root=/dev/sda2 ro single
initrd /initrd.img.old
}
menuentry "Windows" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 1CFC7A8DFC7A60C6
chainloader +1
}

With the only difference being ".old" at the end. I am not going to add this to the wiki but, feel free to add it to your custom grub if you want to.
You can see here from the symlinks how it should technically work:


cavsfan@cavsfan-desktop:/$ ls -l | grep "initrd";ls -l | grep "vmlinuz"
drwxr-xr-x 2 root root 4096 Feb 7 10:57 initrd
lrwxrwxrwx 1 root root 33 Feb 19 15:35 initrd.img -> /boot/initrd.img-3.2.0-38-generic
lrwxrwxrwx 1 root root 33 Feb 14 15:52 initrd.img.old -> /boot/initrd.img-3.2.0-37-generic
lrwxrwxrwx 1 root root 29 Feb 19 15:35 vmlinuz -> boot/vmlinuz-3.2.0-38-generic
lrwxrwxrwx 1 root root 29 Feb 14 15:52 vmlinuz.old -> boot/vmlinuz-3.2.0-37-generic

Cavsfan
March 19th, 2013, 08:03 PM
The previous post from Precise which describes how to be able to boot into the previous kernel appears to only hold true for Precise, maybe Grub 1.99.
I have been in Lucid, Quantal and Raring and the boot files all pointed to the same most recently installed kernel.
In Raring this is what it shows:


cavsfan@cavsfan-MS-7529:~$ cd /
cavsfan@cavsfan-MS-7529:/$ ls -l | grep "initrd";ls -l | grep "vmlinuz"
lrwxrwxrwx 1 root root 32 Mar 19 14:29 initrd.img -> boot/initrd.img-3.5.0-26-generic
lrwxrwxrwx 1 root root 33 Mar 19 14:29 initrd.img.old -> /boot/initrd.img-3.5.0-26-generic
lrwxrwxrwx 1 root root 29 Mar 19 14:29 vmlinuz -> boot/vmlinuz-3.5.0-26-generic
lrwxrwxrwx 1 root root 29 Mar 19 14:29 vmlinuz.old -> boot/vmlinuz-3.5.0-26-generic


Even the vmlinuz.old file points to the 26 kernel. You can play around with this if you want, but I am not going to invest any more time dealing with older kernels.
This may be why "ro single" will work for recovery on Grub 1.98 and 1.99 but, recovery on Grub 2.00 requires "ro recovery nomodeset" on the recovery line. (Thanks to Bogan for finding this out.)
I have never needed to boot into an older kernel so I am going to let this die right here. :KS

xraynetcontrol
March 21st, 2013, 06:20 AM
awesome, thank you very much for this!

Cavsfan
March 21st, 2013, 03:08 PM
awesome, thank you very much for this!

You are welcome! :)

Cavsfan
March 23rd, 2013, 04:00 PM
I installed Linux Cinnamon 14 Nadia and incorporated it into the menu. It also uses Grub 2.00 and worked well with this guide.
I'll post a screenshot later. :)

Cavsfan
March 24th, 2013, 02:30 PM
The only real difference in Linux Mint Grub I found is that you have to make /etc/grub.d/06_mint_theme unexecutable in order to get the font colors from /etc/grub.d/05_debian_theme to work.
Or else you will have your font colors at the bottom but, the menu colors will be white.

Cavsfan
March 24th, 2013, 02:46 PM
There are times when you have to be able to see where things in Grub are coming from and you can do that by looking at the output of sudo grub-mkconfig but, sometimes the output is too long to show in terminal.
I entered sudo grub-mkconfig > mkconfig-output to produce an output that can then be opened with gedit to view. It saved to my home directory.

Cavsfan
March 24th, 2013, 06:22 PM
Here is my latest custom grub2 menu on Linux Mint Grub version 2.00:

http://ompldr.org/taHZieg (http://ompldr.org/vaHZieg/DSCN2584-s.JPG)

That is the same Grub version as Quantal Quetzal 12.10 has I believe.
I like the dark pictures with the cyan fonts. :)

Cavsfan
April 15th, 2013, 04:41 PM
One final custom Grub2 screen with Lucid Lynx before it's EOL on May 9th.
This time they are all in sequence even though they are not in sequence on the partitions. ;)

http://ompldr.org/taTN0bg (http://ompldr.org/vaTN0bg/DSCN2586small.JPG)



cavsfan@cavsfan-MS-7529:~$ sudo blkid
[sudo] password for cavsfan:
/dev/sda1: LABEL="C:" UUID="1CFC7A8DFC7A60C6" TYPE="ntfs"
/dev/sda2: LABEL="Precise" UUID="a162dc8a-e4df-4b79-b4c3-524761ff7ae1" TYPE="ext4"
/dev/sda3: UUID="2a80f59e-e7c3-418e-aab2-ab5d19255a2f" TYPE="swap"
/dev/sda5: LABEL="Linux Mint" UUID="b796e378-c9dd-4557-825b-5d5687197609" TYPE="ext4"
/dev/sda6: LABEL="Quantal" UUID="4d6a25ba-5a4b-4da4-8ae1-9939bc6b6b4c" TYPE="ext4"
/dev/sda7: LABEL="Raring" UUID="331d2bf4-1749-435a-a218-1c90dee537db" TYPE="ext4"
/dev/sda8: LABEL="Lucid" UUID="570f351d-6da3-4540-86b6-e12a400f7f44" TYPE="ext4"
/dev/sdb1: LABEL="Fantom" UUID="78B8D1A1B8D15DE6" TYPE="ntfs"

Cavsfan
April 25th, 2013, 03:08 PM
The wiki will be down for a few minutes to update it with Raring Ringtail 13.04 which was released today.

Finished. Just made a few changes in the Editing /etc/grub.d/05_debian_theme section.

Cavsfan
April 26th, 2013, 04:37 PM
After installing the final release of Raring Ringtail 13.04 yesterday I was perplexed in that I could not get a picture to work.
It would be listed in the output of sudo update-grub but neither the picture or the font colors would show up at boot time.

The font colors listed after line 114 in /etc/grub.d/05_debian_theme are dependent on the picture being found in /boot/grub/ and the picture was there.

I ended up this morning just using another picture that I had previously used. So, I do not know why some pictures work and others will not.

But, that is the case.

Cavsfan
May 10th, 2013, 03:25 PM
I will have to work on the wiki today to remove the parts about Grub 1.98 from Lucid Lynx which reached EOL yesterday May 9th 2013.

fantab
May 10th, 2013, 04:50 PM
I have found particularly pictures with extension .jpeg don't work, while .jpg and .png work. Atleast for me .jpeg doesn't work.

Thanks for the great WIKI...

Cavsfan
May 10th, 2013, 05:31 PM
I believe I have it updated correctly. There is just one reference to Lucid and that is an old example picture of a grub2 screen.
As for the recovery line sometimes ro single works and sometimes ro recovery nomodeset is what it takes.

Cavsfan
May 10th, 2013, 11:33 PM
Added Saucy to the mix. :D

http://ompldr.org/taWQ4bw (http://ompldr.org/vaWQ4bw/grub with saucy.jpg)

von Stalhein
May 14th, 2013, 10:47 AM
Added Saucy to the mix. :D

http://ompldr.org/taWQ4bw (http://ompldr.org/vaWQ4bw/grub with saucy.jpg)

Round here we call that "lairising (http://www.encyclo.co.uk/define/Lairising)", but keep at it, you're going OK :-)

Cavsfan
May 14th, 2013, 12:59 PM
Added Saucy to the mix. :D

http://ompldr.org/taWQ4bw (http://ompldr.org/vaWQ4bw/grub with saucy.jpg)


Round here we call that "lairising (http://www.encyclo.co.uk/define/Lairising)", but keep at it, you're going OK :-)

Ha! Good one! :D Just wanted to show it could be done even on Saucy. Saucy is just like Raring with the 05_debian-theme

Trust me the green colors look better here than it probably does in that picture. It has light-green as the highlight color and green as normal color to match the Matrix green backgound.

Cavsfan
May 20th, 2013, 08:01 PM
I have found particularly pictures with extension .jpeg don't work, while .jpg and .png work. Atleast for me .jpeg doesn't work.

Thanks for the great WIKI...

Sorry fantab! I didn't see your post until now. You are welcome! When I installed Raring after final release I worked for 2 hours on trying to get a .jpg picture to work.
It was the exact size of my screen, it showed up when I did sudo update-grub but, yet it would not appear at bootup. And the font colors are dependent on that picture
being found in 05_debian_theme or neither the picture or the font colors show.

I tried editing it with Gimp more than once. I eventually gave up and used a picture that I had used before and viola it worked like a charm!

Don't know why some pics do not work but, I have experienced the same thing you did and the code says all picture types will work:


# Step #3: Search the correct GRUB module for our background image.
local reader
case "${1}" in
*.jpg|*.JPG|*.jpeg|*.JPEG) reader="jpeg";;
*.png|*.PNG) reader="png";;
*.tga|*.TGA) reader="tga";;
*) return 3;; # Unknown image type.
esac

So, technically a .jpeg or a .JPEG picture should work. Not sure why they sometimes do not. I always use .jpg files myself.

On a side note, this appears to be a complicated "how to" when you first glance at it but, really all you need to know is whether your system is on sda3 or sda7, etc. and that is about it.
So, it is really simple once you have done it once or twice.

I have customized the Grub on all 5 of my Linux OSs and occaisionally switch between Ubuntus with this: sudo grub-install /dev/sda on the one I want to show. ;)

fantab
May 21st, 2013, 05:34 AM
Sometimes the images that are not working, work if I change the 'color depth' to something like 8 Bit and changing color mode to 'RGBA' for .jpg and .jpeg. But sometimes even that doesn't help. On Fedora, I was having a similar problem when using a custom Lightdm background and I couldn't get the image I wanted; then got some pointer that I should change the layer transparency by adding 'Alpha Channel'. And it worked. I tried to do the same with images that won't work with GRUB... It didn't work.

So I guess, that its some internal property of the image itself that causes the issue.

My two cents...

Cavsfan
May 21st, 2013, 01:12 PM
So I guess, that its some internal property of the image itself that causes the issue.

I agree! Some pictures will work while others won't no matter what you do to them. Sort of perplexing but, once I found another picture
that did work I lost interest in determining why the other would not work. :)

Cavsfan
May 21st, 2013, 04:51 PM
It appears omploader is down and has been for the past few days. If they don't come back soon, I'll put the pictures on another hosting site.

The possible font colors picture I will put on the other site first.

Cavsfan
May 22nd, 2013, 05:10 PM
Since omploader doesn't appear to be coming back I have to replace 4 pictures on this so it may be down for a bit.

Cavsfan
May 22nd, 2013, 09:28 PM
I am finished with updating the pictures. I put them on the Community Wiki site so they won't disappear again.

Sorry if I inconvenienced anyone. :)

fantab
May 23rd, 2013, 12:39 PM
I have a question related to Grub2 but not related to Ubuntu, specifically.

I dual boot Ubuntu and Arch. I don't install Grub in Arch and let Ubuntu-Grub load it. Yesterday, however I was forced to install Arch-Grub because I had to append some kernel parameters and I couldn't do so without /etc/default/grub. Anyways.

I have been trying to customize Grub Menu, nothing much, just background picture and font colors. Arch-Grub does NOT use /etc/grub.d/05_debian_theme, we have to edit /etc/default/grub for all the changes. So far so good. However, when I change font colors only the box and the text within it is affected and not the text outside the box. By outside text I mean the one on top-center which reads Grub version and below which gives instructions on how to use the menu.

I am sure there is another entry somewhere which specifies font-color for the text outside the box. I can't seem to find it. I have looked in /boot/grub, /etc/default/grub and /etc/grub.d/ but I am yet to find it. Since there is no 05_debian_theme I am having a tough time figuring it out. I'd be grateful if I can be pointed in a right direction.

Cavsfan
May 23rd, 2013, 01:54 PM
I have a question related to Grub2 but not related to Ubuntu, specifically.

I dual boot Ubuntu and Arch. I don't install Grub in Arch and let Ubuntu-Grub load it. Yesterday, however I was forced to install Arch-Grub because I had to append some kernel parameters and I couldn't do so without /etc/default/grub. Anyways.

I have been trying to customize Grub Menu, nothing much, just background picture and font colors. Arch-Grub does NOT use /etc/grub.d/05_debian_theme, we have to edit /etc/default/grub for all the changes. So far so good. However, when I change font colors only the box and the text within it is affected and not the text outside the box. By outside text I mean the one on top-center which reads Grub version and below which gives instructions on how to use the menu.

I am sure there is another entry somewhere which specifies font-color for the text outside the box. I can't seem to find it. I have looked in /boot/grub, /etc/default/grub and /etc/grub.d/ but I am yet to find it. Since there is no 05_debian_theme I am having a tough time figuring it out. I'd be grateful if I can be pointed in a right direction.

I have no idea how to change the fonts in Arch Linix but, this link looks promising:

https://wiki.archlinux.org/index.php/GRUB#Background_image_and_bitmap_fonts

See the part about Menu colors on that page. It looks like the font colors go in /etc/default/grub and are then generated with this command: grub-mkconfig -o /boot/grub/grub.cfg
However I can not test that but, it looks like it should work.

If you wanted to move control of grub back to Ubuntu all you would need to do is login to Ubuntu and enter sudo grub-install /dev/sda (sda is whatever hard drive your Ubuntu partition is installed on).

fantab
May 23rd, 2013, 02:58 PM
Thanks Cavsfan. But I know all that. The problem is after I have changed the font color in /etc/default/grub, like I said, only the box outline and the menu inside changes but NOT the text outside the box. And also the sub-menus remain unchanged. I have even tried to create and add 05_Arch_theme based on 05_Debian_theme, but it does not help either. Wonder what patches Ubuntu/Debian apply to Grub. I will keep trying until eventually I re-install Ubuntu-Grub. This is the first time I have used Grub from any other Distro.

Thanks again...

Cavsfan
May 23rd, 2013, 03:35 PM
Thanks Cavsfan. But I know all that. The problem is after I have changed the font color in /etc/default/grub, like I said, only the box outline and the menu inside changes but NOT the text outside the box. And also the sub-menus remain unchanged. I have even tried to create and add 05_Arch_theme based on 05_Debian_theme, but it does not help either. Wonder what patches Ubuntu/Debian apply to Grub. I will keep trying until eventually I re-install Ubuntu-Grub. This is the first time I have used Grub from any other Distro.

Thanks again...

You are welcome!

It was sort of a shot in the dark but, it looked good from here. :)

Good luck!

fantab
May 23rd, 2013, 06:09 PM
Well it turns out that the solution was as simple as creating a new file /etc/grub.d/01_theme with the following script:


#!/bin/sh
cat << EOF
set color_normal=dark-gray/black
set color_highlight=cyan/black
EOF

... and making it executable.

It has given me some ideas about Ubuntu too... :wink:

Regards...

Cavsfan
May 23rd, 2013, 06:56 PM
Well it turns out that the solution was as simple as creating a new file /etc/grub.d/01_theme with the following script:


#!/bin/sh
cat << EOF
set color_normal=dark-gray/black
set color_highlight=cyan/black
EOF

... and making it executable.

It has given me some ideas about Ubuntu too... :wink:

Regards...

Sweet! :guitar: I am glad you found a solution. I know absolutely nothing about Arch although I have a spare partition. :)
But, I have enough trouble keeping up with the 6 operating systems I already have as it is!
I prefer Precise 12.04 LTS and keep the others mainly for Grub updates for this wiki.
I have Mint 14 installed but, it is either based on Quantal Quetzal 12.10 or vice versa. Even many of the sources have "Quantal" in the name.

Cavsfan
May 23rd, 2013, 09:36 PM
A light picture with blue normal and black highlight font colors.

242949



echo " set color_normal=blue/black"
echo " set color_highlight=black/black"

Cavsfan
May 29th, 2013, 04:34 PM
I couldn't take that light theme for very long. I just basically wanted to prove to myself that with a background picture you could use black/black as either the normal or highlight font.
I prefer darker pictures/fonts.
Here is my current Grub2 screen on Raring:

243241

Bashing-om
May 29th, 2013, 09:45 PM
Hey people;

I am unable to effect any change to the grub boot menu. No changes made in /etc/default/grub or to any of the scripts in /etc/grub.d are reflected in the boot menu.
After going around and around with this for a week, I am at my wit's end and looking for advise.
I am triple booting -> raring, ubuntu 12.04 and lubuntu 12.04;
raring is a MINIMAL install with xfce4 for the desktop environment fairly fresh install and this is my initial boot menu item that goaded me to attempt to change the boot menu: Choosing to use Cavsfab's excellent wiki guide:

ubuntu' --class ubuntu --class gnu-linux --class gnu --class
ubuntu, with linux 3.8.0-21-generic os 'gnulin->
--class ubuntu --class gnu-linux -->
Initially I was not able to update the kernel, however I now have kernel 3.8.0-22-generic installed:

sysop@1304mini:~$ uname -r
3.8.0-22-generic
sysop@1304mini:~$

After following the guide; here is my results and system set up:
my /boot/grub/grub.cfg ->


#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#


### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="${saved_entry}"


if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi


export menuentry_id_option


if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi


function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}


function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}


function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}


insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
else
search --no-floppy --fs-uuid --set=root 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
fi
if loadfont /boot/grub/DejaVuSansMono.pf2 ; then
set gfxmode=1600x900
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
else
search --no-floppy --fs-uuid --set=root 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
fi
insmod tga
background_image -m stretch /usr/share/images/grub/050817-N-3488C-028.tga
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###


### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
else
search --no-floppy --fs-uuid --set=root 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
fi
insmod tga
if background_image /usr/share/images/grub/050817-N-3488C-028.tga; then
set color_normal=cyan/black
set color_highlight=light-cyan/black
true
else
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
fi
### END /etc/grub.d/05_debian_theme ###


### BEGIN /etc/grub.d/06_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.
menuentry "RaRing 13.04" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro quiet splash
initrd /initrd.img
}
menuentry " RaRing 13.04 (Recovery Mode)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro recovery nomodeset
initrd /initrd.img
}
menuentry "LUBU12.04" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro quiet splash
initrd /initrd.img
}
menuentry " LUBU12.04 (Recovery Mode)" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro single
initrd /initrd.img
}
menuentry "ubie12.04" {
set root=(hd2,1)
linux /vmlinuz root=/dev/sdc1 ro quiet splash
initrd /initrd.img
}
menuentry " ubie12.04 (Recovery Mode)" {
set root=(hd2,1)
linux /vmlinuz root=/dev/sdc1 ro single
initrd /initrd.img
}


### END /etc/grub.d/06_custom ###


### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-3a47f1f1-ed1f-4134-b6aa-be101a7d97b4' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
else
search --no-floppy --fs-uuid --set=root 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
fi
linux /boot/vmlinuz-3.8.0-22-generic root=UUID=3a47f1f1-ed1f-4134-b6aa-be101a7d97b4 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.8.0-22-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-3a47f1f1-ed1f-4134-b6aa-be101a7d97b4' {
menuentry 'Ubuntu, with Linux 3.8.0-22-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-22-generic-advanced-3a47f1f1-ed1f-4134-b6aa-be101a7d97b4' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
else
search --no-floppy --fs-uuid --set=root 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
fi
echo 'Loading Linux 3.8.0-22-generic ...'
linux /boot/vmlinuz-3.8.0-22-generic root=UUID=3a47f1f1-ed1f-4134-b6aa-be101a7d97b4 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.8.0-22-generic
}
menuentry 'Ubuntu, with Linux 3.8.0-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-22-generic-recovery-3a47f1f1-ed1f-4134-b6aa-be101a7d97b4' {
recordfail
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
else
search --no-floppy --fs-uuid --set=root 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
fi
echo 'Loading Linux 3.8.0-22-generic ...'
linux /boot/vmlinuz-3.8.0-22-generic root=UUID=3a47f1f1-ed1f-4134-b6aa-be101a7d97b4 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.8.0-22-generic
}
menuentry 'Ubuntu, with Linux 3.8.0-21-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-21-generic-advanced-3a47f1f1-ed1f-4134-b6aa-be101a7d97b4' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
else
search --no-floppy --fs-uuid --set=root 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
fi
echo 'Loading Linux 3.8.0-21-generic ...'
linux /boot/vmlinuz-3.8.0-21-generic root=UUID=3a47f1f1-ed1f-4134-b6aa-be101a7d97b4 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.8.0-21-generic
}
menuentry 'Ubuntu, with Linux 3.8.0-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-21-generic-recovery-3a47f1f1-ed1f-4134-b6aa-be101a7d97b4' {
recordfail
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
else
search --no-floppy --fs-uuid --set=root 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
fi
echo 'Loading Linux 3.8.0-21-generic ...'
linux /boot/vmlinuz-3.8.0-21-generic root=UUID=3a47f1f1-ed1f-4134-b6aa-be101a7d97b4 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.8.0-21-generic
}
}


### END /etc/grub.d/10_linux ###


### BEGIN /etc/grub.d/20_linux_xen ###


### END /etc/grub.d/20_linux_xen ###


### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Ubuntu 12.04.2 LTS (12.04)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /vmlinuz root=/dev/sda7
initrd /initrd.img
}
submenu 'Advanced options for Ubuntu 12.04.2 LTS (12.04)' $menuentry_id_option 'osprober-gnulinux-advanced-4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /vmlinuz root=/dev/sda7
initrd /initrd.img
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /vmlinuz root=/dev/sda7
initrd /initrd.img
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /vmlinuz root=/dev/sda7
initrd /initrd.img.old
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-41-generic--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /boot/vmlinuz-3.2.0-41-generic root=/dev/sda7
initrd /boot/initrd.img-3.2.0-41-generic
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-43-generic--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /boot/vmlinuz-3.2.0-43-generic root=/dev/sda7
initrd /boot/initrd.img-3.2.0-43-generic
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-44-generic--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /boot/vmlinuz-3.2.0-44-generic root=/dev/sda7
initrd /boot/initrd.img-3.2.0-44-generic
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /vmlinuz root=/dev/sda7
initrd /initrd.img
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /vmlinuz root=/dev/sda7
initrd /initrd.img
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /vmlinuz root=/dev/sda7
initrd /initrd.img.old
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz.old--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /vmlinuz.old root=/dev/sda7
initrd /initrd.img.old
}
}


menuentry 'Ubuntu 12.04.2 LTS (12.04)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-5bae8c40-b15d-42f8-9fc9-0cf087f338d4' {
insmod part_msdos
insmod ext2
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
else
search --no-floppy --fs-uuid --set=root 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
fi
linux /boot/vmlinuz-3.2.0-44-generic root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro
initrd /boot/initrd.img-3.2.0-44-generic
}
submenu 'Advanced options for Ubuntu 12.04.2 LTS (12.04)' $menuentry_id_option 'osprober-gnulinux-advanced-5bae8c40-b15d-42f8-9fc9-0cf087f338d4' {
menuentry 'Ubuntu, with Linux 3.2.0-44-generic (on /dev/sdc1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-44-generic--5bae8c40-b15d-42f8-9fc9-0cf087f338d4' {
insmod part_msdos
insmod ext2
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
else
search --no-floppy --fs-uuid --set=root 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
fi
linux /boot/vmlinuz-3.2.0-44-generic root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro
initrd /boot/initrd.img-3.2.0-44-generic
}
menuentry 'Ubuntu, with Linux 3.2.0-44-generic (recovery mode) (on /dev/sdc1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-44-generic-root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro recovery nomodeset-5bae8c40-b15d-42f8-9fc9-0cf087f338d4' {
insmod part_msdos
insmod ext2
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
else
search --no-floppy --fs-uuid --set=root 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
fi
linux /boot/vmlinuz-3.2.0-44-generic root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro recovery nomodeset
initrd /boot/initrd.img-3.2.0-44-generic
}
menuentry 'Ubuntu, with Linux 3.2.0-43-generic (on /dev/sdc1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-43-generic--5bae8c40-b15d-42f8-9fc9-0cf087f338d4' {
insmod part_msdos
insmod ext2
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
else
search --no-floppy --fs-uuid --set=root 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
fi
linux /boot/vmlinuz-3.2.0-43-generic root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro
initrd /boot/initrd.img-3.2.0-43-generic
}
menuentry 'Ubuntu, with Linux 3.2.0-43-generic (recovery mode) (on /dev/sdc1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-43-generic-root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro recovery nomodeset-5bae8c40-b15d-42f8-9fc9-0cf087f338d4' {
insmod part_msdos
insmod ext2
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
else
search --no-floppy --fs-uuid --set=root 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
fi
linux /boot/vmlinuz-3.2.0-43-generic root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro recovery nomodeset
initrd /boot/initrd.img-3.2.0-43-generic
}
menuentry 'Ubuntu, with Linux 3.2.0-41-generic (on /dev/sdc1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-41-generic--5bae8c40-b15d-42f8-9fc9-0cf087f338d4' {
insmod part_msdos
insmod ext2
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
else
search --no-floppy --fs-uuid --set=root 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
fi
linux /boot/vmlinuz-3.2.0-41-generic root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro
initrd /boot/initrd.img-3.2.0-41-generic
}
menuentry 'Ubuntu, with Linux 3.2.0-41-generic (recovery mode) (on /dev/sdc1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-41-generic-root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro recovery nomodeset-5bae8c40-b15d-42f8-9fc9-0cf087f338d4' {
insmod part_msdos
insmod ext2
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
else
search --no-floppy --fs-uuid --set=root 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
fi
linux /boot/vmlinuz-3.2.0-41-generic root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro recovery nomodeset
initrd /boot/initrd.img-3.2.0-41-generic
}
}


### END /etc/grub.d/30_os-prober ###


### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###


### 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 ###


### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
my /etc/default/grub

# If you change this file, run 'update-grub' afterwards to update# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'


GRUB_DEFAULT=saved
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#28may13-quiet splash removed from following line: 29may13 - ZFR.
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
#28may13 font changed to the following
GRUB_FONT=/boot/grub/DejaVuSansMono.pf2
#28may13=image backgrounding added
GRUB_BACKGROUND=/usr/share/images/grub/050817-N-3488C-028.tga
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"


# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console


# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#28may13-GFXMODE enabled (uncommented) and resolution changed from 640x480
GRUB_GFXMODE=1600x900


# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true


# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"


# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

My system set up from "blkid" :


/dev/sda1: LABEL="1304mroot" UUID="3a47f1f1-ed1f-4134-b6aa-be101a7d97b4" TYPE="ext4"
/dev/sda2: LABEL="1304mhome" UUID="29a6fc4f-ff12-4cac-8eb1-e98e50f1107f" TYPE="ext4"
/dev/sda5: UUID="192a4783-56fa-4fd0-a62f-c45a14c08482" TYPE="swap"
/dev/sda6: LABEL="DATA" UUID="3ad091a1-5036-463b-ba4e-88e98e41b07a" TYPE="ext4"
/dev/sda7: LABEL="LUBU1204" UUID="4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d" TYPE="ext4"
/dev/sda8: LABEL="1304mvar" UUID="136af805-5758-4880-acc4-0e1d35e2c266" TYPE="ext4"
/dev/sdb1: LABEL="my_stuff" UUID="6a24777c-8191-4230-81f1-376f31b321e5" TYPE="ext4"
/dev/sdc1: LABEL="ubie1204" UUID="5bae8c40-b15d-42f8-9fc9-0cf087f338d4" TYPE="ext4"


The prerequisite image file exist and is installed to /usr/share/images/grub/ ;
I have removed grub from the lubuntu install on sda7 --- grub remains installed on ubuntu 12.04 sdc1;
Resolution mode 1600x900 verified by grub's "vbeinfo";
Numerous times rewritten the grub.cfg file ("sudo update-grub');

Hours and hours spent trolling sites to understand why/what is failing, been over and over the scrips and guidance, perceiving no errors, making some change - update grub - reboot.... no change at all to grub's boot menu.

For sure /boot/grub/grub/cfg is executing, else would not have a boot menu at all (???) as /boot/grub/grub.cfg supposedly executes upon boot-up !
-------
Request advise on what I am not seeing and/or overlooking ! ;
What can I do to see the execution process of /boot/grub/grub.cfg, How can I verify that the variables in the script are "set" ?

Why can I not effect a change in the boot grub menu ??

help and guidance is muchly appreciated

bogan
May 30th, 2013, 05:21 PM
Hi!, Bashing_om,

Without going through your boot/grub/grub.cfg file in detail, it looks to me that your are editing the files in one installation, say Raring, whilst the grub menu and boot sequence are controlled by grub in another installation, probably 12.04 on another drive. Edit: The last command in this Post will tell you what is actually the current state.

If that is the case, what you need to do is to boot the drive and installation you want to be in control and run:
sudo grub-install /dev/sdx # where 'sdx' is the drive in operation, not the partition
sudo update-grub
sudo reboot:To confirm the installation had no error:
sudo grub-install --recheck /dev/sdx

You may also need to run
sudo grub-install --root-directory=/mnt /dev/sdx # or:
sudo grub-install grub-pc # space-bar to select drive, tab to OK, enter to accept
sudo debconf-show grub-pc # will show you full details.Chao!, bogan.

Bashing-om
May 30th, 2013, 06:53 PM
@ bogan, Hi !

Appreciate the input. and the assist even more.... But, I am aware of and have done so MANY times... 'Nother grub as primary had occurred to me and I removed grub from my Lubuntu install in sda7, Since my last go-around with sda1 [raring](what I want as primary) after running the grub install routine for sda, I have not gone back and did any thing on the sda7 (lubuntu) or sdc1 (ubuntu) installations.
bk
After going round and a-round with - not able to effect a change to the booting grub menu - I am frustrated and continue to be mystified ! My thinking process has become cloudy and missfocused. So, I appreciate a fresh perspective on this one !

What I am currently considering is:
Backup the present /boot/grub/grub.cfg file;
Make a "custom" menu entry in that grub/cfg file (prepared to have to get back in the system via other means), reboot to see if THAT has an effect.
And/or -- not knowing if the capability yet exists this early in the boot process -- see if I can put an echo statement to redirect output to a file (nice if I can figure out how to get the variable contents to this file).

I am going to run through the process again, and will advise.


again, thanks

Bashing-om
May 30th, 2013, 07:32 PM
@ bogan ... Wow
The "grub-install grub-pc" returned an error ! The only error I have encountered to this time !

sysop@1304mini:~$ sudo grub-install /dev/sdaInstallation finished. No error reported.
sysop@1304mini:~$ sudo grub-install grub-pc
[sudo] password for sysop:
/usr/sbin/grub-probe: error: cannot find a GRUB drive for grub-pc. Check your device.map.
sysop@1304mini:~$

For some past reason I have a copy of "device.map"... maybe I have erroneously removed it. (???)

Hey Back to checking on what is happening with the "device.map"

Next:

sysop@1304mini:~$ sudo update-grub
Generating grub.cfg ...
Found background: /usr/share/images/grub/050817-N-3488C-028.tga
Found background image: /usr/share/images/grub/050817-N-3488C-028.tga
What do you want to boot up, Billy
Found linux image: /boot/vmlinuz-3.8.0-22-generic
Found initrd image: /boot/initrd.img-3.8.0-22-generic
Found linux image: /boot/vmlinuz-3.8.0-21-generic
Found initrd image: /boot/initrd.img-3.8.0-21-generic
Found Ubuntu 12.04.2 LTS (12.04) on /dev/sda7
Found Ubuntu 12.04.2 LTS (12.04) on /dev/sdc1
done
sysop@1304mini:~$ sudo grub-install grub-pc
/usr/sbin/grub-probe: error: cannot find a GRUB drive for grub-pc. Check your device.map.

I'll be back

Bashing-om
May 30th, 2013, 09:07 PM
et all ; My current sloppyation:
Remove, purge and (re-)install of grub ->
Get to "configuring grub-pc" screen and select "ok" ->
"configuring grub-pc" application -> no choice is accepted: as below

│ │ You chose not to install GRUB to any devices. If you continue, the boot │
│ loader may not be properly configured, and when this computer next starts │
│ up it will use whatever was previously in the boot sector. If there is an │
│ earlier version of GRUB 2 in the boot sector, it may be unable to load │
│ modules or handle the current configuration file. │
│ │
│ If you are already using a different boot loader and want to carry on │
│ doing so, or if this is a special environment where you do not need a boot │
│ loader, then you should continue anyway. Otherwise, you should install │
│ GRUB somewhere. │
│ │
│ Continue without installing GRUB? │
│ │
│ <Yes> <No> │
│ │
└───────────────────────────────────────────────── ────────────────────────────
so what I did: ->sysop@1304mini:~$ "sudo grub-install --root-directory=/mnt /dev/sda"

Installation finished. No error reported.
sysop@1304mini:~$
then:"sudo update-grub"

sysop@1304mini:~$ sudo update-grub
Generating grub.cfg ...
What do you want to boot up, Billy
Found linux image: /boot/vmlinuz-3.8.0-22-generic
Found initrd image: /boot/initrd.img-3.8.0-22-generic
Found linux image: /boot/vmlinuz-3.8.0-21-generic
Found initrd image: /boot/initrd.img-3.8.0-21-generic
Found Ubuntu 12.04.2 LTS (12.04) on /dev/sda7
Found Ubuntu 12.04.2 LTS (12.04) on /dev/sdc1
done
sysop@1304mini:~$


And now I am backing out of all open aps, and rebooting to see if any affects.


Presently after reboot -> no change to grub's booting menu. and ->
"debconf-show:"

sysop@1304mini:~$ sudo debconf-show grub-pc
[sudo] password for sysop:
grub-pc/kopt_extracted: false
grub2/kfreebsd_cmdline:
grub2/device_map_regenerated:
* grub-pc/install_devices:
grub-pc/postrm_purge_boot_grub: false
grub-pc/install_devices_failed_upgrade: true
grub-pc/disk_description:
grub2/linux_cmdline:
* grub-pc/install_devices_empty: true
grub2/kfreebsd_cmdline_default: quiet splash
grub-pc/partition_description:
grub-pc/install_devices_failed: false
grub-pc/install_devices_disks_changed:
grub2/linux_cmdline_default: quiet splash
grub-pc/chainload_from_menu.lst: true
grub-pc/hidden_timeout: true
grub-pc/mixed_legacy_and_grub2: true
grub-pc/timeout: 10
sysop@1304mini:~$


Please compare an output on a known stable system to mine; 4 of the entries in my output are "suspect" to me.
---------------
Right now I just do not know;
1. dd out my boot sector and try again ?
2. Is because I did not (re-)install grub onto my sda7 install of lubuntu the cause of this effect ?
3. Some how is my grub on sdc -ubuntu 12,04 - an issue ? How ? it is not mounted !// albeit in past attempts I did mount all my systems and run the "update-grub" routine, could this have complicated my sloppyation in that this corrupted my boot sector on sda ?
-------------

I would certainly appreciate any insight and guidance on a remedy/

with all due respect

Cavsfan
May 30th, 2013, 10:51 PM
Let me see if I can come up with what you need to do.

Cavsfan
May 30th, 2013, 11:33 PM
Hey people;

It's not really people although I appreciate help from others like Bogan and Oldfred.

If you want Raring to be your default you need to boot into Raring and enter sudo grub-install /dev/sda and sudo update-grub.

Place a single picture the size of your resolution in /boot/grub/. It can contain only 1 picture and if you want to change it, you have to remove the other one while making the change.
It can be any type of picture file as the code looks for the existance of a background file in 05_debian_theme looks like this:


case "${1}" in
*.jpg|*.JPG|*.jpeg|*.JPEG) reader="jpeg";;
*.png|*.PNG) reader="png";;
*.tga|*.TGA) reader="tga";;
*) return 3;; # Unknown image type.
esac

Be aware that some pictures just do not work. They will be listed in the output of sudo update-grub but they will not show at boot time. It has happened to me and I just chose another picture.
By having a picture there you can set your font colors in etc/grub.d//05_debian_theme after line 114 (See the Editing /etc/grub.d/05_debian_theme part in the wiki)

You know never make any changes to /boot/grub/grub.cfg right.

Make these changes to your /etc/default/grub file gksudo gedit /etc/default/grub
Delete this line from the file GRUB_BACKGROUND=/usr/share/images/grub/050817-N-3488C-028.tga

I do not know what "saved" means by GRUB_DEFAULT=saved
I have mine set to a number based on the output of this command:

This command reads the bootable lines which are only the contents of /etc/grub/06_custom as that is all I have executable.

cavsfan@cavsfan-MS-7529:~$ grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl
1 menuentry "Precise Pangolin 12.04" {
2 menuentry "Precise Pangolin 12.04 (Recovery Mode)" {
3 menuentry "Quantal Quetzal 12.10" {
4 menuentry "Quantal Quetzal 12.10 (Recovery Mode)" {
5 menuentry "Raring Ringtail 13.04" {
6 menuentry "Raring Ringtail 13.04 (Recovery Mode)" {
7 menuentry "Saucy Salamander 13.10" {
8 menuentry "Saucy Salamander 13.10 (Recovery Mode)" {
9 menuentry "Linux Mint 14 Nadia" {
10 menuentry "Linux Mint 14 Nadia (Recovery Mode)" {
11 menuentry "Windows 7" {


This is the output of my sudo blkid:

cavsfan@cavsfan-MS-7529:~$ sudo blkid
[sudo] password for cavsfan:
/dev/sda1: LABEL="C:" UUID="1CFC7A8DFC7A60C6" TYPE="ntfs"
/dev/sda2: LABEL="Precise" UUID="a162dc8a-e4df-4b79-b4c3-524761ff7ae1" TYPE="ext4"
/dev/sda3: UUID="e14dc02e-6ea8-4c95-b4d0-9dc04d32294d" TYPE="swap"
/dev/sda5: LABEL="Linux-Mint" UUID="b796e378-c9dd-4557-825b-5d5687197609" TYPE="ext4"
/dev/sda6: LABEL="Quantal" UUID="4d6a25ba-5a4b-4da4-8ae1-9939bc6b6b4c" TYPE="ext4"
/dev/sda7: LABEL="Saucy" UUID="89642e6f-ee35-49b7-b34b-c2f1b9871f42" TYPE="ext4"
/dev/sda8: LABEL="Raring" UUID="21fd827b-a771-4e96-9311-5ad11382d6f1" TYPE="ext4"
/dev/sda9: LABEL="Extra" UUID="e5387ae4-6423-4d97-b08b-9f2d31e235a2" TYPE="ext4"
/dev/sdb1: LABEL="Fantom" UUID="78B8D1A1B8D15DE6" TYPE="ntfs"

Here is what my /etc/grub/06_custom file looks like on Raring:


cavsfan@cavsfan-MS-7529:~$ cat /etc/grub.d/06_custom
#!/bin/sh
echo 1>&2 "Adding Ubuntu Precise Pangolin 12.04, Quantal Quetzal 12.10, Raring Ringtail 13.04, Saucy Salamander 13.10, Linux Mint 14 Nadia and Windows 7"
exec tail -n +4 $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 "Precise Pangolin 12.04" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro quiet splash
initrd /initrd.img
}
menuentry "Precise Pangolin 12.04 (Recovery Mode)" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Quantal Quetzal 12.10" {
set root=(hd0,6)
linux /vmlinuz root=/dev/sda6 ro quiet splash
initrd /initrd.img
}
menuentry "Quantal Quetzal 12.10 (Recovery Mode)" {
set root=(hd0,6)
linux /vmlinuz root=/dev/sda6 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Raring Ringtail 13.04" {
set root=(hd0,8)
linux /vmlinuz root=/dev/sda8 ro quiet splash
initrd /initrd.img
}
menuentry "Raring Ringtail 13.04 (Recovery Mode)" {
set root=(hd0,8)
linux /vmlinuz root=/dev/sda8 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Saucy Salamander 13.10" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro quiet splash
initrd /initrd.img
}
menuentry "Saucy Salamander 13.10 (Recovery Mode)" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Linux Mint 14 Nadia" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro quiet splash
initrd /initrd.img
}
menuentry "Linux Mint 14 Nadia (Recovery Mode)" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Windows 7" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 1CFC7A8DFC7A60C6
chainloader +1
}

I hope this gets you back up and I'll check tomorrow on your progress.
Thanks Bogan for your help!

Bashing-om
May 31st, 2013, 02:40 AM
Cavsfan;
Thank you for your time and effort. In regards to your last directive I have complied. Starting with a "clean" slate, making the edits; the result remains that my boot grub menu remains unchanged.
This is not to imply that there is any fault in your excellent tutorial. It boils down to I have a fault in my system and to this time I have not isolated it.
I presently do not have the knowledge to find this fault, though I keep pressing on.
Background:
Recently I had Ubuntu 10.04 standard desk-top install, ubuntu 12.04 standard desk-top install and lubuntu 12.04 standard desk-top install;
all booting with no issue on a standard grub menu.

At 10.04's EOL I prepared to end 10.04 and set up for whatever I was going to install in it's place.
GParted: deleted all the 10.04 partitions, and in their place I made 3 smaller partitions to house 13.04 and at that time I decided to do a "minimal"install.
The new install went with out an issue, smooth as one would want;
Rebooted: The grub boot menu in respect to the new raring install was presented in an unfamiliar syntax, but still worked to boot raring up.
installed xorg, xfce4 for the DE - no issue
installing google-chrome I encountered "authentication" issues, found there had been no .Xauthority file generated nor was the XAUTHORITY variable set. I worked through that;
Found I could not run a graphical application with root's access, installing "gksudo" resolved that one.

Now I am back to fixing the grub boot menu ...have been at this for a few weeks and nothing I do effects that boot menu.
The boot menu is fully functional, just no indication of which kernel I am booting.
Kinda pleased with my install of 13.04 ...got all ,less the menu, set up and I feel good about it. Now I feel good about my system and all I do and can do with it... a bit of pride perhaps on my part -> but while I was trying to doctor my boot menu, how bout the eye candy to show it off ??

I am unable to change anything on the grub boot menu from what was the initial setting when installed. And yes I am in a serious learning mode. I have done lots of homework to the point that I want to know how /boot/grub/grub.cfg is parsed as well as what tools I can make at my disposal to understand what is not taking place.

/boot/grub/grub.cfg is supposed to be executed at boot up, but is it ? (for 1 question)
"sudo apt-get install grub"'s install wizard balks at a destination device, and certain lines in "debconf's" output I wonder about (more homework); do I need to zero out the disk's boot sector and (re-)install (for 2nd question)
--------
This is where I stand now with my newly generated grub.cfg file:

## DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#


### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"


if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi


export menuentry_id_option


if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi


function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}


function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}


function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}


insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
else
search --no-floppy --fs-uuid --set=root 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
fi
if loadfont /boot/grub/DejaVuSansMono.pf2 ; then
set gfxmode=1600x900
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###


### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
else
search --no-floppy --fs-uuid --set=root 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
fi
insmod tga
if background_image /boot/grub/050817-N-3488C-028.tga; then
true
else
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
fi
### END /etc/grub.d/05_debian_theme ###


### BEGIN /etc/grub.d/06_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.
menuentry "RaRing 13.04" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro quiet splash
initrd /initrd.img
}
menuentry " RaRing 13.04 (Recovery Mode)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro recovery nomodeset
initrd /initrd.img
}
menuentry "LUBU12.04" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro quiet splash
initrd /initrd.img
}
menuentry " LUBU12.04 (Recovery Mode)" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro single
initrd /initrd.img
}
menuentry "ubie12.04" {
set root=(hd2,1)
linux /vmlinuz root=/dev/sdc1 ro quiet splash
initrd /initrd.img
}
menuentry " ubie12.04 (Recovery Mode)" {
set root=(hd2,1)
linux /vmlinuz root=/dev/sdc1 ro single
initrd /initrd.img
}


### END /etc/grub.d/06_custom ###


### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-3a47f1f1-ed1f-4134-b6aa-be101a7d97b4' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
else
search --no-floppy --fs-uuid --set=root 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
fi
linux /boot/vmlinuz-3.8.0-22-generic root=UUID=3a47f1f1-ed1f-4134-b6aa-be101a7d97b4 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.8.0-22-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-3a47f1f1-ed1f-4134-b6aa-be101a7d97b4' {
menuentry 'Ubuntu, with Linux 3.8.0-22-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-22-generic-advanced-3a47f1f1-ed1f-4134-b6aa-be101a7d97b4' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
else
search --no-floppy --fs-uuid --set=root 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
fi
echo 'Loading Linux 3.8.0-22-generic ...'
linux /boot/vmlinuz-3.8.0-22-generic root=UUID=3a47f1f1-ed1f-4134-b6aa-be101a7d97b4 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.8.0-22-generic
}
menuentry 'Ubuntu, with Linux 3.8.0-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-22-generic-recovery-3a47f1f1-ed1f-4134-b6aa-be101a7d97b4' {
recordfail
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
else
search --no-floppy --fs-uuid --set=root 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
fi
echo 'Loading Linux 3.8.0-22-generic ...'
linux /boot/vmlinuz-3.8.0-22-generic root=UUID=3a47f1f1-ed1f-4134-b6aa-be101a7d97b4 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.8.0-22-generic
}
menuentry 'Ubuntu, with Linux 3.8.0-21-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-21-generic-advanced-3a47f1f1-ed1f-4134-b6aa-be101a7d97b4' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
else
search --no-floppy --fs-uuid --set=root 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
fi
echo 'Loading Linux 3.8.0-21-generic ...'
linux /boot/vmlinuz-3.8.0-21-generic root=UUID=3a47f1f1-ed1f-4134-b6aa-be101a7d97b4 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.8.0-21-generic
}
menuentry 'Ubuntu, with Linux 3.8.0-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-21-generic-recovery-3a47f1f1-ed1f-4134-b6aa-be101a7d97b4' {
recordfail
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
else
search --no-floppy --fs-uuid --set=root 3a47f1f1-ed1f-4134-b6aa-be101a7d97b4
fi
echo 'Loading Linux 3.8.0-21-generic ...'
linux /boot/vmlinuz-3.8.0-21-generic root=UUID=3a47f1f1-ed1f-4134-b6aa-be101a7d97b4 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.8.0-21-generic
}
}


### END /etc/grub.d/10_linux ###


### BEGIN /etc/grub.d/20_linux_xen ###


### END /etc/grub.d/20_linux_xen ###


### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Ubuntu 12.04.2 LTS (12.04)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /vmlinuz root=/dev/sda7
initrd /initrd.img
}
submenu 'Advanced options for Ubuntu 12.04.2 LTS (12.04)' $menuentry_id_option 'osprober-gnulinux-advanced-4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /vmlinuz root=/dev/sda7
initrd /initrd.img
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /vmlinuz root=/dev/sda7
initrd /initrd.img
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /vmlinuz root=/dev/sda7
initrd /initrd.img.old
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-41-generic--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /boot/vmlinuz-3.2.0-41-generic root=/dev/sda7
initrd /boot/initrd.img-3.2.0-41-generic
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-43-generic--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /boot/vmlinuz-3.2.0-43-generic root=/dev/sda7
initrd /boot/initrd.img-3.2.0-43-generic
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-44-generic--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /boot/vmlinuz-3.2.0-44-generic root=/dev/sda7
initrd /boot/initrd.img-3.2.0-44-generic
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /vmlinuz root=/dev/sda7
initrd /initrd.img
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /vmlinuz root=/dev/sda7
initrd /initrd.img
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /vmlinuz root=/dev/sda7
initrd /initrd.img.old
}
menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz.old--4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d' {
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
else
search --no-floppy --fs-uuid --set=root 4e6cd96d-49bd-47f0-9dfe-8eeebad4cf9d
fi
linux /vmlinuz.old root=/dev/sda7
initrd /initrd.img.old
}
}


menuentry 'Ubuntu 12.04.2 LTS (12.04)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-5bae8c40-b15d-42f8-9fc9-0cf087f338d4' {
insmod part_msdos
insmod ext2
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
else
search --no-floppy --fs-uuid --set=root 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
fi
linux /boot/vmlinuz-3.2.0-44-generic root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro
initrd /boot/initrd.img-3.2.0-44-generic
}
submenu 'Advanced options for Ubuntu 12.04.2 LTS (12.04)' $menuentry_id_option 'osprober-gnulinux-advanced-5bae8c40-b15d-42f8-9fc9-0cf087f338d4' {
menuentry 'Ubuntu, with Linux 3.2.0-44-generic (on /dev/sdc1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-44-generic--5bae8c40-b15d-42f8-9fc9-0cf087f338d4' {
insmod part_msdos
insmod ext2
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
else
search --no-floppy --fs-uuid --set=root 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
fi
linux /boot/vmlinuz-3.2.0-44-generic root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro
initrd /boot/initrd.img-3.2.0-44-generic
}
menuentry 'Ubuntu, with Linux 3.2.0-44-generic (recovery mode) (on /dev/sdc1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-44-generic-root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro recovery nomodeset-5bae8c40-b15d-42f8-9fc9-0cf087f338d4' {
insmod part_msdos
insmod ext2
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
else
search --no-floppy --fs-uuid --set=root 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
fi
linux /boot/vmlinuz-3.2.0-44-generic root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro recovery nomodeset
initrd /boot/initrd.img-3.2.0-44-generic
}
menuentry 'Ubuntu, with Linux 3.2.0-43-generic (on /dev/sdc1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-43-generic--5bae8c40-b15d-42f8-9fc9-0cf087f338d4' {
insmod part_msdos
insmod ext2
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
else
search --no-floppy --fs-uuid --set=root 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
fi
linux /boot/vmlinuz-3.2.0-43-generic root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro
initrd /boot/initrd.img-3.2.0-43-generic
}
menuentry 'Ubuntu, with Linux 3.2.0-43-generic (recovery mode) (on /dev/sdc1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-43-generic-root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro recovery nomodeset-5bae8c40-b15d-42f8-9fc9-0cf087f338d4' {
insmod part_msdos
insmod ext2
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
else
search --no-floppy --fs-uuid --set=root 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
fi
linux /boot/vmlinuz-3.2.0-43-generic root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro recovery nomodeset
initrd /boot/initrd.img-3.2.0-43-generic
}
menuentry 'Ubuntu, with Linux 3.2.0-41-generic (on /dev/sdc1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-41-generic--5bae8c40-b15d-42f8-9fc9-0cf087f338d4' {
insmod part_msdos
insmod ext2
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
else
search --no-floppy --fs-uuid --set=root 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
fi
linux /boot/vmlinuz-3.2.0-41-generic root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro
initrd /boot/initrd.img-3.2.0-41-generic
}
menuentry 'Ubuntu, with Linux 3.2.0-41-generic (recovery mode) (on /dev/sdc1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-3.2.0-41-generic-root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro recovery nomodeset-5bae8c40-b15d-42f8-9fc9-0cf087f338d4' {
insmod part_msdos
insmod ext2
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
else
search --no-floppy --fs-uuid --set=root 5bae8c40-b15d-42f8-9fc9-0cf087f338d4
fi
linux /boot/vmlinuz-3.2.0-41-generic root=UUID=5bae8c40-b15d-42f8-9fc9-0cf087f338d4 ro recovery nomodeset
initrd /boot/initrd.img-3.2.0-41-generic
}
}


### END /etc/grub.d/30_os-prober ###


### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###


### 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 ###


### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
The contents of /boot/grub/




sysop@1304mini:~$ ls -la /boot/grub/
total 996
drwxr-xr-x 5 root root 4096 May 30 19:22 .
drwxr-xr-x 3 root root 4096 May 28 22:02 ..
-rw-r--r-- 1 root root 814353 Jan 26 17:09 050817-N-3488C-028.tga
-rw-r--r-- 1 root root 142763 May 27 14:39 DejaVuSansMono.pf2
drwxr-xr-x 2 root root 4096 May 19 11:04 fonts
-rw-r--r-- 1 root root 699 May 30 14:04 gfxblacklist.txt
-r--r--r-- 1 root root 21363 May 30 19:22 grub.cfg
-rw-r--r-- 1 root root 1024 May 30 19:31 grubenv
drwxr-xr-x 2 root root 12288 May 30 18:40 i386-pc
drwxr-xr-x 2 root root 4096 May 30 18:40 locale
sysop@1304mini:~$

Note there is no device.map file generated.... huh ? (this be question 3)

Forum questions are to be like dead men "one to the box" but my three questions I consider all related to a single issue -> why can I not alter the boot grub menu ?

all help remains hugely appreciated.

Cavsfan
May 31st, 2013, 01:58 PM
You definitely do not want to install Grub 1 with this command sudo apt-get install grub.
What is the output of this on Raring: grub-install -v.

It should look like this:


cavsfan@cavsfan-MS-7529:~$ grub-install -v
grub-install (GRUB) 2.00-13ubuntu3


Always make sure you enter sudo update-grub after you have made any changes to any of the grub files.
Keep in mind that when you get down to have just what is in your 06_custom file displaying at bootup the most recently installed kernel is what you will boot up with.
It is not the highest number but, the most recently installed kernel.

Can you post the contents of your /etc/grub.d/06_custom file?
Can you also post the output of this command

grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl

I noticed that in Precise 12.04 you have 3 kernels. You only need to retain two so you could enter this while in Precise:
This is not critical but, it will free up about 200+MB of disk space.

sudo apt-get purge linux-headers-3.2.0-41 linux-headers-3.2.0-41-generic linux-image-3.2.0-41-generic

bogan
May 31st, 2013, 05:08 PM
Hi!, Bashing_om,

The output from: 'sudo debconf-show grub' in my sda Raring, is identical except for the two lines in your Post that have an asterisk in front:

* grub-pc/install_devices:
...
* grub-pc/install_devices_empty: true Those two lines in mine are:
* grub-pc/install_devices: /dev/disk/by-id/ata-SanDisk_SDSSDP128G_130372403160
...
grub-pc/install_devices_empty: false Note, the second does not have an asterisk.

I would take this, plus the error message you got from:
~$ sudo grub-install grub-pc
[sudo] password for sysop:
/usr/sbin/grub-probe: error: cannot find a GRUB drive for grub-pc. Check your device.map. means that grub-pc {ie Grub 2.00} is not installed, or not properly installed. in the Raring installation.
[ I assume you have tried: ' sudo apt-get install --reinstall grub-pc'.] The error is because grub-install is expecting to get a destination in the form: "/deb/sdx" and is supposed to ask for one, presumably it does not get that far, as it cannot find Grub-pc.

I cannot answer your three 'Why & How?' questions, but I know I had very similar problems to yours with my installations using multiple drives, including USB/eSata removable ones, and they became so complex that in the end I had to give up on Cavsfan's system.

I probably did not explain sufficiently my notion of what is preventing you from altering the Grub Menu displayed by default.

Suppose that sdc drive is set in Bios/AEFFI as the priority default boot device, and the Linux installed in sdc has a grub set to boot to Raring in sda by default { made more complex by your /etc/default/grub default being set to "saved" } The result would appear to be the same as if booted from the grub in sda, but any alteration of the grub files there, would have no effect on the default behaviour.

As an instance, if I boot from my USB stick Raring I get a grub menu that includes the Raring on sdc, an external HDD; and it boots to it OK.
Whereas, when booted to Raring on the SSD [ sda ], although 'update-grub' finds the Raring on sdc, it does not appear in the grub Menu that sda displays. Similarly Cavsfan's system does not allow sdc's Raring to boot, as it produces an sdc identity error, hangs there for about a minute, and then boots into the last set default boot choice; though how it decides which that will be, I have no idea.

For these and other reasons I make sure that each of my Linux grub menus has a different Menu Background, so I am never in doubt as to which grub is in control.

It would be interesting to know what happens if you select in BIos to boot from sdc and alter the /etc/default/grub file there and reboot similarly, and also as you have previously done. Is there any difference?

@ Cavsfan.
AFAIK: 'grub-defalt=saved' means default is whatever was last selected. EG: if the first entry is Raring and the third is Windows, and Windows is selected and booted; if on reboot it is left to default, Windows will again boot up; not Raring that might be expected.

Edit; Note the following from /boot/grub/grub.cfg:
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry= save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi Chao!, bogan { Second Posting, first attempt this morning did not appear in the Forum. }

Bashing-om
May 31st, 2013, 05:56 PM
@Cavsfan ; The info you requested.

1) output of "grub-install -v":

grub-install (GRUB) 2.00-13ubuntu3
2) My crrent /etc/grub.d/o6.custom :

#!/bin/shecho 1>&2 "What do you want to boot up, Billy"
exec tail -n +4 $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 "RaRing 13.04" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro quiet splash
initrd /initrd.img
}
menuentry " RaRing 13.04 (Recovery Mode)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro recovery nomodeset
initrd /initrd.img
}
menuentry "LUBU12.04" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro quiet splash
initrd /initrd.img
}
menuentry " LUBU12.04 (Recovery Mode)" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro single
initrd /initrd.img
}
menuentry "ubie12.04" {
set root=(hd2,1)
linux /vmlinuz root=/dev/sdc1 ro quiet splash
initrd /initrd.img
}
menuentry " ubie12.04 (Recovery Mode)" {
set root=(hd2,1)
linux /vmlinuz root=/dev/sdc1 ro single
initrd /initrd.img
}

3) output of grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl




1 menuentry "RaRing 13.04" {
2 menuentry " RaRing 13.04 (Recovery Mode)" {
3 menuentry "LUBU12.04" {
4 menuentry " LUBU12.04 (Recovery Mode)" {
5 menuentry "ubie12.04" {
6 menuentry " ubie12.04 (Recovery Mode)" {
7 menuentry 'Ubuntu
8 submenu 'Advanced options for Ubuntu
9 menuentry 'Ubuntu, with Linux 3.8.0-22-generic
10 menuentry 'Ubuntu, with Linux 3.8.0-22-generic (recovery mode)
11 menuentry 'Ubuntu, with Linux 3.8.0-21-generic
12 menuentry 'Ubuntu, with Linux 3.8.0-21-generic (recovery mode)
13 menuentry 'Ubuntu 12.04.2 LTS (12.04)
14 submenu 'Advanced options for Ubuntu 12.04.2 LTS (12.04)
15 menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)
16 menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)
17 menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)
18 menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)
19 menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)
20 menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)
21 menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)
22 menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)
23 menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)
24 menuentry 'Ubuntu 12.04.2 LTS (12.04) (on /dev/sda7)
25 menuentry 'Ubuntu 12.04.2 LTS (12.04)
26 submenu 'Advanced options for Ubuntu 12.04.2 LTS (12.04)
27 menuentry 'Ubuntu, with Linux 3.2.0-44-generic (on /dev/sdc1)
28 menuentry 'Ubuntu, with Linux 3.2.0-44-generic (recovery mode) (on /dev/sdc1)
29 menuentry 'Ubuntu, with Linux 3.2.0-43-generic (on /dev/sdc1)
30 menuentry 'Ubuntu, with Linux 3.2.0-43-generic (recovery mode) (on /dev/sdc1)
31 menuentry 'Ubuntu, with Linux 3.2.0-41-generic (on /dev/sdc1)
32 menuentry 'Ubuntu, with Linux 3.2.0-41-generic (recovery mode) (on /dev/sdc1)



And a new thank you for assisting me in this matter.

bk

@ bogan Thanks to you also, I am presently suffering from info overload, lemme have some time to digest and assimilate.
Too much info and having some difficulty differentiating old info from new as applied to grub2 vice versions <1.99 as well as "legacy". -But, they all parse some file somewhere to some end - !

later, when I have all my ducks in a row

Cavsfan
May 31st, 2013, 06:20 PM
#!/bin/shecho 1>&2 "What do you want to boot up, Billy"
exec tail -n +4 $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 "RaRing 13.04" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro quiet splash
initrd /initrd.img
}


Edit that first line and break it into 2 lines:
gksudo gedit /etc/grub.d/06_custom
Make it look like this:

#!/bin/sh
echo 1>&2 "What do you want to boot up, Billy"

Then enter sudo-update grub.

the "+4" in the exec tail line means that it will start execution at the 4th line.

In my 06_custom file:

#!/bin/sh
echo 1>&2 "Adding Ubuntu Precise Pangolin 12.04, Quantal Quetzal 12.10, Raring Ringtail 13.04, Saucy Salamander 13.10, Linux Mint 14 Nadia and Windows 7"
exec tail -n +4 $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 "Precise Pangolin 12.04" {

The 4th executable line in my file is "menuentry", which is correct however the 4th line in your file is "set root=(hd0,1)" which will cause problems.

As Bogan said your default being "saved" may be just fine. I perfer setting mine to a static number. I have mine set to 10 (windows 7) for my wife in case the pc reboots.

See if that doesn't fix your whole problem and let me know.

Bashing-om
May 31st, 2013, 10:55 PM
@ bogan and Cavsfan :

Success ! Long story short, see my conclusion.


bogan;
I agree that grub2 must not be "properly" installed at this time.
Ok, what can I do to insure that it is properly installed: (?) I have seen docs where it is recommended that the primary grub be installed to one's primary booting system (in my case raring)MBR, and that grub on the secondary systems be installed to the root partition -vice MBR's boot sector. Now this conflicts with docs that direct that grub should be installed to that MBR boot sector.
Presently I have raring (sda1/root) installed to the MBR boot sector, that "might" be corrupted.
Attempts to (re-)install grub have been in-effectual, in that the install wizard cannot be forced to install to any location; installing grub manually to a designated location does complete with "no reported errors". However that work-around does not resolve the underlying issue.

Lubuntu 12.04(sda7) I have "removed purged grub" and have not (re-)installed
ubuntu 12.04 (sdc1) Grub installed onto the MBR sector. (allowing me to boot up in the event of serious problems in sda)--I have seen documentation that it is not required on the secondary system ( highly doubt that !)but ??


Now this begs the question...os-prober...looking for operating systems, if no grub is installed at all on a seconday system, does it drive os-prober nuts ? -> where should grub be installed to, on the seconday OS --in my case - Lubuntu on sda7.


Changing the boot order in bios: No, that had not occurred to me, will try it and see what results, and advice back to the thread on what results.


-by the way, it helps tremendously to have someone to discuss this matter with, It forces my thoughts into some kind of order, saving me from the choas I am presntly expreiencing !-


My high regards

conclusion:

Presently the boot grub menu is working as desired and expected - bogan, your voice of experience shouts loudly now in my ears.
For years I had "thought" that I was booting this system from the 1st hard drive (my hard drives are all from the same manufacturer and all the same size -> nomenclature in bios of the drives are all the same),
- Taking your advise I re-arranged the boot order anyway; rebooted and I had a comprehensible boot menu !
- Then taking a slight risk I installed grub-pc on the lubuntu (sda7) install and directed grub to be installed in sda -> update-grub ;
- Then rebooted into raring -> (re-)install grub for sda from this install -> update-grub ->
- Reboot and much to fulfill my hopes and a wonder to behold was my splash screen with the desired boot options as desired !
- Ran grub-mkdevicemap and device.map has been generated....

As all is working now I am going to take the attitude - if it ain't broke, don't fix it ! -
As I now have a working system (again) my questions have receeded in precedence , such that I can pursue them at leisure.

Thank you again for coming to my aid in my time of need


@ Cavsfan; The guidance and confirmation you provided was instrumental ! Just being sure of my foundation was a big help.
( 06_custom's line was an error in transitioning - xfce4/xterm into google-chrome for the forum )

I do appreciate your time and care; your devotion increases my devotion.
--------------------
pending yall's closing remarks to mark this thread as closed and over with.

my best regards

Cavsfan
June 1st, 2013, 02:03 PM
Glad you got it sorted out and working well. :)

Cavsfan
June 3rd, 2013, 06:15 PM
You could have this:

http://i.imgur.com/d0UqsFC.jpg

Or you could have this:

http://i.imgur.com/K1rTT1A.jpg

It is totally up to you. ;)

deadflowr
June 3rd, 2013, 06:58 PM
^ I prefer the latter, as the only benefit of the former is the realization of how many kernels I would have.
If I set a small boot partition, I'd pay closer attention the kernels I have.But alas, I don't have a small boot partition and even if I did, I'm certain I'd be proactive in cleaning up old kernels.

Cavsfan
June 3rd, 2013, 09:45 PM
^ I prefer the latter, as the only benefit of the former is the realization of how many kernels I would have.
If I set a small boot partition, I'd pay closer attention the kernels I have. But alas, I don't have a small boot partition and even if I did, I'm certain I'd be proactive in cleaning up old kernels.

I agree! :D I have so many things installed on this PC that without this way of customizing the grub menu I would be lost! I too have enough trouble keeping only 2 kernels on each OS.
I'll install a kernel and reboot then forget which one I was in last. Yesterday I found one system I had 4 kernels still installed. I had to delete 2 of them. I only keep all of these installs to keep up with the grub versions.

That was sort of a trick question any way! :D Kind of like "do you want something lame or do you want something cool?" ;)

Thanks for the reply deadflowr! :)

Plus if you look at the first picture it looks like every install is on each partition. Strange! sudo bklid and I know which partitions my installs are on and sdax is all you really need to know to get this working.
It looked really difficult to me at first but, then the more and more I looked at it the simpler it got.

Bashing-om
June 3rd, 2013, 10:51 PM
Pardon me in the event I am interjecting;

Adhering to Cavsfan's method has greatly simplified my booting experiences, and the added eye candy is "soothing".

Simpler is better ! Alterations to the boot menu are "no big deal". -->
I appreciate a better way to do "anything".


just my opinion

Cavsfan
June 4th, 2013, 02:11 PM
Pardon me in the event I am interjecting;

Adhering to Cavsfan's method has greatly simplified my booting experiences, and the added eye candy is "soothing".

Simpler is better ! Alterations to the boot menu are "no big deal". -->
I appreciate a better way to do "anything".


just my opinion




Thank you Bashing-om! I agree simpler is always better. :D

Cavsfan
June 16th, 2013, 09:23 PM
FYI:
If you are tired of gedit opening two tabs when you enter gksudo gedit filename someone posted this workaround on the bug report.

I noticed that gedit opens two tabs on every install on my box (in my signature) and it is annoying.

So, this is what was on the bug report that I cannot seem to readily find right now. BTW this also works very well until a fix is released.

Paddy Landau found that gksudo gksudo gedit finename was a workaround and someone came up with a script that will work so you do not need to enter gksudo twice.

Enter gedit ~/.bashrc or find this hidden file in your home directory and edit it and add the following:


# gksudo gedit opening 2 tabs fix
gksudo ()
{
if [ "$1" = "gedit" ]
then
shift
gksudo gksudo gedit "$@"
else
command gksudo "$@"
fi
}

Edit: This has supposedly been resolved with gedit 3.7 or greater.


cavsfan@cavsfan-MS-7529:~$ apt-cache policy gedit
gedit:
Installed: 3.8.3-0ubuntu3
Candidate: 3.8.3-0ubuntu3
Version table:
*** 3.8.3-0ubuntu3 0
500 http://us.archive.ubuntu.com/ubuntu/ saucy/main amd64 Packages
100 /var/lib/dpkg/status

Cavsfan
July 19th, 2013, 05:24 PM
Here is one on Saucy 13.10:

http://i.imgur.com/vYOgf3A.jpg

Cavsfan
August 16th, 2013, 02:43 PM
If any one is using this on Saucy 13.10, todays update to grub-pc, etc. changed where the font color lines go. They are now after line 117.
As I have probably mentioned more than once, it it recommended to accept the installers version instead of keeping your modified version of the files.


cavsfan@cavsfan-MS-7529:~$ grub-install -v
grub-install (GRUB) 2.00-17ubuntu1

It updated /etc/grub.d/05_debian_theme as well as /etc/default/grub.

I made the changes to those 2 files before I rebooted.

245412

Cavsfan
September 24th, 2013, 07:12 PM
New Grub2 screen for Raring Ringtale 13.04:

http://i.imgur.com/bx1J8GR.jpg

It's been hard for me to get away from light-cyan for highlight font color and cyan for normal font color. Since I have mainly dark pictures. ;)

Cavsfan
October 17th, 2013, 06:38 PM
I will be editing this wiki adding 2 lines to cover Saucy 13.10 since it was released today.
Shouldn't take long. ;)

Cavsfan
October 17th, 2013, 06:44 PM
Finished updating the wiki.
Happy Ubuntuing :)

Cavsfan
October 18th, 2013, 03:58 PM
Grub2 screen on Saucy Salamander 13.10 after install of final release:

http://i.imgur.com/QP1iq72.jpg

Cavsfan
October 31st, 2013, 10:31 PM
A new Grub screen for Quantal:

http://i.imgur.com/xNt92dp.jpg

von Stalhein
November 6th, 2013, 09:45 AM
Nice work Cavsfan!

So, if you select Win7 the scorpion strikes???? :D

I'm in withdrawal, my Ubuntu box died a while ago & every other machine here runs Win.
Saving the bikkies to build a new one & lurking in these forums for a fix is my sad existence atm :P

Cavsfan
November 6th, 2013, 03:07 PM
Nice work Cavsfan!

So, if you select Win7 the scorpion strikes???? :D

I'm in withdrawal, my Ubuntu box died a while ago & every other machine here runs Win.
Saving the bikkies to build a new one & lurking in these forums for a fix is my sad existence atm :P

Thanks :)

Good luck! I need to get a backup laptop or something myself as soon as I can.

Cavsfan
November 13th, 2013, 07:31 PM
A new Grub2 screen for Trusty Tahr 14.04:

http://i.imgur.com/ACNTh8l.jpg

jnmjr
November 21st, 2013, 01:09 PM
Hi Cavsfan, you were refered to me as the one to possibly help solve my problem, I would like to remove the rectangular border from the grub2 menu. I've done quite a bit of searching, lots of posts on customizing menu but nothing on removing just the border. I have a nice image and the border takes away from it. Any help would be greatly appreciated. Thx in advance.

Cavsfan
November 21st, 2013, 05:27 PM
Hi Cavsfan, you were refered to me as the one to possibly help solve my problem, I would like to remove the rectangular border from the grub2 menu. I've done quite a bit of searching, lots of posts on customizing menu but nothing on removing just the border. I have a nice image and the border takes away from it. Any help would be greatly appreciated. Thx in advance.

I have never thought about removing the rectangular border. Let me see what I can find.

fantab
November 21st, 2013, 05:48 PM
I have never thought about removing the rectangular border. Let me see what I can find.

I will look forward to it.
Also is there a way to align grub menu list to the center? I would be great if we could move the list from the current left to center or right alignment, if the background image demands so.

Regards...

Cavsfan
November 21st, 2013, 06:23 PM
I will look forward to it.
Also is there a way to align grub menu list to the center? I would be great if we could move the list from the current left to center or right alignment, if the background image demands so.

Regards...

I actually do not see where the rectangular border comes from. Although I can imagine it is used to position the menu items and all that is displayed at boot time. So, if you could remove the border you might have other problems.
In the past when I have had a nice picture that I wanted to use and it didn't work as well as I had wanted I would either edit the picture via gimp or select another picture for my grub screen.
You really have to tailor the picture to the grub menu and not vice versa and the font colors as well, e.g. you have to have light font colors for a dark background picture etc.

If you notice all I have never used are pictures without words; just basic pictures. I also do not see a way to move the menu selections to the middle of the screen.
In Section 4 there is a Links section that will lead you to additional information about Grub2 and that page has a Links section at the bottom which leads to more Grub information.
Feel free to research it and good luck! :)

fantab
November 21st, 2013, 06:45 PM
Yeah, even I select background pics with grub menu layout in mind. Also I have my Grub for 3 seconds, and I feel what we have is pretty good.
I have done my share of research with regards to aligning menu list to center but couldn't find anything interesting, so far.

Cavsfan
November 21st, 2013, 10:55 PM
Yeah, even I select background pics with grub menu layout in mind. Also I have my Grub for 3 seconds, and I feel what we have is pretty good.
I have done my share of research with regards to aligning menu list to center but couldn't find anything interesting, so far.

The border positioning has to be used to parse down the screen for the placement of everything on there. It becomes scrollable if it gets past the end of your screen.
I have a big monitor and have rarely seen that but I have seen it. I have my timeout set to 60 seconds because sometimes my mind wanders or I leave the room before I make the selection.
I have 7 OSs on here and need the time to make up my mind where I'm going lol. :)

jeremy1701
December 4th, 2013, 06:33 PM
I seem to be having an issue whereby I am unable to update grub. I was instructed to post the original query here to seek further assistance.

http://ubuntuforums.org/showthread.php?t=2191652

The command update-grub does not seem to have any affect on the grub menu. Any suggestions on how to proceed?

Cavsfan
December 4th, 2013, 07:27 PM
I seem to be having an issue whereby I am unable to update grub. I was instructed to post the original query here to seek further assistance.

http://ubuntuforums.org/showthread.php?t=2191652

The command update-grub does not seem to have any affect on the grub menu. Any suggestions on how to proceed?

Try this: enter in terminal sudo grub-install /dev/sda that is if your grub needs to be on sda, which would be your primary drive, It should just say "installation finished with no errors."
Then enter sudo update grub and if the output is not right post the output here. I'll see if I can help.

What does it list when you enter this in terminal?

grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0


cavsfan@cavsfan-MS-7529:~$ grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0
0 menuentry "Precise Pangolin 12.04" {
1 menuentry "Precise Pangolin 12.04 (Recovery Mode)" {
2 menuentry "Quantal Quetzal 12.10" {
3 menuentry "Quantal Quetzal 12.10 (Recovery Mode)" {
4 menuentry "Raring Ringtail 13.04" {
5 menuentry "Raring Ringtail 13.04 (Recovery Mode)" {
6 menuentry "Saucy Salamander 13.10" {
7 menuentry "Saucy Salamander 13.10 (Recovery Mode)" {
8 menuentry "Trusty Tahr 14.04" {
9 menuentry "Trusty Tahr 14.04 (Recovery Mode)" {
10 menuentry "Linux Mint 13 Nadia" {
11 menuentry "Linux Mint 13 Nadia (Recovery Mode)" {
12 menuentry "Windows 7" {

jeremy1701
December 4th, 2013, 08:18 PM
Output of each commad is below.


$ grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0
0 menuentry 'Kubuntu
1 submenu 'Advanced options for Kubuntu
2 menuentry 'Kubuntu, with Linux 3.11.0-14-generic
3 menuentry 'Kubuntu, with Linux 3.11.0-14-generic (recovery mode)
4 menuentry 'Kubuntu, with Linux 3.11.0-12-generic
5 menuentry 'Kubuntu, with Linux 3.11.0-12-generic (recovery mode)
6 menuentry "Windows UEFI bkpbootmgfw.efi" {
7 menuentry "Windows Boot UEFI loader" {
8 menuentry "EFI/toshiba/Boot/bootmgfw.efi" {
9 menuentry "Windows Boot Manager (UEFI on /dev/sda2)" --class windows --class os {
10 menuentry 'System setup



$ sudo grub-install /dev/sda
BootCurrent: 0004
Timeout: 2 seconds
BootOrder: 0004,2003,2001,2002
Boot0002* EFI Network 0 for IPv6 (00-8C-FA-72-E4-4B)
Boot0003* EFI Network 0 for IPv4 (00-8C-FA-72-E4-4B)
Boot0004* Windows Boot Manager
Boot2001* EFI USB Device
Boot2002* EFI DVD/CDROM
Boot2003* EFI Network
BootCurrent: 0004
Timeout: 2 seconds
BootOrder: 0000,0004,2003,2001,2002
Boot0002* EFI Network 0 for IPv6 (00-8C-FA-72-E4-4B)
Boot0003* EFI Network 0 for IPv4 (00-8C-FA-72-E4-4B)
Boot0004* Windows Boot Manager
Boot2001* EFI USB Device
Boot2002* EFI DVD/CDROM
Boot2003* EFI Network
Boot0000* kubuntu
Installation finished. No error reported.



$ sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.11.0-14-generic
Found initrd image: /boot/initrd.img-3.11.0-14-generic
Found linux image: /boot/vmlinuz-3.11.0-12-generic
Found initrd image: /boot/initrd.img-3.11.0-12-generic
Found Windows Boot Manager on /dev/sda2@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done

Cavsfan
December 4th, 2013, 09:37 PM
Output of each commad is below.


$ grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0
0 menuentry 'Kubuntu
1 submenu 'Advanced options for Kubuntu
2 menuentry 'Kubuntu, with Linux 3.11.0-14-generic
3 menuentry 'Kubuntu, with Linux 3.11.0-14-generic (recovery mode)
4 menuentry 'Kubuntu, with Linux 3.11.0-12-generic
5 menuentry 'Kubuntu, with Linux 3.11.0-12-generic (recovery mode)
6 menuentry "Windows UEFI bkpbootmgfw.efi" {
7 menuentry "Windows Boot UEFI loader" {
8 menuentry "EFI/toshiba/Boot/bootmgfw.efi" {
9 menuentry "Windows Boot Manager (UEFI on /dev/sda2)" --class windows --class os {
10 menuentry 'System setup



$ sudo grub-install /dev/sda
BootCurrent: 0004
Timeout: 2 seconds
BootOrder: 0004,2003,2001,2002
Boot0002* EFI Network 0 for IPv6 (00-8C-FA-72-E4-4B)
Boot0003* EFI Network 0 for IPv4 (00-8C-FA-72-E4-4B)
Boot0004* Windows Boot Manager
Boot2001* EFI USB Device
Boot2002* EFI DVD/CDROM
Boot2003* EFI Network
BootCurrent: 0004
Timeout: 2 seconds
BootOrder: 0000,0004,2003,2001,2002
Boot0002* EFI Network 0 for IPv6 (00-8C-FA-72-E4-4B)
Boot0003* EFI Network 0 for IPv4 (00-8C-FA-72-E4-4B)
Boot0004* Windows Boot Manager
Boot2001* EFI USB Device
Boot2002* EFI DVD/CDROM
Boot2003* EFI Network
Boot0000* kubuntu
Installation finished. No error reported.



$ sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.11.0-14-generic
Found initrd image: /boot/initrd.img-3.11.0-14-generic
Found linux image: /boot/vmlinuz-3.11.0-12-generic
Found initrd image: /boot/initrd.img-3.11.0-12-generic
Found Windows Boot Manager on /dev/sda2@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done

OK, I see 2 things wrong:
1. You must not have the custom file executable. I would recommend editing /etc/grub.d/40_custom and then saving it as 06_custom because the purpose of this grub customization is to have a static menu that only changes when you want it to. Having it in 06_custom means it will always be on top.
Make sure 40_custom is not executable sudo chmod -x /etc/grub.d/40_custom and after you have saved 06_custom make it executable sudo chmod +x /etc/grub.d/06_custom.
2. You do not have a picture in /boot/grub/. Make sure you have a picture that matches your resolution and copy it there via sudo cp somepicture.jpg /boot/grub/
Then enter sudo update-grub and you should notice a difference.

This is what I see in the output of sudo update-grub:

cavsfan@cavsfan-MS-7529:/etc/grub.d$ sudo update-grub
Generating grub.cfg ...
Found background image: smoke_skull_light_green_black_10640_1920x1200.jpg
Adding Ubuntu Precise Pangolin 12.04, Quantal Quetzal 12.10, Raring Ringtail 13.04, Saucy Salamander 13.10, Trusty Tahr 14.04, Linux Mint 13 Nadia and Windows 7
Found linux image: /boot/vmlinuz-3.12.0-5-generic
Found initrd image: /boot/initrd.img-3.12.0-5-generic
Found linux image: /boot/vmlinuz-3.12.0-4-generic
Found initrd image: /boot/initrd.img-3.12.0-4-generic
Found Windows 7 (loader) on /dev/sda1
Found Ubuntu 12.04.3 LTS (12.04) on /dev/sda2
Found Ubuntu 12.10 (12.10) on /dev/sda6
Found Ubuntu 13.10 (13.10) on /dev/sda7
Found Ubuntu 13.04 (13.04) on /dev/sda8
Found Linux Mint 13 Maya (13) on /dev/sda9
done


That is with everything but 20_memtest86+ executable. Let's see what difference those 2 changes make. It should make what is in red appear in the output.

jeremy1701
December 5th, 2013, 04:42 AM
Thanks for the info above. Unfortunately, making those changes seems to have no effect as well. I tried purging and re-installing grub using the live 13.10 disc, still nothing has changed. Here is new output:

http://paste.ubuntu.com/6522428/

fantab
December 5th, 2013, 05:34 AM
Thanks for the info above. Unfortunately, making those changes seems to have no effect as well. I tried purging and re-installing grub using the live 13.10 disc, still nothing has changed. Here is new output:

http://paste.ubuntu.com/6522428/

Did you use an image as suggested? Did it appear as Grub menu background when you did "update-grub"?

jeremy1701
December 5th, 2013, 03:07 PM
Success!! In addition to the edits to /etc/default/grub, I had to add savedefault to each menu entry in vim /etc/grub.d/25_custom.

Note: Updated original post

Cavsfan
December 5th, 2013, 03:10 PM
Thanks for the info above. Unfortunately, making those changes seems to have no effect as well. I tried purging and re-installing grub using the live 13.10 disc, still nothing has changed. Here is new output:

http://paste.ubuntu.com/6522428/

All I see in the 06_custom file is this:

### BEGIN /etc/grub.d/06_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.
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
### END /etc/grub.d/06_custom ###

I do not see that you have any picture in /boot/grub/. The fact that grub finds a picture in that location lets you add font colors in 05_debian_theme. If there is no picture you cannot have colored fonts.
I seen that you wanted to have a default OS that it will boot to and with the menuentries in 06_custom, you can control that in /etc/default/grub where it says GRUB_DEFAULT=0 (this starts at 0 for the first line,1 for the second line,2 for the 3rd line etc.).

Here is a copy of my 06_custom file modify it to suit your needs by changing the partitions in red on the first example and the text between the quotes then save it and make it executable by sudo chmod +x /etc/grub.d/06_custom in terminal.
Then be sure to enter sudo update-grub for the changes to take effect, Then you should see the picture listed and the echo output listed.
I have my default set to 12 for the 13th entry.


#!/bin/sh
echo 1>&2 "Adding Ubuntu Precise Pangolin 12.04, Quantal Quetzal 12.10, Raring Ringtail 13.04, Saucy Salamander 13.10, Trusty Tahr 14.04, Linux Mint 13 Nadia and Windows 7"
exec tail -n +4 $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 "Precise Pangolin 12.04" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro quiet splash
initrd /initrd.img
}
menuentry "Precise Pangolin 12.04 (Recovery Mode)" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Quantal Quetzal 12.10" {
set root=(hd0,6)
linux /vmlinuz root=/dev/sda6 ro quiet splash
initrd /initrd.img
}
menuentry "Quantal Quetzal 12.10 (Recovery Mode)" {
set root=(hd0,6)
linux /vmlinuz root=/dev/sda6 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Raring Ringtail 13.04" {
set root=(hd0,8)
linux /vmlinuz root=/dev/sda8 ro quiet splash
initrd /initrd.img
}
menuentry "Raring Ringtail 13.04 (Recovery Mode)" {
set root=(hd0,8)
linux /vmlinuz root=/dev/sda8 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Saucy Salamander 13.10" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro quiet splash
initrd /initrd.img
}
menuentry "Saucy Salamander 13.10 (Recovery Mode)" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Trusty Tahr 14.04" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro quiet splash
initrd /initrd.img
}
menuentry "Trusty Tahr 14.04 (Recovery Mode)" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Linux Mint 13 Nadia" {
set root=(hd0,9)
linux /vmlinuz root=/dev/sda9 ro quiet splash
initrd /initrd.img
}
menuentry "Linux Mint 13 Nadia (Recovery Mode)" {
set root=(hd0,9)
linux /vmlinuz root=/dev/sda9 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Windows 7" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 1CFC7A8DFC7A60C6
chainloader +1
}

Cavsfan
December 5th, 2013, 03:14 PM
Success!! In addition to the edits to /etc/default/grub, I had to add savedefault to each menu entry in vim /etc/grub.d/25_custom.

Note: Updated original post

With the entries in 06_custom as in my previous post you don't need savedefault. You can control the line number in /etc/default/grub.

Here is a copy of mine:


# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=12
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=60
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_FONT=/boot/grub/DejaVuSansMono.pf2

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1920x1200-24

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

Cavsfan
December 5th, 2013, 03:17 PM
Then with your menu entries in 06_custom you will not need 25_custom and you should make it unexecutable sudo chmod -x /etc/grub.d/25_custom and then sudo update-grub.

Cavsfan
December 5th, 2013, 03:18 PM
Here is my output:

cavsfan@cavsfan-MS-7529:~$ sudo update-grub
[sudo] password for cavsfan:
Generating grub.cfg ...
Found background image: smoke_skull_light_green_black_10640_1920x1200.jpg
Adding Ubuntu Precise Pangolin 12.04, Quantal Quetzal 12.10, Raring Ringtail 13.04, Saucy Salamander 13.10, Trusty Tahr 14.04, Linux Mint 13 Nadia and Windows 7
done

jeremy1701
December 5th, 2013, 03:33 PM
Hi Cavsfan,
You are correct about making the entries in 06_custom. They did work in that location, however remember the last OS booted did not. I re-ran Boot Repair from 13.10 live disc as suggested by fantab. This effectively removed the 06_custom file and replaced it with 25_custom (again).

Thanks for all of your assistance. I will try to add the image now. My main issue was booting the previous OS.

How do I know the resolution of my grub screen?

fantab
December 5th, 2013, 03:37 PM
The resoultion should be same as your monitor/graphics card that you have set.

jeremy1701
December 5th, 2013, 05:26 PM
Awesome! Grub image is working. Looks great. Thanks again for all the assistance!

Cavsfan
December 5th, 2013, 05:46 PM
Hi Cavsfan,
You are correct about making the entries in 06_custom. They did work in that location, however remember the last OS booted did not. I re-ran Boot Repair from 13.10 live disc as suggested by fantab. This effectively removed the 06_custom file and replaced it with 25_custom (again).

Thanks for all of your assistance. I will try to add the image now. My main issue was booting the previous OS.

How do I know the resolution of my grub screen?


cavsfan@cavsfan-MS-7529:~$ xdpyinfo | grep dimensions
dimensions: 1920x1200 pixels (508x318 millimeters)

Cavsfan
December 5th, 2013, 05:56 PM
Awesome! Grub image is working. Looks great. Thanks again for all the assistance!

You are very welcome. Thank you for checking out my wiki. I was hoping it didn't have anything to do with EFI.
You should be able to get a screen just like the ones in my examples. And control the default in /etc/default/grub with GRUB_DEFAULT=number
And what is great is you never have to change that unless you remove or add an OS. That the main purpose of this wiki to make it "maintenance free".

Here you can see the number to put there by entering this in terminal:


cavsfan@cavsfan-MS-7529:~$ grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0
0 menuentry "Precise Pangolin 12.04" {
1 menuentry "Precise Pangolin 12.04 (Recovery Mode)" {
2 menuentry "Quantal Quetzal 12.10" {
3 menuentry "Quantal Quetzal 12.10 (Recovery Mode)" {
4 menuentry "Raring Ringtail 13.04" {
5 menuentry "Raring Ringtail 13.04 (Recovery Mode)" {
6 menuentry "Saucy Salamander 13.10" {
7 menuentry "Saucy Salamander 13.10 (Recovery Mode)" {
8 menuentry "Trusty Tahr 14.04" {
9 menuentry "Trusty Tahr 14.04 (Recovery Mode)" {
10 menuentry "Linux Mint 13 Nadia" {
11 menuentry "Linux Mint 13 Nadia (Recovery Mode)" {
12 menuentry "Windows 7" {


I have mine set to Windows 7 (12) for my wife in case it reboots or something.

Good luck! :)

Cavsfan
January 9th, 2014, 10:10 PM
I just noticed that in Trusty Tahr 14.04 the font is in a different directory. So, to produce the font enter this:

sudo grub-mkfont --output=/boot/grub/DejaVuSansMono.pf2 \
--size=24 /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf

and it will still give these meaningless messages as before:

Unknown gsub font feature 0x63636d70 (ccmp)
Unknown gsub font feature 0x646c6967 (dlig)
Unsupported substitution flag: 0x9
Unsupported substitution flag: 0x9
Unknown gsub font feature 0x6c6f636c (locl)
Unknown gsub font feature 0x6c6f636c (locl)
Unsupported substitution flag: 0x9


The wiki will be updated when Trusty Tahr is at final release.

Cavsfan
January 9th, 2014, 10:55 PM
New picture on Trusty Tahr 14.04 with cyan as normal font colors and white as highlight.
grub-install (GRUB) 2.00-22

http://en.zimagez.com/miniature/grub2-20.jpg (http://en.zimagez.com/zimage/grub2-20.php)

Cavsfan
January 16th, 2014, 03:15 PM
Minimal

http://en.zimagez.com/miniature/20140115170656.jpg (http://en.zimagez.com/zimage/20140115170656.php)

Cavsfan
January 24th, 2014, 05:57 PM
Since Raring Ringtail Ubuntu 13.04 reaches it's End of Life Date on January 27th I am going to pull that part out of the wiki. https://lists.ubuntu.com/archives/ubuntu-security-announce/2014-January/002367.html
It shouldn't take too long. I hope this doesn't inconvenience any one.

Cavsfan
January 24th, 2014, 06:07 PM
I just left the pictures with Raring as examples. But, the Raring Ringtail part of the wiki is now gone.

Cavsfan
January 30th, 2014, 09:48 PM
Grub 2.2 beta on Trusty Tahr 14.04:

http://en.zimagez.com/miniature/20140130153140.jpg (http://en.zimagez.com/zimage/20140130153140.php)

Cavsfan
March 24th, 2014, 09:06 PM
New screenie on Trusty:

http://en.zimagez.com/miniature/20140324102316.jpg (http://en.zimagez.com/zimage/20140324102316.php)

It is a black cat but I believe the black is overwhelmed by the blue therefore it's more of a blue cat. :)

Cavsfan
April 17th, 2014, 03:55 PM
I just updated the wiki. I only changed editing /etc/grub.d/05_debian_theme.
I took out Quantal Quetzel 12.10 since it reaches EOL this month and added Trusty Tahr 14.04 as it was released today.

I left references to other version in it just for the examples. There is no real difference between Saucy Salamander 13.10 and Trusty Tahr 14.04.

Cheers :)

Cavsfan
May 1st, 2014, 08:49 PM
New screeny with Utopic Unicorn 14.10 added. Ironically this background is my Grub2 bootup screen, my login screen to Ubuntu Trusty Tahr 14.04 and my background on Trusty. :)

http://en.zimagez.com/miniature/20140501grub2.jpg (http://en.zimagez.com/zimage/20140501grub2.php)

Cavsfan
May 22nd, 2014, 09:25 PM
In Linux Mint 17 with the grub version that Trusty uses 2.02~beta2-9 they have an additional grub file /etc/grub.d/06_mint_theme which controls the font colors in the box around the menu as well as the menu itself.
That is if there is a picture in /boot/grub/. Or if there's no picture the font sizes and font colors will not be used and the screen will be as default.
You can either make it unexecutable - sudo chmod -x /etc/grub.d/06_mint_theme and put the fonts both normal and highlight in /etc/grub.d/05_debian_theme or you can tailor both to suit your needs.

Here I used both: making the highlight color in the menu red and leaving the normal color white and in 05_debian_theme, which controls just the top and bottom in this case, I made it light-cyan and cyan.

http://en.zimagez.com/miniature/20140522151808.jpg (http://en.zimagez.com/zimage/20140522151808.php)

Cavsfan
June 29th, 2014, 05:33 PM
Since systemd comes installed on Utopic Unicorn 14.10 (development release) I included a line to boot using systemd instead of the default upstart.

http://en.zimagez.com/miniature/20140629115939.jpg (http://en.zimagez.com/zimage/20140629115939.php)

I added this option in /etc/grub.d/06_custom:

menuentry "Utopic Unicorn 14.10 systemd (Devel Branch)" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro quiet splash init=/lib/systemd/systemd
initrd /initrd.img
}

Just change what is in red to match the partion your Utopic install is on; mine is on hard disk 1, partition 5.

I also changed the green line in my signature to point to this thread as the 1st post has the link to the actual wiki. I thought that would be easier.
Systemd seems to have better bootup times and is possibly a little more stable YMMV.

Cavsfan
July 27th, 2014, 05:46 PM
I just updated the Community Wiki by removing Quantal Quetzal 12.10, Raring Ringtail 13.04 and Saucy Salamander 13.10 as they are no longer supported.
I also added Trusty Tahr 14.04, Mint 13 Maya and Mint 17 Quina to the 06_custom file. I just need to update the pictures now.

Plus I changed the link in my signature a while back to point to this thread. You can get to the Wiki via the green link in the 1st post of this thread.
I thought that would make it simpler.

Taal_Mahret
August 9th, 2014, 07:23 PM
I noticed a few screenshots on google image search that show the menu itself moved from its default screen location. Is this manually configurable or can programs such as grub customizer do this as well?

Cavsfan
August 9th, 2014, 08:15 PM
I noticed a few screenshots on google image search that show the menu itself moved from its default screen location. Is this manually configurable or can programs such as grub customizer do this as well?

I do not know of any way to move the menu from it's default location. The font size can be changed but I haven't even tried that.
Here is where I got the font command to make the font for grub: http://ubuntuforums.org/showthread.php?t=1195275&page=29&p=8764581#post8764581
I believe I have seen when the menu is longer than the screen size that it is scrollable.

See the FYI at the bottom about the --size= part. I'm not familiar with grub customizer either so I couldn't say what it can or can't do.

It might be that this was on another Linux OS besides Ubuntu or Mint. Mint 17 Qiana comes with a /etc/grub.d/06_mint_theme file which has the font colors for the menu and the highlighted option.
Ubuntu only uses special font colors if a picture is found in /boot/grub/ also where the font exists after it is created.

Cavsfan
August 28th, 2014, 06:19 PM
You tell me which is better this - default:
http://en.zimagez.com/miniature/defaultgrub.jpg (http://en.zimagez.com/zimage/defaultgrub.php)

Or this - custom:
http://en.zimagez.com/miniature/customgrub.jpg (http://en.zimagez.com/zimage/customgrub.php)

I had to customize it just to get it to let me login to anything other than the top option Utopic Mate 14.10.
When I tried the bottom Linux Mint 17 on the default grub, which says it's on sda8 and it is. It took me to a Mint 17 screen with 4 dots that would never go to the login screen.
So finally I pressed Alt+Cntl+F1 to login CLI and when I did it displayed 12.04.5 :p.
I installed the grub while I was there sudo grub-install /dev/sda and then sudo reboot and sure enough the grub was on Precise 12.04.5.

That allowed me to boot to Mint 17 and install the grub there which is what the 2nd picture is.

I just don't see how the default even works when you have multiple systems on the computer. I have 7 right now.
I even checked the /etc/fstab file on both systems and it was correct.

Bashing-om
August 28th, 2014, 07:38 PM
Cavsfan; Hi ! once more;

I do prefer the "customised" version.
I to continue to struggle with how I prefer to boot multiple operating systems across multiple hard drives. It is a learning process and I do make up some interesting situations.
When all said and done, your method is the more pleasing and easy-ist to maintain.

My contemplated next adventure is booting 14.10 from .iso in grub.




oh happy days

Cavsfan
August 28th, 2014, 11:23 PM
Cavsfan; Hi ! once more;

I do prefer the "customised" version.
I to continue to struggle with how I prefer to boot multiple operating systems across multiple hard drives. It is a learning process and I do make up some interesting situations.
When all said and done, your method is the more pleasing and easy-ist to maintain.

My contemplated next adventure is booting 14.10 from .iso in grub.


oh happy days





Hi! Thanks for the kind words! :D I didn't think anyone would answer that question.
I never came up with this idea. I got it from Ranch Hand and then Drs305 helped out a lot too. Ranch hand told me how to do it and it took me probably a month or two before I understood it enough to try it.
Then the more I looked at it the easier it got. I still have to refer the the Wiki but a lot is in memory.

When I noticed what I stated at the bottom of my post about trying to get to Mint 17 via the default and it "looked like Mint 17" but was really Precise 12.04 pretty much cinches the whole proposition.
When it comes down to it since grub has evolved there is very little that you have to do. Making the initial 06_custom file would be the biggest challenge me thinks.

But drop a picture into /boot/grub and when grub finds it there it uses the picture and special fonts with the colors. It has to be the simplest and fault free method out there.

Good luck on that next adventure! :D

fantab
September 16th, 2014, 06:52 AM
Is it possible to create a 'sub-menu' in 40_custom?

oldfred
September 16th, 2014, 03:12 PM
I have not tried a sub-menu, but back to help from drs305

Grub 1.99 Submenus
http://ubuntuforums.org/showthread.php?t=1739336h



@bashing-om

menuentry "Ubuntu 14.10 Utopic ISO 64bit Daily" {
set isofile="/iso/utopic-desktop-amd64.iso"
insmod part_gpt
loopback loop (hd2,4)$isofile
linux (loop)/casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=$isofile nomodeset
initrd (loop)/casper/initrd.lz
}


Note I have mulitiple drives and the grub I boot is always hd0, and the drive I then have my ISO folder on is hd2 and happens to be gpt partitioned so I have to tell it that. You may have to use msdos.

Also hidden away in one of drs305's mega-threads on booting was the reference to using configfile in grub. So I use that in my grub 40_custom and create a configfile menu entry in the ISO folder.

I added this to the top as my own reminder (in 40_custom without #):

# Add this to 40_custom to load this file:
# menuentry 'Live ISOs' {
# configfile (hd2,4)/iso/livecdimage.cfg
# }

I really like configfile, as every time I would edit 40_custom I would forget the sudo update-grub and have to reboot again. Editing text file livecdimage.cfg is just auto loaded with changes.

Cavsfan
September 16th, 2014, 06:30 PM
Is it possible to create a 'sub-menu' in 40_custom?

I have never tried to create a sub-menu; never seen a reason to. The wiki says to save 40_custom as 06_custom so it appears on the very top whether 10_linux, 20_memtest86+ and 30_os-prober are executable or not.

It will only boot to the latest installed kernel. If you wanted to boot to an older kernel you would need to install grub on that partition and make 10_linux executable.
Here is my 06_custom file (I can boot to Utopic 14.10 and Utopic Mate 14.10 with upstart or systemd just by selecting the menu option for it):


#!/bin/sh
echo 1>&2 "Adding Precise Pangolin 12.04, Trusty Tahr 14.04, Utopic Unicorn 14.10, Utopic Unicorn 14.10 Mate, Mint 13 Nadia, Mint 17 Quina and Windows 7"
exec tail -n +4 $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 "Precise Pangolin 12.04 LTS" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro quiet splash
initrd /initrd.img
}
menuentry "Precise Pangolin 12.04 LTS (Recovery Mode)" {
set root=(hd0,2)
linux /vmlinuz root=/dev/sda2 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Trusty Tahr 14.04 LTS" {
set root=(hd0,6)
linux /vmlinuz root=/dev/sda6 ro quiet splash
initrd /initrd.img
}
menuentry "Trusty Tahr 14.04 LTS (Recovery Mode)" {
set root=(hd0,6)
linux /vmlinuz root=/dev/sda6 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Utopic Unicorn 14.10 (devel branch)" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro quiet splash
initrd /initrd.img
}
menuentry "Utopic Unicorn 14.10 systemd (Devel Branch)" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro quiet splash init=/lib/systemd/systemd
initrd /initrd.img
}
menuentry "Utopic Unicorn 14.10 (devel branch) (Recovery Mode)" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Utopic Unicorn 14.10 Mate (devel branch)" {
set root=(hd0,9)
linux /vmlinuz root=/dev/sda9 ro quiet splash
initrd /initrd.img
}
menuentry "Utopic Unicorn 14.10 Mate systemd (Devel Branch)" {
set root=(hd0,9)
linux /vmlinuz root=/dev/sda9 ro quiet splash init=/lib/systemd/systemd
initrd /initrd.img
}
menuentry "Utopic Unicorn 14.10 Mate (devel branch) (Recovery Mode)" {
set root=(hd0,9)
linux /vmlinuz root=/dev/sda9 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Mint 13 Nadia" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro quiet splash
initrd /initrd.img
}
menuentry "Mint 13 Nadia (Recovery Mode)" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Mint 17 Qiana LTS" {
set root=(hd0,8)
linux /vmlinuz root=/dev/sda8 ro quiet splash
initrd /initrd.img
}
menuentry "Mint 17 Qiana LTS (Recovery Mode)" {
set root=(hd0,8)
linux /vmlinuz root=/dev/sda8 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Windows 7" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 1CFC7A8DFC7A60C6
chainloader +1
}

You can see a picture of what it looks like a few posts back. I have my grub installed on Mint 17 Quina because it has a 06_mint_theme file to make the box around the menu and the menu itself a different color than the top and bottom.
On Ubuntu you can only have 2 colors.

You could leave it as is but without adding the 2nd echo line (above) that you control, and leave the +3 instead of changing it to +4 but then you will only see this when you update grub:
The echo line is meant just for listing the contents of 06_custom and is for your benefit only.
(The +3 says to start execution at the 3rd line down, the +4 says to start execution at the 4th line down). This I learned from Drs305.


cavsfan@cavsfan-MS-7529:~$ sudo update-grub
[sudo] password for cavsfan:
Generating grub configuration file ...
Found background image: Nobody_likes_me.jpg
done

40_custom file as default:


#!/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.

fantab
September 17th, 2014, 04:49 AM
I have never tried to create a sub-menu; never seen a reason to.

I want to create two submenus: one to put all Ubuntu stuff, like 'Previous linux', 'Recovery' (I have both 14.04 & 14.10(devel). I was thinking of only one submenu for both versions of ubuntu...
And one submenu for 'utilities' like, memtest, isos, and knoppix.
Just to keep the main menu as consise as possible.

By the way, I use grub from Archlinux. I have not added Arch entries to 40_custom.. and this gives me a 'submenu' for Arch...
I don't have os-prober installed. If I install it I will have two Ubuntu submenus for each version. I want only one submenu for both. And I'd still need one for 'utilities'.
Since it is difficult to NOT install grub with Ubuntu install, I have Ubuntu grubs in PBR. All my HDDs are 'msdos' still.

I tested adding a submenu but it didn't work:


submenu 'Ubuntu 14.04 - Recovery
menuentry 'Ubuntu 14.04 - Previous
insmod gzio
insmod part_msdos
insmod ext2
set root=(hd1,msdos2)
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hin$
linux /boot/vmlinuz-3.13.0-35-generic root=UUID=94797b8a-xxxx-4x6c-8xc8-be93axxxxxdb ro $
initrd /boot/initrd.img-3.13.0-35-generic

which results in:


$ update-grub
Generating grub configuration file ...
Found background: /boot/grub/grubbg5.png
Found linux image: /boot/vmlinuz-linux-lts
Found initrd image: /boot/initramfs-linux-lts.img
Found fallback initramfs image: /boot/initramfs-linux-lts-fallback.img
error: $.
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 204
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

I have searched the net but I haven't found anything meaningful regarding creating submenu in 40_custom.
So I wondered if it is even possible to have one... However the following had made me optimistic:


submenu "My ISOs" {
menuentry "Natty_test.iso
isofile=natty-desktop-amd64.iso
loopback loop (hd1,6)/iso/$isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/iso/$isofile noprompt noeject
initrd (loop)/casper/initrd.lz
}
menuentry 'ISO SystemRescue sdb5-vm' {
isofile=systemrescuecd-x86-2.0.1.iso
loopback loop (hd1,5)/$isofile
linux (loop)/isolinux/rescue64 setkmap=us isoloop=/$isofile
initrd (loop)/isolinux/initram.igz
}


I'll have to explore this more on the weekend perhaps....

Regards

oldfred
September 17th, 2014, 05:46 AM
Instead of sub menu I use the configfile. That becomes one permanent entry in 40_custom. And then the file in another location looks like standard grub entries but is just a file.

See #232 above.

Or search for configfile in this long thread.
http://ubuntuforums.org/archive/index.php/t-1549847.html

Cavsfan
September 17th, 2014, 04:48 PM
I want to create two submenus: one to put all Ubuntu stuff, like 'Previous linux', 'Recovery' (I have both 14.04 & 14.10(devel). I was thinking of only one submenu for both versions of ubuntu...
And one submenu for 'utilities' like, memtest, isos, and knoppix.
Just to keep the main menu as consise as possible.


Instead of sub menu I use the configfile. That becomes one permanent entry in 40_custom. And then the file in another location looks like standard grub entries but is just a file.

See #232 above.

Or search for configfile in this long thread.
http://ubuntuforums.org/archive/index.php/t-1549847.html

I'm not sure how to create submenus nor do I wish to include them in this wiki if a way is found to create them.
Again this wiki is about keeping it simple and saving 40_custom as 06_custom.
But good luck in your pursuits. :)

A few posts back it was proven to me that when you install several systems (I have 7) the default grub does not work very well.
I selected Linux Mint 17 Qiana at the bottom on /dev/sda8, which was correct and the screen went to display Mint 17 with the dots moving across the screen till the cows came home. :p
I had to press Cntl+Alt+F1 to login to tty and then seen I was in Precise which I cannot explain.
I have one swap file and the /etc/fstab entries were all correct. I literally had to install grub on Precise (that is customized) just to get it to boot to the OS I wanted.

Then I was able to get to Mint 17 Qiana to install it there.

oldfred
September 17th, 2014, 05:09 PM
Os-prober finds 10 Ubuntu and XP in my system and I do not have any issues with grub.

But I have to turn off os-prober as soon as I install or it takes forever as it has to scan 4 drives and all those installs. I do have different grub boot loaders in every MBR, but default boot from SSD and now 14.04. Many of the installs are obsolete, but I do not currently need space and just overwrite an old install with a new one when I want to test something.

But grub does remember where it was originally installed and will reinstall to that location on a major update.
#To see what drive grub2 uses see this line - grub-pc/install_devices:
sudo debconf-show grub-pc

Cavsfan
September 17th, 2014, 08:41 PM
Os-prober finds 10 Ubuntu and XP in my system and I do not have any issues with grub.

But I have to turn off os-prober as soon as I install or it takes forever as it has to scan 4 drives and all those installs. I do have different grub boot loaders in every MBR, but default boot from SSD and now 14.04. Many of the installs are obsolete, but I do not currently need space and just overwrite an old install with a new one when I want to test something.

But grub does remember where it was originally installed and will reinstall to that location on a major update.
#To see what drive grub2 uses see this line - grub-pc/install_devices:
sudo debconf-show grub-pc

Edit: Duh me! It does tell the hard drive but I only have one. The other is a USB drive that I use to backup stuff to. This renders much of what I've posted moot. #-o

That's odd as I cannot use the default grub. I don't think I tried booting to windows 7 via 30_os-prober but the Linux systems were incorrect although I didn't test each of them.
One was proof enough for me to get back into one of the customized grubs because I know they work. (I wish I had an SSD, hopefully on my next system.)

I'm not sure about that command. Here is what it output:

cavsfan@cavsfan-MS-7529:~$ sudo debconf-show grub-pc
[sudo] password for cavsfan:
grub-pc/mixed_legacy_and_grub2: true
grub2/kfreebsd_cmdline:
grub2/linux_cmdline_default: quiet splash
grub-pc/install_devices_failed_upgrade: true
grub2/linux_cmdline:
grub-pc/timeout: 10
grub-pc/disk_description:
grub-pc/postrm_purge_boot_grub: false
grub-pc/install_devices_failed: false
grub2/device_map_regenerated:
grub-pc/kopt_extracted: false
grub2/kfreebsd_cmdline_default: quiet splash
grub-pc/chainload_from_menu.lst: true
grub-pc/install_devices_disks_changed:
grub-pc/hidden_timeout: true
grub-pc/install_devices_empty: false
* grub-pc/install_devices: /dev/disk/by-id/ata-WDC_WD5003ABYX-01WERA2_WD-WMAYP6803321
grub-pc/partition_description:

I cannot tell what /dev/disk/by-id/ata-WDC_WD5003ABYX-01WERA2_WD-WMAYP6803321 is. But, it looks like some sort of identifier of my entire 500GB drive.
It is a Western Digital WD RE4 WD5003ABYX 500GB 7200 RPM hard drive.

cavsfan@cavsfan-MS-7529:~$ sudo blkid
/dev/sda1: LABEL="C:" UUID="1CFC7A8DFC7A60C6" TYPE="ntfs" PARTUUID="a55f55ec-01"
/dev/sda2: LABEL="Precise" UUID="a162dc8a-e4df-4b79-b4c3-524761ff7ae1" TYPE="ext4" PTTYPE="dos" PARTUUID="a55f55ec-02"
/dev/sda3: UUID="e14dc02e-6ea8-4c95-b4d0-9dc04d32294d" TYPE="swap" PARTUUID="a55f55ec-03"
/dev/sda5: LABEL="Utopic" UUID="7c76d1de-7439-4b55-b587-898f104235da" TYPE="ext4" PARTUUID="a55f55ec-05"
/dev/sda6: LABEL="Trusty" UUID="d3281f82-3582-4081-b4d7-4769a2f427c5" TYPE="ext4" PARTUUID="a55f55ec-06"
/dev/sda7: LABEL="Mint-Maya" UUID="77cf61db-2e8b-4531-9594-80f35ad4dc69" TYPE="ext4" PARTUUID="a55f55ec-07"
/dev/sda8: LABEL="Mint-Quina" UUID="673f25f0-6149-4da7-98f8-4ebfe08a2188" TYPE="ext4" PARTUUID="a55f55ec-08"
/dev/sda9: LABEL="Utopic-Mate" UUID="9c1694e3-0a35-4cf2-9c74-4103abce882f" TYPE="ext4" PARTUUID="a55f55ec-09"
/dev/sdb1: LABEL="Fantom" UUID="78B8D1A1B8D15DE6" TYPE="ntfs" PARTUUID="f87b4c9a-01"

Grub was initially installed on the partition that Precise is on. Then with Drs305's help and as I gained knowledge about all of this I added more logical partitions.
On my system whenever grub is updated to a newer version it installs the grub on the partition that is being updated and updates it there but does not touch any other install.
I then boot into the one I want my grub installed and install it there.

Whenever I have had any grub update it installs to the partition that I am currently on. I have never seen it install to a different partition and I don't see how it could.

And as far as submenus and booting to a previous kernel etc. we have already been through that. I got one to work with the newest kernel and one for the previous kernel.
But since this is using symlinks as soon as a new kernel was installed it messed up. So, I dropped that idea.

That is why I say I'm not venturing into that territory because this wiki about customizing the grub menu is meant to keep it simple.
I think that was Ranch Hand's intention. I got his OK before I created the first how to and then the wiki.

oldfred
September 17th, 2014, 09:49 PM
Since partitions & UUIDs change the install drive is the model & serial number of the drive.
And one or two that posted with installs to partitions showed p1 or p2 for which partition grub was then installed into.
And each and every install may have the same entry, and on grub updates that grub is then installed to MBR. As long as only your working install has the MBR you are ok.

You can in other installs blank out the entry with this, just un-select all entries:
#to get grub2 to remember where to reinstall on updates:
sudo dpkg-reconfigure grub-pc or dpkg-reconfigure grub-efi-amd64
#Enter thru first pages,spacebar to choose/unchoose drive, tab & enter to accept, do not normally choose partitions
http://ubuntuforums.org/showthread.php?t=2189643

Cavsfan
September 17th, 2014, 10:01 PM
Since partitions & UUIDs change the install drive is the model & serial number of the drive.
And one or two that posted with installs to partitions showed p1 or p2 for which partition grub was then installed into.
And each and every install may have the same entry, and on grub updates that grub is then installed to MBR. As long as only your working install has the MBR you are ok.

You can in other installs blank out the entry with this, just un-select all entries:
#to get grub2 to remember where to reinstall on updates:
sudo dpkg-reconfigure grub-pc or dpkg-reconfigure grub-efi-amd64
#Enter thru first pages,spacebar to choose/unchoose drive, tab & enter to accept, do not normally choose partitions
http://ubuntuforums.org/showthread.php?t=2189643

I'm sorry but I think maybe I spouted to much and posted it before I realized what you were really saying.
I only have one hard drive, so there is no problem here. It remains on that hard drive.
Although for about 3-4 versions of Ubuntu I had to turn my USB drive off or it would either hang forever or try to install grub to that drive.
I think that problem was solved when I installed Trusty; I didn't even have to turn the USB drive off and it wanted to install to sda which is what I wanted.
So, I guess they have made improvements.

fantab
September 18th, 2014, 05:35 AM
I got it.

Here:


submenu 'Ubuntu 14.04 - options' $menuentry_id_option 'gnulinux-advanced-947xxxxx-610f-4xxx-87c8-bexxxxx0eedb' {
menuentry 'Ubuntu 14.04 - Previous' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-35-generic-advanced-947xxxxx-610f-4xxx-87c8-bexxxxx0eedb' {
insmod gzio
insmod part_msdos
insmod ext2
set root=(hd1,msdos2)
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2 947xxxxx-610f-4xxx-87c8-bexxxxx0eedb
linux /boot/vmlinuz-3.13.0-35-generic root=UUID=947xxxxx-610f-4xxx-87c8-bexxxxx0eedb ro
initrd /boot/initrd.img-3.13.0-35-generic
}
menuentry 'Ubuntu 14.04 - Recovery' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-35-generic-advanced-947xxxxx-610f-4xxx-87c8-bexxxxx0eedb' {
insmod gzio
insmod part_msdos
insmod ext2
set root=(hd1,msdos2)
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2 947xxxxx-610f-4xxx-87c8-bexxxxx0eedb
linux /boot/vmlinuz-3.13.0-35-generic root=UUID=947xxxxx-610f-4xxx-87c8-bexxxxx0eedb ro recovery nomodeset
initrd /boot/initrd.img-3.13.0-35-generic
}
}


I was not adding the --class... and there were some syntax errors which I corrected from relooking a grub.cfg in Ubuntu and grub manual:

submenu title [--class=class …] [--users=users] [--unrestricted] [--hotkey=key] { menu entries … }
I have discovered one more thing... 'update-grub' was also including entries from /etc/grub.d/40_custom.bak and I ended up with dual entries from both 40_custom and 40_custom.bak...
I removed 40_custom.bak from /etc/grub.d and grub menu looks great.
I'll post a screenshot soon.

oldfred
September 18th, 2014, 02:15 PM
Grub processes any file starting with two digits and an underscore that is executeable.
Either turn execute bit off or put bak at beginning of name. Then you can keep it it /etc/grub.d if you want.

I keep my backups & copies of 40_custom in a folder in /home so my rsync backup of /home automatically gets that file also.

Cavsfan
September 18th, 2014, 05:35 PM
I got it.

Here:


submenu 'Ubuntu 14.04 - options' $menuentry_id_option 'gnulinux-advanced-947xxxxx-610f-4xxx-87c8-bexxxxx0eedb' {
menuentry 'Ubuntu 14.04 - Previous' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-35-generic-advanced-947xxxxx-610f-4xxx-87c8-bexxxxx0eedb' {
insmod gzio
insmod part_msdos
insmod ext2
set root=(hd1,msdos2)
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2 947xxxxx-610f-4xxx-87c8-bexxxxx0eedb
linux /boot/vmlinuz-3.13.0-35-generic root=UUID=947xxxxx-610f-4xxx-87c8-bexxxxx0eedb ro
initrd /boot/initrd.img-3.13.0-35-generic
}
menuentry 'Ubuntu 14.04 - Recovery' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-35-generic-advanced-947xxxxx-610f-4xxx-87c8-bexxxxx0eedb' {
insmod gzio
insmod part_msdos
insmod ext2
set root=(hd1,msdos2)
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2 947xxxxx-610f-4xxx-87c8-bexxxxx0eedb
linux /boot/vmlinuz-3.13.0-35-generic root=UUID=947xxxxx-610f-4xxx-87c8-bexxxxx0eedb ro recovery nomodeset
initrd /boot/initrd.img-3.13.0-35-generic
}
}


I was not adding the --class... and there were some syntax errors which I corrected from relooking a grub.cfg in Ubuntu and grub manual:

submenu title [--class=class …] [--users=users] [--unrestricted] [--hotkey=key] { menu entries … }
I have discovered one more thing... 'update-grub' was also including entries from /etc/grub.d/40_custom.bak and I ended up with dual entries from both 40_custom and 40_custom.bak...
I removed 40_custom.bak from /etc/grub.d and grub menu looks great.
I'll post a screenshot soon.

I cannot see that being maintenance free. You have hard coded the kernel numbers and I believe the UUIDs. You will have to change it every time a new kernel gets installed.
So that would seem to defeat the purpose of this wiki which is: once you make the changes you never have to touch grub again unless you install another system on another partition or remove one.

Oldfred is right all you have to do is sudo chmod -x <file-name> to make it unexecutable and then sudo update-grub of course and it will be taken out of the mix.

When you enter this in terminal the green files will be the executable ones.


cavsfan@cavsfan-MS-7529:~$ ls -l /etc/grub.d/*
-rwxr-xr-x 1 root root 9424 Jan 29 2014 /etc/grub.d/00_header
-rwxr-xr-x 1 root root 6141 Apr 1 17:21 /etc/grub.d/05_debian_theme
-rwxr-xr-x 1 root root 2752 Sep 16 09:38 /etc/grub.d/06_custom
-rw-r--r-- 1 root root 11611 Jul 24 13:39 /etc/grub.d/10_linux
-rwxr-xr-x 1 root root 10418 Jul 24 13:39 /etc/grub.d/20_linux_xen
-rw-r--r-- 1 root root 1992 Mar 6 2014 /etc/grub.d/20_memtest86+
-rw-r--r-- 1 root root 11692 Apr 11 06:51 /etc/grub.d/30_os-prober
-rwxr-xr-x 1 root root 1416 Jan 29 2014 /etc/grub.d/30_uefi-firmware
-rwxr-xr-x 1 root root 214 Jan 29 2014 /etc/grub.d/40_custom
-rwxr-xr-x 1 root root 216 Jan 29 2014 /etc/grub.d/41_custom
-rw-r--r-- 1 root root 483 Jan 29 2014 /etc/grub.d/README

Let us know how it goes as new kernels are added.

fantab
September 22nd, 2014, 12:26 PM
I cannot see that being maintenance free. You have hard coded the kernel numbers and I believe the UUIDs. You will have to change it every time a new kernel gets installed.


menuentry 'Ubuntu 14.04 (sdb2)' {
insmod gzio
insmod part_msdos
insmod ext2
set root=(hd1,msdos2)
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2 /dev/sdb2
linux /vmlinuz root=/dev/sdb2 ro quiet splash $vt_handoff
initrd /initrd.img
}

submenu 'Ubuntu 14.04 - options' $menuentry_id_option 'gnulinux-advanced-/dev/sdb2' {
menuentry 'Ubuntu 14.04 - Previous' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-35-generic-advanced-/dev/sdb2' {
insmod gzio
insmod part_msdos
insmod ext2
set root=(hd1,msdos2)
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2 /dev/sdb2
linux /boot/vmlinuz-3.13.0-35-generic root=/dev/sdb2 ro
initrd /boot/initrd.img-3.13.0-35-generic
}
menuentry 'Ubuntu 14.04 - Recovery' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux advanced-/dev/sdb2' {
insmod gzio
insmod part_msdos
insmod ext2
set root=(hd1,msdos2)
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2 /dev/sdb2
linux /vmlinuz root=/dev/sdb2 ro recovery nomodeset
initrd /initrd.img
}
}

menuentry "Windows 7 Ultimate (sda1)" {
insmod part_msdos
insmod ntfs
insmod search_fs_uuid
insmod ntldr
search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 A4387A7C387A4D74
ntldr /bootmgr
}

submenu 'ISO & Utilities' $menuentry_id_option 'gnulinux-advanced-/dev/sdb3' {
menuentry 'LMDE-201403-cinnamon-dvd-64bit' {
set isofile='/boot/iso/linuxmint-201403-cinnamon-dvd-64bit.iso'
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live config fromiso=/dev/sdb3/$isofile
initrd (loop)/live/initrd.img
}
menuentry "GParted Live" {
set isofile="/boot/iso/gparted-live-0.19.1-4-amd64.iso"
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live config union=aufs noswap noprompt ip=frommedia toram=filesystem.squashfs findiso=$isofile
initrd (loop)/live/initrd.img
}
}

menuentry "System shutdown" {
echo "System shutting down..."
halt
}

menuentry "System restart" {
echo "System rebooting..."
reboot
}



I prefer to use UUIDS... and its working either ways... Any particular reason why hard coding UUIDS is not recommended?

The only entry that is not working as expected is the "System shutdown"....
When I try to shutdown the echo message is displayed and thats it, It just sits there. Any ideas?

Edit: added 'Gparted Live' to the 40_custom.

oldfred
September 22nd, 2014, 03:39 PM
I think maintenance free would be no hard coded kernels and just using links.

And I think UUIDs would be better, but I have used device. And devices do give me issues. I skipped a port when installing drives. So drive that is sda is always sda, but if I plug in a flash drive it is sde, but when I reboot the flash drive is sdb and every other drive has moved one letter. UUIDs have not changed.
And which drive's version of grub I boot from is always hd0, so that can change drive order, so I cannot just copy a 40_custom into every install or have to pay attention to which drive grub is installed into.
Basically why I usually suggest grub be on same drive as its install, just for consistency.

Cavsfan
September 23rd, 2014, 07:43 PM
menuentry 'Ubuntu 14.04 (sdb2)' {
insmod gzio
insmod part_msdos
insmod ext2
set root=(hd1,msdos2)
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2 /dev/sdb2
linux /vmlinuz root=/dev/sdb2 ro quiet splash $vt_handoff
initrd /initrd.img
}

submenu 'Ubuntu 14.04 - options' $menuentry_id_option 'gnulinux-advanced-/dev/sdb2' {
menuentry 'Ubuntu 14.04 - Previous' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-35-generic-advanced-/dev/sdb2' {
insmod gzio
insmod part_msdos
insmod ext2
set root=(hd1,msdos2)
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2 /dev/sdb2
linux /boot/vmlinuz-3.13.0-35-generic root=/dev/sdb2 ro
initrd /boot/initrd.img-3.13.0-35-generic
}
menuentry 'Ubuntu 14.04 - Recovery' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux advanced-/dev/sdb2' {
insmod gzio
insmod part_msdos
insmod ext2
set root=(hd1,msdos2)
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2 /dev/sdb2
linux /vmlinuz root=/dev/sdb2 ro recovery nomodeset
initrd /initrd.img
}
}

menuentry "Windows 7 Ultimate (sda1)" {
insmod part_msdos
insmod ntfs
insmod search_fs_uuid
insmod ntldr
search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 A4387A7C387A4D74
ntldr /bootmgr
}

submenu 'ISO & Utilities' $menuentry_id_option 'gnulinux-advanced-/dev/sdb3' {
menuentry 'LMDE-201403-cinnamon-dvd-64bit' {
set isofile='/boot/iso/linuxmint-201403-cinnamon-dvd-64bit.iso'
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live config fromiso=/dev/sdb3/$isofile
initrd (loop)/live/initrd.img
}
menuentry "GParted Live" {
set isofile="/boot/iso/gparted-live-0.19.1-4-amd64.iso"
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live config union=aufs noswap noprompt ip=frommedia toram=filesystem.squashfs findiso=$isofile
initrd (loop)/live/initrd.img
}
}

menuentry "System shutdown" {
echo "System shutting down..."
halt
}

menuentry "System restart" {
echo "System rebooting..."
reboot
}



I prefer to use UUIDS... and its working either ways... Any particular reason why hard coding UUIDS is not recommended?

The only entry that is not working as expected is the "System shutdown"....
When I try to shutdown the echo message is displayed and thats it, It just sits there. Any ideas?

Edit: added 'Gparted Live' to the 40_custom.

I agree with Oldfred UUIDs do not change so that part is good but, you have a hardcoded kernel version and that will bomb when a new kernel is installed.
Unless of course you edit the file every time a new kernel is added. Which goes against the purpose of this Wiki ===> once you create it, you never have to touch it again... ever... period.

The only time you should ever have to edit the custom file is if you add or remove a system.

Why not do a shutdown from within 14.04? I've never added a menu line to shutdown myself. It's a boot up menu.

Time will tell. Get back to us when a new kernel is added and let us know if this still works without editing it. ;)

Cavsfan
September 23rd, 2014, 07:48 PM
For the last several days I have been trying to come up with a way to add the custom grub menu to Utopic Mate Remix 14.10 but had been hitting roadblocks at every turn.
It would not see the background picture or the font colors; only the bigger font size. Which by itself was kind of cool but still not what I wanted.

I think I may have tamed the beast though and will post the results in the near future. :)

fantab
September 24th, 2014, 04:17 AM
...you have a hardcoded kernel version
How else can we set up a previous kernel boot without mentioning/hardcoding the previous working kernel?
My present 'Ubuntu 14.04 - Previous' entry shows the present kernel as I don't yet have an older kernel- I had removed those earlier.

As for the 'Shutdown' entry... It comes in handy if by mistake I 'restart' when I actually wanted to shutdown... The shutdown entry would help me shutdown from the grub itself, which otherwise I had to do it from the Lightdm-greeter.

Cavsfan
September 24th, 2014, 08:34 PM
How else can we set up a previous kernel boot without mentioning/hardcoding the previous working kernel?
My present 'Ubuntu 14.04 - Previous' entry shows the present kernel as I don't yet have an older kernel- I had removed those earlier.

As for the 'Shutdown' entry... It comes in handy if by mistake I 'restart' when I actually wanted to shutdown... The shutdown entry would help me shutdown from the grub itself, which otherwise I had to do it from the Lightdm-greeter.

The necessity to edit grub every time a new kernel is added defeats the whole purpose of this Community Wiki. This Wiki is all about making the changes and never no matter what needing to change a single thing.
Let me give you a little background: Sometime before July 30th, 2010 I had been talking to Ranch Hand on this forum. He was very knowledgeable about grub.

I explained to him that I was frustrated with having to edit the default line every time a new kernel got added. I like to have my default set to Windows 7 for my wife just in case the system reboots or something.
Windows 7 happens to be the last line on default grub and I would set that in /etc/default/grub but when a new kernel got added, the default line would move one up from Windows 7.
So, with every kernel I had to edit /etc/default/grub and that was a pain.
That is when he explained to me how to make this so that once you edit it you never have to touch it again.
I started with Ubuntu 9.04 Jaunty Jackalope and that was the first version we made a custom menu for. It looked ominous at first but the more I looked at it the simpler it became.

I have never once had to boot into an old kernel, but if I did I would boot into that Ubuntu and install grub there if it were not already installed on that partition.
Then I would enter sudo chmod +x /etc/grub.d/10_linux && sudo update grub and then reboot, do what ever required me to boot to the older kernel and then enter the same commands I just mentioned only with a plus sign instead of a minus sign.

I set my GRUB_TIMEOUT=60 in /etc/default/grub to give myself lots of time to choose what I'm going to do. I'm kind of slow sometimes or I may walk away and that provides extra time to do what I wanted to do.

But, hard coding anything that needs to be edited for any reason is what I got away from years ago.

You can do what you want. That is what is great about Ubuntu. You don't have to use this method; you could use grub-customizer or a variety of other options.
But, I only know this one method and it has worked great even now with Ubuntu Utopic 14.10 and so I'm sticking with it.

Cavsfan
September 24th, 2014, 09:15 PM
Man I did not realize how behind the times I am. :oops:

Even back on grub 1.99 you could set the font colors outside the box and have different colors for the box and everything inside the box.

All of this time I had been advocating going with a 2 color grub menu with this in /etc/grub.d/05_debian_theme:


echo " set color_normal=light-cyan/black"
echo " set color_highlight=cyan/black

When you could have this and go with 3 colors - one outside the box and a normal color for the box and a highlight color inside the box.


echo " set color_normal=cyan/black"
echo " set menu_color_normal=yellow/black"
echo " set menu_color_highlight=red/black"

I finally figured out how to do this in Ubuntu Utopic Mate remix 14.10 and it's not like the other versions at all. I will update the Wiki soon.

Here is the custom grub menu with the colors above on Mate:

http://en.zimagez.com/miniature/20140924143821.jpg (http://en.zimagez.com/zimage/20140924143821.php) http://en.zimagez.com/miniature/20140924143846.jpg (http://en.zimagez.com/zimage/20140924143846.php)

And here is one on Precise with grub 1.99:

http://en.zimagez.com/miniature/20140924125302.jpg (http://en.zimagez.com/zimage/20140924125302.php) http://en.zimagez.com/miniature/20140924125148.jpg (http://en.zimagez.com/zimage/20140924125148.php)


So, you can either go with 2 colors or 3 colors. :)