PDA

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



Pages : 1 [2] 3

Cavsfan
September 30th, 2014, 04:59 PM
Utopic Unicorn with grub version 2.02~beta2-14:

http://www.zimagez.com/miniature/20140930113614.jpg (http://www.zimagez.com/zimage/20140930113614.php)

I'll try to update the wiki as soon as I can. However sometimes real life interferes. ;)

Cavsfan
October 2nd, 2014, 07:16 PM
This has to be the coolest grub screen I've made so far or even seen. This is on Trusty.

The timeout is set to 60 seconds and I find myself looking at it for a while when it boots up just because it is so cool. :lol:

http://en.zimagez.com/miniature/20141001122252.jpg (http://en.zimagez.com/zimage/20141001122252.php)

fantab
October 17th, 2014, 04:24 AM
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"

So, you can either go with 2 colors or 3 colors. :)

Nice discovery Cavsfan! I have tried the three color menu and it works beautifully. Thanks.

A glitch: Remember I have created 'submenus'? Well, the three color menu scheme does not apply correctly to sub-menus on my system.

I have the following in 01_theme (I am testing this on Arch Linux):

set color_normal=light-red/black
set menu_color_normal=light-gray/black
set menu_color_highlight=light-red/black

However, when it enter a 'submenu' theme colors are as following:

set color_normal=light-red/black
set color_highlight=dark-gray/light-gray

EDIT:
Screenshot1 (http://i.imgur.com/7v4mFgw.jpg) (showing the three color menu).
Screenshot2 (http://i.imgur.com/S3JaSPv.jpg) (shows the glitch in submenu).
(My apologies for the bad picture quality but I hope you'll see what I am saying).

If I use the older two-color menu theme, the setting is applied uniformly to both menu and submenus, but NOT when three color scheme is applied.

Can you confirm this and offer a solution or a workaround?

Regards...

Cavsfan
October 17th, 2014, 03:31 PM
Nice discovery Cavsfan! I have tried the three color menu and it works beautifully. Thanks.

A glitch: Remember I have created 'submenus'? Well, the three color menu scheme does not apply correctly to sub-menus on my system.

I have the following in 01_theme (I am testing this on Arch Linux):

set color_normal=light-red/black
set menu_color_normal=light-gray/black
set menu_color_highlight=light-red/black

However, when it enter a 'submenu' theme colors are as following:

set color_normal=light-red/black
set color_highlight=dark-gray/light-gray

EDIT:
Screenshot1 (http://i.imgur.com/7v4mFgw.jpg) (showing the three color menu).
Screenshot2 (http://i.imgur.com/S3JaSPv.jpg) (shows the glitch in submenu).
(My apologies for the bad picture quality but I hope you'll see what I am saying).

If I use the older two-color menu theme, the setting is applied uniformly to both menu and submenus, but NOT when three color scheme is applied.

Can you confirm this and offer a solution or a workaround?

Regards...

I mentioned that I do not support the submenu concept. I would go with the 2 color theme if that is what works.
Feel free to figure out a solution on your own as submenus are not a part of this custom grub wiki.

Sorry, but adding submenus defeats the purpose of keeping the custom grub menu simple.

Regards

EDIT: You could look at the files in /etc/grub.d/ and see if one of them sets any additional font colors.
For example in Linux Mint there is a file /etc/grub.d/06_mint_theme that controls these font colors:

menu_color_normal
menu_color_highlight

If that file is executable and you have the 3 colors setup in /etc/grub.d/05_debian_theme, the menu colors in will overwritten by the colors that are defined in /etc/grub.d/06_mint_theme.

I'm not familiar with Arch Linux but it may be similar to Linux Mint.

fantab
October 18th, 2014, 03:38 AM
I mentioned that I do not support the submenu concept. I would go with the 2 color theme if that is what works.
Feel free to figure out a solution on your own as submenus are not a part of this custom grub wiki.

Sorry, but adding submenus defeats the purpose of keeping the custom grub menu simple.

Regards

EDIT: You could look at the files in /etc/grub.d/ and see if one of them sets any additional font colors.
For example in Linux Mint there is a file /etc/grub.d/06_mint_theme that controls these font colors:


If that file is executable and you have the 3 colors setup in /etc/grub.d/05_debian_theme, the menu colors in will overwritten by the colors that are defined in /etc/grub.d/06_mint_theme.

I'm not familiar with Arch Linux but it may be similar to Linux Mint. I am not trying spoil your wiki or its purpose.
(However I must add that having submenu is neither complicated nor does it need maintainence).

Thanks...

Cavsfan
October 18th, 2014, 04:10 PM
I am not trying spoil your wiki or its purpose.
(However I must add that having submenu is neither complicated nor does it need maintainence).

Thanks...

You may have misinterpreted my intentions. My wiki is not about having submenus but your not about to spoil it.
That is what is great about Ubuntu. Everyone can modify or adjust anything they want in Ubuntu.
You can take my idea or someone else's idea and modify it to suit your needs. It's all free here.

I did however provide some help in the Edit I posted. Did you find any additional grub files that could be setting that caused the third color to be wrong?

You did say
Can you confirm this and offer a solution or a workaround?

But as I've stated I don't work with submenus and cannot possibly over any solution or workaround for your problem. That was the gist of my point.

You can enter this in terminal to produce the output of grub as it is produced by the command sudo update-grub.


sudo grub-mkconfig
That will produce a listing in terminal. If that listing is too long in order to be able to scroll back to the beginning you can have the output be in text format so you can view it later.
This will put a text file, the name is of your choosing in your home directory of the output of the command:

sudo grub-mkconfig > textfile-name

That may help point you in the direction of where that color is being set.

Cavsfan
October 23rd, 2014, 05:31 PM
I finished updating the Community Wiki with several things I've wanted to add and some I've wanted to remove.

I also added Utopic Unicorn 14.10 and the ability to add custom lines to boot Utopic with Upstart (default) and Systemd.
(If you encounter any problems booting with systemd and need to file a bug report be sure to add tag systemd-boot to the bug).

If I've made any errors point them out and I will fix them.

Cavsfan
October 24th, 2014, 04:53 PM
It took me a long time, several days to figure out how to get Utopic Mate 14.10 to work with this custom grub menu.

In /etc/grub.d/05_debian_theme:

The first line below is line 165 and you place the 3 font colors after that line - nothing else will work.


if set_background_image "${background}"; then
echo " set color_normal=cyan/black"
echo " set menu_color_normal=yellow/black"
echo " set menu_color_highlight=red/black"

Also the font is in a different location for Mate here is the correct command to use only for Mate:


sudo grub-mkfont --output=/boot/grub/DejaVuSansMono.pf2 \
--size=24 /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf

These are the only differences between regular Ubuntu and Ubuntu Mate to get it to work.

Cavsfan
October 24th, 2014, 10:06 PM
Still haven't figured out how to get Utopic Mate working after installing it from a new ISO. I got the developmental version working fine.
The development system had this file which the final version doesn't have /etc/grub.d/99_force_text_mode. I tried copying it over but that didn't make the picture appear.

The font colors appear but they are a bit oversized. Still working on it.....

Cavsfan
October 25th, 2014, 04:00 PM
I finally figured out it was the font that prevented the picture from showing at boot. The font is in a different location than it is on regular Ubuntu or Mint, possibly others.
I added that to the other difference mentioned in post #258 (http://ubuntuforums.org/showthread.php?t=2076205&page=26&p=13150813#post13150813) above.

Here is what it looks like. Not too sure about the colors or the picture just wanted to prove that it could be done.

http://en.zimagez.com/miniature/20141025101442.jpg (http://en.zimagez.com/zimage/20141025101442.php)

Here is what the default grub menu looked like on Mint. And again initially I selected Mint Qiana 17 and it displayed the Qiana screen with the 4 green dots but would never go any where.
I brought up a tty screen and it showed I was in Precise 12.04.5.

http://en.zimagez.com/miniature/20141023145610.jpg (http://en.zimagez.com/zimage/20141023145610.php)

Cavsfan
November 3rd, 2014, 08:05 PM
I just added the things for Utopic Mate Remix 14.10 from post #258 to the wiki for the font creation command and the location where the font colors are specified.
I had a hard time finding a picture that would work. I think the first 3 I tried did not work but the 4th one did. So, if the picture does not show at boot, try another one.

Cavsfan
November 21st, 2014, 10:18 PM
Turns out when I specified things for only Utopic Mate, they were actually meant for Utopic period and I believe all versions afterwards.

The font is now in a different location and the font colors too. I'll try to correct that as soon as I can.

I just customized Vivid Gnome and it was the same as Utopic.

Cavsfan
November 21st, 2014, 10:27 PM
I went ahead and made the changes. Let me know if you find any errors. :)

Cavsfan
November 21st, 2014, 11:08 PM
A screenie of Vivid Vervet 15.04 grub with the following colors:

echo " set color_normal=red/black"
echo " set menu_color_normal=black/black"
echo " set menu_color_highlight=yellow/black"

http://en.zimagez.com/miniature/20141121165159.jpg (http://en.zimagez.com/zimage/20141121165159.php)

Cavsfan
December 22nd, 2014, 11:15 PM
A screenshot of my latest menu:

http://en.zimagez.com/miniature/20141222105041.jpg (http://en.zimagez.com/zimage/20141222105041.php)

It doesn't do justice looking at that picture compared to what the screen actually looks like. I'd have to use flash to get a better picture but that makes a big bright spot on the picture.

I got rid of a few systems: Mint 13 and Utopic Unicorn, leaving LTS versions, the developmental version Vivid Vervet 15.04 and of course windows.
I remember having one Ubuntu and Windows 7 on here. Having more than one is so much better as you can copy stuff back and forth across partitions.

I tried to put this blue circle picture on Precise but it would not work. I tried copying the one from that screen on Trusty and also downloaded a new one but neither would work.

All I got was the font sizes and black and white font colors. But when I did get one to work the background, the font colors and everything came together.

So a lot depends on that picture. Just because the output of sudo update-grub lists the picture name does not mean it will show at boot time.
Sometimes you just have to find another picture. Been there many times.

Cavsfan
December 23rd, 2014, 05:35 PM
Re-installed Vivid Vervet 15.04 on the 18th and got an update to grub today so I thought I'd customize it. The first picture I tried worked amazingly.

I used these colors:

echo " set color_normal=cyan/black"
echo " set menu_color_normal=black/black"
echo " set menu_color_highlight=red/black"

So, with black as the normal menu color it is hard to see in the picture but not really hard to see on the screen.

http://en.zimagez.com/miniature/20141223110606.jpg (http://en.zimagez.com/zimage/20141223110606.php)

Cavsfan
December 26th, 2014, 10:51 PM
A much better looking menu on Vivid, which is also my wallpaper:

http://www.zimagez.com/miniature/20141226135835.jpg (http://www.zimagez.com/zimage/20141226135835.php)

Colors:


echo " set color_normal=light-green/black"
echo " set menu_color_normal=yellow/black"
echo " set menu_color_highlight=white/black"

Cavsfan
January 16th, 2015, 06:54 PM
Ubuntu Vivid Vervet 15.04 is going to have upstart as the default startup daemon and systemd will be available as an option.

upstart description. (http://en.wikipedia.org/wiki/Upstart)

systemd description. (http://freedesktop.org/wiki/Software/systemd/)

Explanation of the difference between using upstart and systemd. (https://wiki.ubuntu.com/SystemdForUpstartUsers#High-level_startup_concept)

There is a way to make systemd default and upstart as the option permanently. (https://wiki.ubuntu.com/SystemdForUpstartUsers#Permanent_switch)

If you choose to make systemd default you have to remember to enter sudo update-grub after installing the systemd-sysv package.
Or else the change will not take effect until either the next kernel installation, which performs sudo update-grub or when you enter it in terminal.

If you leave upstart as default and want an option on your grub menu to boot with systemd this would be the menuentries in /etc/grub.d/06_custom:


menuentry "Vivid Vervet 15.04" {
set root=(hd0,9)
linux /vmlinuz root=/dev/sda9 ro quiet splash
initrd /initrd.img
}
menuentry "Vivid Vervet 15.04 systemd" {
set root=(hd0,9)
linux /vmlinuz root=/dev/sda9 ro quiet splash init=/lib/systemd/systemd
initrd /initrd.img
}
menuentry "Vivid Vervet 15.04 (Recovery Mode)" {
set root=(hd0,9)
linux /vmlinuz root=/dev/sda9 ro recovery nomodeset
initrd /initrd.img
}

If you make the permanent switch to make systemd default and want an option to boot into upstart this would be the menuentries in /etc/grub.d/06_custom:


menuentry "Vivid Vervet 15.04" {
set root=(hd0,9)
linux /vmlinuz root=/dev/sda9 ro quiet splash
initrd /initrd.img
}
menuentry "Vivid Vervet 15.04 upstart" {
set root=(hd0,9)
linux /vmlinuz root=/dev/sda9 ro quiet splash init=/sbin/upstart
initrd /initrd.img
}
menuentry "Vivid Vervet 15.04 (Recovery Mode)" {
set root=(hd0,9)
linux /vmlinuz root=/dev/sda9 ro recovery nomodeset
initrd /initrd.img
}

Of course change the red part to match your hard disk and partition that Vivid Vervet 15.05 is installed on and enter sudo update-grub to make these changes "stick".

watchpocket
February 1st, 2015, 05:28 AM
I used grub-customizer (version 4.0.6) recently to try to change the order of the grub2 menu. Now when I run sudo update-grub at the command-line, I get syntax errors. Before I try to do anything more to set up my grub2, I'd like to fix this, but I'm not sure where to start.

I have three 1-terabyte drives. I'm running Ubuntu MATE 14.04.1 on /dev/sda1/ and Ubuntu 12.04.5 Precise on /dev/sdb1.

/dev/sdc is newly installed (with no OS on it) and will be for data files. On 14.04 I have GNU GRUB version 2.02~beta2-9ubuntu1.

Here is the output of sudo update-grub, when run from within 14.04:


Generating grub configuration file ...
Found theme: /boot/grub/themes/ubuntu-mate/theme.txt
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found linux image: /boot/vmlinuz-3.13.0-45-generic
Found initrd image: /boot/initrd.img-3.13.0-45-generic
Found linux image: /boot/vmlinuz-3.13.0-44-generic
Found initrd image: /boot/initrd.img-3.13.0-44-generic
Found linux image: /boot/vmlinuz-3.13.0-39-generic
Found initrd image: /boot/initrd.img-3.13.0-39-generic
Found Ubuntu 12.04.5 LTS (12.04) on /dev/sdb1
Found linux image: /boot/vmlinuz-3.13.0-45-generic
Found initrd image: /boot/initrd.img-3.13.0-45-generic
Found linux image: /boot/vmlinuz-3.13.0-44-generic
Found initrd image: /boot/initrd.img-3.13.0-44-generic
Found linux image: /boot/vmlinuz-3.13.0-39-generic
Found initrd image: /boot/initrd.img-3.13.0-39-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Ubuntu 12.04.5 LTS (12.04) on /dev/sdb1
Found linux image: /boot/vmlinuz-3.13.0-45-generic
Found initrd image: /boot/initrd.img-3.13.0-45-generic
Found linux image: /boot/vmlinuz-3.13.0-44-generic
Found initrd image: /boot/initrd.img-3.13.0-44-generic
Found linux image: /boot/vmlinuz-3.13.0-39-generic
Found initrd image: /boot/initrd.img-3.13.0-39-generic
error: syntax error.
error: Incorrect command.
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 637
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

The only file I have -- among all of /etc/default/grub, /etc/grub.d/* and /boot/grub/* -- that has 637 lines in it is the uneditable /boot/grub/grub.cfg.new .
(It's 687 lines long and I can post it if needed.) There is a /boot/grub/grub.cfg file, but it's only 514 lines.

Here's my /etc/default/grub file:

1 # If you change this file, run 'update-grub' afterwards to update
2 # /boot/grub/grub.cfg.
3 # For full documentation of the options in this file, see:
4 # info -f grub -n 'Simple configuration'
5
6 GRUB_DEFAULT="Ubuntu 14.04"
7 #GRUB_HIDDEN_TIMEOUT="0"
8 GRUB_HIDDEN_TIMEOUT_QUIET="true"
9 GRUB_TIMEOUT="10"
10 GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
11 GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
12 GRUB_CMDLINE_LINUX="persistent"
13
14 # Uncomment to enable BadRAM filtering, modify to suit your needs
15 # This works with Linux (no patch required) and with any kernel that obtains
16 # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
17 #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
18
19 # Uncomment to disable graphical terminal (grub-pc only)
20 #GRUB_TERMINAL="console"
21
22 # The resolution used on graphical terminal
23 # note that you can use only modes which your graphic card supports via VBE
24 # you can see them in real GRUB with the command `vbeinfo'
25 #GRUB_GFXMODE="640x480"
26
27 # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
28 #GRUB_DISABLE_LINUX_UUID="true"
29
30 # Uncomment to disable generation of recovery mode menu entries
31 #GRUB_DISABLE_RECOVERY="true"
32
33 # Uncomment to get a beep at grub start
34 #GRUB_INIT_TUNE="480 440 1"
35
36 GRUB_SAVEDEFAULT="false"
37 GRUB_THEME="/boot/grub/themes/ubuntu-mate/theme.txt"
38 export GRUB_COLOR_NORMAL="light-gray/black"
39 export GRUB_COLOR_HIGHLIGHT="magenta/black"
40
41 GRUB_FONT="/boot/grub/unicode.pf2"

I'll continue to read up on GRUB2, but thanks for ideas how to fix this in the meantime.

deadflowr
February 1st, 2015, 06:05 AM
You could post the error line that the grub.cfg.new has, which should give us an idea of what's wrong.
The line is the 637 line, so either copy that line from a text editor, (gedit has a quick option --ctrl + I to go to a line)
or post the output from

sed -n '637p' /boot/grub/grub.cfg.new
for us to look at.

watchpocket
February 1st, 2015, 06:19 AM
Sure. Here are lines 618 through 645 of my /boot/grub/grub.cfg.new file. Line number 637 I've bolded and made red here. Thanks.


618 }
619 menuentry "Ubuntu, with Linux 3.13.0-39-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-39-generic-recove ____ry-1742aa67-b8ce-45d2-94ca-05e3579f7e2f' {
620 *.......*.......recordfail
621 *.......*.......load_video
622 *.......*.......insmod gzio
623 *.......*.......insmod part_msdos
624 *.......*.......insmod ext2
625 *.......*.......set root='hd0,msdos1'
626 *.......*.......if [ x$feature_platform_search_hint = xy ]; then
627 *.......*....... search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 1742aa67-b8ce-45d2-94ca-05e3579f7e2f
628 *.......*.......else
629 *.......*....... search --no-floppy --fs-uuid --set=root 1742aa67-b8ce-45d2-94ca-05e3579f7e2f
630 *.......*.......fi
631 *.......*.......echo*...'Loading Linux 3.13.0-39-generic ...'
632 *.......*.......linux*../boot/vmlinuz-3.13.0-39-generic root=UUID=1742aa67-b8ce-45d2-94ca-05e3579f7e2f ro recovery nomodeset persistent
633 *.......*.......echo*...'Loading initial ramdisk ...'
634 *.......*.......initrd*./boot/initrd.img-3.13.0-39-generic
635 }
636 }
637 function gfxmode {
638 *.......set gfxpayload="${1}"
639 *.......if [ "${1}" = "keep" ]; then
640 *.......*.......set vt_handoff=vt.handoff=7
641 *.......else
642 *.......*.......set vt_handoff=
643 *.......fi
644 }
645 if [ "${recordfail}" != 1 ]; then

oygle
February 1st, 2015, 06:44 AM
I have added a windows XP HDD, and want to use it with Kubuntu, so needed to modify grub.

Have followed the instructions from post #1 in this thread and gone through and made changes as indicated at https://help.ubuntu.com/community/MaintenanceFreeCustomGrub2Screen

The following is before the changes ...



$ grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0
0 menuentry 'Ubuntu
1 submenu 'Advanced options for Ubuntu
2 menuentry 'Ubuntu, with Linux 3.13.0-45-generic
3 menuentry 'Ubuntu, with Linux 3.13.0-45-generic (recovery mode)
4 menuentry 'Ubuntu, with Linux 3.13.0-44-generic
5 menuentry 'Ubuntu, with Linux 3.13.0-44-generic (recovery mode)
6 menuentry 'Ubuntu, with Linux 3.13.0-43-generic
7 menuentry 'Ubuntu, with Linux 3.13.0-43-generic (recovery mode)
8 menuentry 'Memory test (memtest86+)
9 menuentry 'Memory test (memtest86+, serial console 115200)
$
$ sudo blkid
[sudo] password for **********:
/dev/sda1: UUID="b36b92dd-0621-4eeb-95f0-08cce5ef0a31" TYPE="ext4"
/dev/sda2: UUID="82e48eb2-0c33-4696-9154-d921da42bbd2" TYPE="swap"
/dev/sda3: UUID="eb961b0b-f288-40c1-80bc-708e08614b4b" TYPE="ext4"
/dev/sdb1: UUID="8EFC2D0BFC2CEF61" TYPE="ntfs"


and the following after the changes to /etc/grub.d/06_custom



$ sudo chmod +x /etc/grub.d/06_custom
[sudo] password for **********:
$ sudo update-grub2
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-3.13.0-45-generic
Found initrd image: /boot/initrd.img-3.13.0-45-generic
Found linux image: /boot/vmlinuz-3.13.0-44-generic
Found initrd image: /boot/initrd.img-3.13.0-44-generic
Found linux image: /boot/vmlinuz-3.13.0-43-generic
Found initrd image: /boot/initrd.img-3.13.0-43-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Microsoft Windows XP Professional on /dev/sdb1
done

but now there is no recovery mode options ?? Also, if I select the win XP option from grub, it tries to boot, but just keeps booting. (I think that is a windows display driver problem, as the Win xp HDD came from another computer). Here is /etc/grub.d/06_custom



#!/bin/sh
exec tail -n +4 $0
echo 1>&2 "Adding Trusty Tahr 14.04 and Windows XP Pro"
# 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 "Trusty Tahr 14.04" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro quiet splash
initrd /initrd.img
}
menuentry "Trusty Tahr 14.04 (Recovery Mode)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Windows XP Pro" {
insmod ntfs
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 8EFC2D0BFC2CEF61
chainloader +1
}

The (new) grub menu has the additional option I wanted, but I don't have the option to boot with another kernel. Also, there is a 'Ubuntu' option there ??

Cavsfan
February 1st, 2015, 10:24 PM
I used grub-customizer (version 4.0.6) recently to try to change the order of the grub2 menu. Now when I run sudo update-grub at the command-line, I get syntax errors. Before I try to do anything more to set up my grub2, I'd like to fix this, but I'm not sure where to start.

I have three 1-terabyte drives. I'm running Ubuntu MATE 14.04.1 on /dev/sda1/ and Ubuntu 12.04.5 Precise on /dev/sdb1.

/dev/sdc is newly installed (with no OS on it) and will be for data files. On 14.04 I have GNU GRUB version 2.02~beta2-9ubuntu1.

Here is the output of sudo update-grub, when run from within 14.04:


Generating grub configuration file ...
Found theme: /boot/grub/themes/ubuntu-mate/theme.txt
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found linux image: /boot/vmlinuz-3.13.0-45-generic
Found initrd image: /boot/initrd.img-3.13.0-45-generic
Found linux image: /boot/vmlinuz-3.13.0-44-generic
Found initrd image: /boot/initrd.img-3.13.0-44-generic
Found linux image: /boot/vmlinuz-3.13.0-39-generic
Found initrd image: /boot/initrd.img-3.13.0-39-generic
Found Ubuntu 12.04.5 LTS (12.04) on /dev/sdb1
Found linux image: /boot/vmlinuz-3.13.0-45-generic
Found initrd image: /boot/initrd.img-3.13.0-45-generic
Found linux image: /boot/vmlinuz-3.13.0-44-generic
Found initrd image: /boot/initrd.img-3.13.0-44-generic
Found linux image: /boot/vmlinuz-3.13.0-39-generic
Found initrd image: /boot/initrd.img-3.13.0-39-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Ubuntu 12.04.5 LTS (12.04) on /dev/sdb1
Found linux image: /boot/vmlinuz-3.13.0-45-generic
Found initrd image: /boot/initrd.img-3.13.0-45-generic
Found linux image: /boot/vmlinuz-3.13.0-44-generic
Found initrd image: /boot/initrd.img-3.13.0-44-generic
Found linux image: /boot/vmlinuz-3.13.0-39-generic
Found initrd image: /boot/initrd.img-3.13.0-39-generic
error: syntax error.
error: Incorrect command.
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 637
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

The only file I have -- among all of /etc/default/grub, /etc/grub.d/* and /boot/grub/* -- that has 637 lines in it is the uneditable /boot/grub/grub.cfg.new .
(It's 687 lines long and I can post it if needed.) There is a /boot/grub/grub.cfg file, but it's only 514 lines.

Here's my /etc/default/grub file:

1 # If you change this file, run 'update-grub' afterwards to update
2 # /boot/grub/grub.cfg.
3 # For full documentation of the options in this file, see:
4 # info -f grub -n 'Simple configuration'
5
6 GRUB_DEFAULT="Ubuntu 14.04"
7 #GRUB_HIDDEN_TIMEOUT="0"
8 GRUB_HIDDEN_TIMEOUT_QUIET="true"
9 GRUB_TIMEOUT="10"
10 GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
11 GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
12 GRUB_CMDLINE_LINUX="persistent"
13
14 # Uncomment to enable BadRAM filtering, modify to suit your needs
15 # This works with Linux (no patch required) and with any kernel that obtains
16 # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
17 #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
18
19 # Uncomment to disable graphical terminal (grub-pc only)
20 #GRUB_TERMINAL="console"
21
22 # The resolution used on graphical terminal
23 # note that you can use only modes which your graphic card supports via VBE
24 # you can see them in real GRUB with the command `vbeinfo'
25 #GRUB_GFXMODE="640x480"
26
27 # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
28 #GRUB_DISABLE_LINUX_UUID="true"
29
30 # Uncomment to disable generation of recovery mode menu entries
31 #GRUB_DISABLE_RECOVERY="true"
32
33 # Uncomment to get a beep at grub start
34 #GRUB_INIT_TUNE="480 440 1"
35
36 GRUB_SAVEDEFAULT="false"
37 GRUB_THEME="/boot/grub/themes/ubuntu-mate/theme.txt"
38 export GRUB_COLOR_NORMAL="light-gray/black"
39 export GRUB_COLOR_HIGHLIGHT="magenta/black"
40
41 GRUB_FONT="/boot/grub/unicode.pf2"

I'll continue to read up on GRUB2, but thanks for ideas how to fix this in the meantime.


Sure. Here are lines 618 through 645 of my /boot/grub/grub.cfg.new file. Line number 637 I've bolded and made red here. Thanks.


618 }
619 menuentry "Ubuntu, with Linux 3.13.0-39-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-39-generic-recove ____ry-1742aa67-b8ce-45d2-94ca-05e3579f7e2f' {
620 *.......*.......recordfail
621 *.......*.......load_video
622 *.......*.......insmod gzio
623 *.......*.......insmod part_msdos
624 *.......*.......insmod ext2
625 *.......*.......set root='hd0,msdos1'
626 *.......*.......if [ x$feature_platform_search_hint = xy ]; then
627 *.......*....... search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 1742aa67-b8ce-45d2-94ca-05e3579f7e2f
628 *.......*.......else
629 *.......*....... search --no-floppy --fs-uuid --set=root 1742aa67-b8ce-45d2-94ca-05e3579f7e2f
630 *.......*.......fi
631 *.......*.......echo*...'Loading Linux 3.13.0-39-generic ...'
632 *.......*.......linux*../boot/vmlinuz-3.13.0-39-generic root=UUID=1742aa67-b8ce-45d2-94ca-05e3579f7e2f ro recovery nomodeset persistent
633 *.......*.......echo*...'Loading initial ramdisk ...'
634 *.......*.......initrd*./boot/initrd.img-3.13.0-39-generic
635 }
636 }
637 function gfxmode {
638 *.......set gfxpayload="${1}"
639 *.......if [ "${1}" = "keep" ]; then
640 *.......*.......set vt_handoff=vt.handoff=7
641 *.......else
642 *.......*.......set vt_handoff=
643 *.......fi
644 }
645 if [ "${recordfail}" != 1 ]; then


OK, here is what I would do: boot into 14.04 and make sure that grub there is controlling your system by entering sudo grub-install /dev/sda
Then use gparted to make sure that the boot flag is not also set on sdb where you have 12.04 installed. If the boot flag is checked on sdb uncheck it and click apply and close gparted.
Then edit your /etc/default/grub file gksudo gedit /etc/default/grub and change GRUB_DEFAULT= to a number. The menu entries start at 0 so If you wanted the first entry to be default enter 0 without quotes.
For now just change it to 2 without quotes there. Which will be Mate 14.04 as default. You can always change it later.

Delete persistent on the GRUB_CMDLINE_LINUX= line so it just has double quotes like this GRUB_CMDLINE_LINUX="".

If you have a picture in /boot/grub/ enter this GRUB_GFXMODE=1920x1200-24 in place of #GRUB_GFXMODE="640x480".
(with the same size resolution as your monitor. Mine is 1920x1200 and the 24 means 24 bit depth color.)
HD pictures are usually 24 bit but not always and sometimes you have to try more than one picture.
If the picture is listed in the output when you enter sudo update-grub but does not appear at boot time try another picture.

Then comment out lines 36 through 39 and remove the quotes from line 42 on your font line.
Then save that file.

Then create or edit a 06_custom file and you can create one if it doesn't exist by entering gksudo gedit /etc/grub.d/06_custom
Then copy the contents of this into that text file:

#!/bin/sh
echo 1>&2 "Adding Precise Pangolin 12.04 and Trusty Tahr Mate 14.04"
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=(hd1,1)
linux /vmlinuz root=/dev/sdb1 ro quiet splash
initrd /initrd.img
}
menuentry "Precise Pangolin 12.04 (Recovery Mode)" {
set root=(hd1,1)
linux /vmlinuz root=/dev/sdb1 ro single
initrd /initrd.img
}
menuentry "Trusty Tahr Mate 14.04" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro quiet splash
initrd /initrd.img
}
menuentry "Trusty Tahr 14.04 Mate (Recovery Mode)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro recovery nomodeset
initrd /initrd.img
}


Then save it and enter sudo chmod +x /etc/grub.d/06_custom to make it executable.

Then enter gksudo gedit /etc/grub.d/05_debian_theme +117 to enter the font colors. (The +117 will put you at line 117. you need to put the font colors on line 118 for Trusty.
You can have 3 colors:

A color (color_normal) for the words at top and bottom of the screen.
A normal menu color (menu_color_normal) for the box surrounding the menu and the menu entries themselves.
Then a color for the selected line (menu_color_highlight) where the cursor is

Like this:

117 echo "if background_image `make_system_path_relative_to_its_root "${1}"`; then"
118 echo " set color_normal=magenta/black"
119 echo " set menu_color_normal=yellow/black"
120 echo " set menu_color_highlight=red/black"

Then most important before you reboot enter sudo update-grub or sudo update-grub2 either one works.
If you forget that then none of the changes will appear when you reboot.

That should work and give you the ability to boot into either system.
If you have problems it should not be anything drastic.
I will be gone some of the day tomorrow but will be here in the afternoon.

This will at least show the menu entries created above on top of any other menu entries you have.

You do know that the link to the wiki is on the 1st post in this thread in green right?

Cavsfan
February 1st, 2015, 10:35 PM
I have added a windows XP HDD, and want to use it with Kubuntu, so needed to modify grub.

Have followed the instructions from post #1 in this thread and gone through and made changes as indicated at https://help.ubuntu.com/community/MaintenanceFreeCustomGrub2Screen

The following is before the changes ...

$ grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0
0 menuentry 'Ubuntu
1 submenu 'Advanced options for Ubuntu
2 menuentry 'Ubuntu, with Linux 3.13.0-45-generic
3 menuentry 'Ubuntu, with Linux 3.13.0-45-generic (recovery mode)
4 menuentry 'Ubuntu, with Linux 3.13.0-44-generic
5 menuentry 'Ubuntu, with Linux 3.13.0-44-generic (recovery mode)
6 menuentry 'Ubuntu, with Linux 3.13.0-43-generic
7 menuentry 'Ubuntu, with Linux 3.13.0-43-generic (recovery mode)
8 menuentry 'Memory test (memtest86+)
9 menuentry 'Memory test (memtest86+, serial console 115200)
$
$ sudo blkid
[sudo] password for **********:
/dev/sda1: UUID="b36b92dd-0621-4eeb-95f0-08cce5ef0a31" TYPE="ext4"
/dev/sda2: UUID="82e48eb2-0c33-4696-9154-d921da42bbd2" TYPE="swap"
/dev/sda3: UUID="eb961b0b-f288-40c1-80bc-708e08614b4b" TYPE="ext4"
/dev/sdb1: UUID="8EFC2D0BFC2CEF61" TYPE="ntfs"


and the following after the changes to /etc/grub.d/06_custom

$ sudo chmod +x /etc/grub.d/06_custom
[sudo] password for **********:
$ sudo update-grub2
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-3.13.0-45-generic
Found initrd image: /boot/initrd.img-3.13.0-45-generic
Found linux image: /boot/vmlinuz-3.13.0-44-generic
Found initrd image: /boot/initrd.img-3.13.0-44-generic
Found linux image: /boot/vmlinuz-3.13.0-43-generic
Found initrd image: /boot/initrd.img-3.13.0-43-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Microsoft Windows XP Professional on /dev/sdb1
done


but now there is no recovery mode options ?? Also, if I select the win XP option from grub, it tries to boot, but just keeps booting. (I think that is a windows display driver problem, as the Win xp HDD came from another computer). Here is /etc/grub.d/06_custom



#!/bin/sh
exec tail -n +4 $0
echo 1>&2 "Adding Trusty Tahr 14.04 and Windows XP Pro"
# 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 "Trusty Tahr 14.04" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro quiet splash
initrd /initrd.img
}
menuentry "Trusty Tahr 14.04 (Recovery Mode)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Windows XP Pro" {
insmod ntfs
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 8EFC2D0BFC2CEF61
chainloader +1
}

The (new) grub menu has the additional option I wanted, but I don't have the option to boot with another kernel. Also, there is a 'Ubuntu' option there ??

Look at what I have posted above in reply to watchpocket. That should get you pretty close and if not see what you can fix and let me know what happens.
I will be gone until tomorrow afternoon. But, I should be able to help you then.

Here is the contents of my /etc/default/grub file:

# 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=9
#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"

cheers

oygle
February 2nd, 2015, 12:56 AM
Thanks Cavsfan (http://ubuntuforums.org/member.php?u=889820). I checked with kde partition manager and de/sda1 (Kubuntu 14.04) AND dev/sdb1 (Win xp pro) have the boot flag set. I'm very hesitant to check the flag off for dev/sdb1 because I'm having problems booting into XP at present. Apparently one cannot simply take an XP hard drive and place it into another computer and have it work. I checked your grub file to mine with Beyond Compare, and apart from code to do with display/fonts, there are these 4 lines


GRUB_DEFAULT=9
#GRUB_HIDDEN_TIMEOUT=0
GRUB_TIMEOUT=60

the default grub file I have is


GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_TIMEOUT=10

The grub screen that now appears is as follows ..

The 3 options I have in /etc/grub.d/06_custom
Ubuntu
Advanced options for Ubuntu
memory test ....
memory test ....
Microsoft Windows XP Professional (on dev/sdb1)

After modifying, here is the /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=2
#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=""

# 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

watchpocket
February 2nd, 2015, 04:14 AM
A thousand thanks for the detailed response, Cavsfan.

I made all of your suggestions exactly as you outlined them, double-checked everything (and will now triple-check) but I get the same syntax error messages when I sudo update-grub. Except that what was line 637 in the error message -- that same function gfxmode { line -- is now line 667.

And there appears to be no change to my grub menu. I read the wiki, am reading it again, also reading the manual at https://www.gnu.org/software/grub/manual/grub.html.

For what it's worth:
rj@rjbox:~$ grub-install -v
grub-install: info: executing modprobe efivars 2>/dev/null.
grub-install: info: Looking for /sys/firmware/efi ...
grub-install: info: ... not found. Looking for /proc/device-tree ...
grub-install: info: ... not found.
Installing for i386-pc platform.
grub-install: error: install device isn't specified.
rj@rjbox:~$
"i386-pc platform" -- I'm assuming that's right for my 64-bit desktop machine, since that was what you said to enter.

Also:

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

Thanks again for the detailed attention.

oygle
February 2nd, 2015, 04:32 AM
[Moderator, please delete this post. Connection problems caused posting in triplicate, my apologies.]

I _think_ you can just do a "Report post' ; bottom left hand corner.

oygle
February 3rd, 2015, 12:38 AM
The grub menu is working okay (attached), but I need to get rid of lines 3,4 and 7, and have the options of booting to previous kernel/s.

/etc/grub.d/06_custom


#!/bin/sh
exec tail -n +4 $0
echo 1>&2 "Adding Trusty Tahr 14.04 and Windows XP Pro"
# 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 "Trusty Tahr 14.04" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro quiet splash
initrd /initrd.img
}
menuentry "Trusty Tahr 14.04 (Recovery Mode)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Windows XP Pro" {
insmod ntfs
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 8EFC2D0BFC2CEF61
chainloader +1
}

oldfred
February 3rd, 2015, 03:14 PM
This shows grub will reinstall automatically to partition one on the drive. That should not have the part 1 at end, so it installs to the MBR.


grub-pc/install_devices: /dev/disk/by-id/ata-ST31000528AS_9VP1JVMB-part1


#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, enter to accept, do not choose partitions

If you installed grub-customizer, be sure to uninstall it. And it creates its own scripts. Often best way to uninstall is a total purge of grub, copy/backup scripts folder and reinstall grub-pc package. If you have manually edited any scripts be sure to save/backup those first.

To see if you have grub customizer scripts.
ls -lha /etc/grub.d

Best not to mix grub customizer and manual edits of grub scripts. If customizer works that is fine, but if not purge customizer and manually edit grub. I prefer the manual edit as then you know what changes are taking place.

Cavsfan
February 3rd, 2015, 11:00 PM
A thousand thanks for the detailed response, Cavsfan.

I made all of your suggestions exactly as you outlined them, double-checked everything (and will now triple-check) but I get the same syntax error messages when I sudo update-grub. Except that what was line 637 in the error message -- that same function gfxmode { line -- is now line 667.

And there appears to be no change to my grub menu. I read the wiki, am reading it again, also reading the manual at https://www.gnu.org/software/grub/manual/grub.html.

For what it's worth:
rj@rjbox:~$ grub-install -v
grub-install: info: executing modprobe efivars 2>/dev/null.
grub-install: info: Looking for /sys/firmware/efi ...
grub-install: info: ... not found. Looking for /proc/device-tree ...
grub-install: info: ... not found.
Installing for i386-pc platform.
grub-install: error: install device isn't specified.
rj@rjbox:~$
"i386-pc platform" -- I'm assuming that's right for my 64-bit desktop machine, since that was what you said to enter.

Also:

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

Thanks again for the detailed attention.

You're welcome! Sorry I didn't reply sooner but I've had some issues with real life come up. My monitor is also going bad but got one on the way tomorrow.

What Oldfred posted is right. You should purge grub-customizer if you are going to manually edit the grub files, which is recommended as you know what you have.
Mixing the 2 is what is causing you problems I believe.

I said to enter sudo grub-install /dev/sda on the system that you want to have controlling grub. We can point you to how to eliminate the other grub from interfering once all is fine.
It will say "Installing for i386-pc platform." even on a 64 bit system. That is normal

With a small v this is what I get too. capital V returns the version (below). This is on Trusty too.

cavsfan@cavsfan-desktop:~$ grub-install -v
grub-install: info: executing modprobe efivars 2>/dev/null.
grub-install: info: Looking for /sys/firmware/efi ...
grub-install: info: ... not found. Looking for /proc/device-tree ...
grub-install: info: ... not found.
Installing for i386-pc platform.
grub-install: error: install device isn't specified.


cavsfan@cavsfan-desktop:~$ grub-install -V
grub-install (GRUB) 2.02~beta2-9ubuntu1

But, your main problem is mixing grub-customizer with manual editing the grub files.
As a matter of fact the problem you have is coming from grub-customizer.

Cavsfan
February 3rd, 2015, 11:20 PM
The grub menu is working okay (attached), but I need to get rid of lines 3,4 and 7, and have the options of booting to previous kernel/s.

/etc/grub.d/06_custom


#!/bin/sh
exec tail -n +4 $0
echo 1>&2 "Adding Trusty Tahr 14.04 and Windows XP Pro"
# 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 "Trusty Tahr 14.04" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro quiet splash
initrd /initrd.img
}
menuentry "Trusty Tahr 14.04 (Recovery Mode)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Windows XP Pro" {
insmod ntfs
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 8EFC2D0BFC2CEF61
chainloader +1
}


If you too are also using grub-customizer you need to purge that before it messes anything up. Manual grub entries are easier and never need modifying unless you change partitions.
Actually the first three lines are good and coming from /etc/grub.d/06_custom see the red lines match the first three lines in your picture.
The other ones are what you want to get rid of.

If you are confident that the top line boots to Trusty and the 3rd line boots to Windows XP, then you need to make the other files that put those extra menu entries un-executable Like this:

sudo chmod -x /etc/grub.d/20_memtest86+ will make memtest unexecutable and will not show in the menu.
sudo chmod -x /etc/grub.d/10_linux will make the list of kernels not display.
sudo chmod -x /etc/grub.d/30_os-prober will make any Windows or Debian, etc. entries not display.
Then always enter sudo update-grub when finished making changes.
Then reboot and you should be good to go.

But if you can boot into XP with the 3rd line you should remove the boot flag from sdb. Only 1 drive should have the boot flag set and it will not prevent XP from booting.
Do this and get back to me.

watchpocket
February 4th, 2015, 04:03 AM
sudo dpkg-reconfigure grub-pc or dpkg-reconfigure grub-efi-amd64


I'll need grub-pc for amd64, I think (instead of grub-efi-amd64), since my machine is 64-bit, but BIOS, not UEFI.


If you installed grub-customizer, be sure to uninstall it.

I did install it in my Ubuntu MATE 14.04. I'm definitely going to uninstall grub-customizer at the first chance I have to get back to this project (I'll be traveling for a week starting tomorrow & I'm writing this now from my workplace Windows box). I had no idea that grub-customizer messes things up so easily.


And it creates its own scripts. Often best way to uninstall is a total purge of grub, copy/backup scripts folder and reinstall grub-pc package. If you have manually edited any scripts be sure to save/backup those first.

I most likely -will- do a total purge of grub (after backing up everything in /etc/grub.d), because none of what I've done with grub (per Cavsfan's suggestions) has effected any change at all, and also partly because it looks like I may currently be running grub for i386 instead of for amd64.

But, a question: if I purge grub, I'm guessing I'll need to reinstall it immediately after purging, and without rebooting or shutting down, or else I won't be able to boot (although the 1.98 or 1.99 legacy grub that I have on /dev/sdb that's part of my Ubuntu 12.04.5 install might take over the booting process. (Wait, no, that probably won't happen because I unchecked the boot flag for /dev/sdb with gparted, per Cavsfan's advice.)


To see if you have grub customizer scripts.
ls -lha /etc/grub.d

I definitely have scripts in /etc/grub.d -- but how do I tell which scripts were created with grub-customizer and which weren't?


Best not to mix grub customizer and manual edits of grub scripts. If customizer works that is fine, but if not purge customizer and manually edit grub. I prefer the manual edit as then you know what changes are taking place.

I also prefer editing the scripts manually, for complete control (& no mysterious additions of new entries not put there by me), as long as I'm reasonably sure I know what I'm doing. Thank you for the clarifications.

oygle
February 4th, 2015, 04:13 AM
Have done as per your instructions ..


$ sudo chmod -x /etc/grub.d/20_memtest86+
$ sudo chmod -x /etc/grub.d/10_linux
$ sudo chmod -x /etc/grub.d/30_os-prober
$ sudo update-grub
Generating grub configuration file ...
done
$

Hmm, that 3rd option doesn't boot to windows. I now remember that the last option worked...


$ sudo chmod +x /etc/grub.d/30_os-prober
$ sudo update-grub
Generating grub configuration file ...
Found Microsoft Windows XP Professional on /dev/sdb1
done
$


Now I assume I don't actually need that third line in /etc/grub.d/06_custom

watchpocket
February 4th, 2015, 04:37 AM
You're welcome! Sorry I didn't reply sooner but I've had some issues with real life come up. My monitor is also going bad but got one on the way tomorrow.

Sounds exactly like my situation. I have to be away for a week and one of my two Hanns-G monitors has been seriously flaking. (What monitor did you get, if I may ask? I was going to order an identical Hanns-G replacement, but I think those guys may be out of business -- or nearly so -- from a multi-million $$$ fine they got for price-fixing.)


What Oldfred posted is right. You should purge grub-customizer if you are going to manually edit the grub files, which is recommended as you know what you have.
Mixing the 2 is what is causing you problems I believe.

Right. grub-customizer messed things up from the start, when I just did the one thing of trying to change the menu order.


I said to enter sudo grub-install /dev/sda on the system that you want to have controlling grub. We can point you to how to eliminate the other grub from interfering once all is fine.
It will say "Installing for i386-pc platform." even on a 64 bit system. That is normal

I think I did do that, but will do it again after purging grub-customizer.

One thing about i386 is that it appears here <http://packages.ubuntu.com/lucid/grub-pc> that there is (or was) a grub-pc available for amd64 as well as i386. Granted that this page is for an old version of grub-pc -- grub-pc 1.98-1ubuntu5. If there is a current version of grub-pc for amd64 (as opposed to one for i386), should I use the amd64 version, or does it not matter? Or maybe the new grub makes no such distinction.


With a small v this is what I get too. capital V returns the version (below). This is on Trusty too.

cavsfan@cavsfan-desktop:~$ grub-install -v
grub-install: info: executing modprobe efivars 2>/dev/null.
grub-install: info: Looking for /sys/firmware/efi ...
grub-install: info: ... not found. Looking for /proc/device-tree ...
grub-install: info: ... not found.
Installing for i386-pc platform.
grub-install: error: install device isn't specified.


cavsfan@cavsfan-desktop:~$ grub-install -V
grub-install (GRUB) 2.02~beta2-9ubuntu1


Hmm. I totally wrongly invoked the small-v in that command.


But, your main problem is mixing grub-customizer with manual editing the grub files.
As a matter of fact the problem you have is coming from grub-customizer.

Thank you so much for your help. grub is a somewhat complex animal and it's so great to receive the clear thinking from both of you gentlemen. I'll report back with results asap (probably in a week or so, sooner if possible).

Cavsfan
February 4th, 2015, 06:11 PM
I'll need grub-pc for amd64, I think (instead of grub-efi-amd64), since my machine is 64-bit, but BIOS, not UEFI.

No matter if you have a 32 bit or 64 bit system you will get that message.
I just executed the command on Vivid Vervet 15.05 and here's the output:


cavsfan@cavsfan-MS-7529:~$ sudo grub-install /dev/sda
[sudo] password for cavsfan:
Installing for i386-pc platform.
Installation finished. No error reported.

cavsfan@cavsfan-MS-7529:~$ sudo update-grub
Generating grub configuration file ...
Found background image: milky_way_sky-wide.jpg
Adding Precise Pangolin 12.04, Trusty Tahr 14.04, Vivid Vervet 15.04 (devel branch), Mint 17 Rebecca and Windows 7
done

Here is what my grub screen looks like:

http://www.zimagez.com/miniature/20150201141509.jpg (http://www.zimagez.com/zimage/20150201141509.php)


Have done as per your instructions ..


$ sudo chmod -x /etc/grub.d/20_memtest86+
$ sudo chmod -x /etc/grub.d/10_linux
$ sudo chmod -x /etc/grub.d/30_os-prober
$ sudo update-grub
Generating grub configuration file ...
done
$

Hmm, that 3rd option doesn't boot to windows. I now remember that the last option worked...


$ sudo chmod +x /etc/grub.d/30_os-prober
$ sudo update-grub
Generating grub configuration file ...
Found Microsoft Windows XP Professional on /dev/sdb1
done
$


Now I assume I don't actually need that third line in /etc/grub.d/06_custom

Could you post the output of sudo blkid -c /dev/null -o list.
And also the results of sudo grub-mkconfig with only 30_os-prober executable.

If it's too long to be able to get to the top of it in terminal pipe it to a text file like this:
sudo grub-mkconfig > <text-file-name> I'll leave it up to you what to name it but replace <text-file-name> with sonething like grub-output.
I'd like to see why that entry in 06_custom doesn't work while the one produced by 30_os-prober when sudo update-grub is executed.

Cavsfan
February 4th, 2015, 06:57 PM
I most likely -will- do a total purge of grub (after backing up everything in /etc/grub.d), because none of what I've done with grub (per Cavsfan's suggestions) has effected any change at all, and also partly because it looks like I may currently be running grub for i386 instead of for amd64.

But, a question: if I purge grub, I'm guessing I'll need to reinstall it immediately after purging, and without rebooting or shutting down, or else I won't be able to boot (although the 1.98 or 1.99 legacy grub that I have on /dev/sdb that's part of my Ubuntu 12.04.5 install might take over the booting process. (Wait, no, that probably won't happen because I unchecked the boot flag for /dev/sdb with gparted, per Cavsfan's advice.)



I definitely have scripts in /etc/grub.d -- but how do I tell which scripts were created with grub-customizer and which weren't?



Thank you for the clarifications.

If you purge grub-customizer it should remove the script it created but just so you know what is in /etc/grub.d/ here is the contents of my directory:

cavsfan@cavsfan-desktop:~$ cd /etc/grub.d/
cavsfan@cavsfan-desktop:/etc/grub.d$ ls -l
total 84
-rwxr-xr-x 1 root root 9424 Apr 11 2014 00_header
-rwxr-xr-x 1 root root 6193 Oct 1 11:20 05_debian_theme
-rwxr-xr-x 1 root root 1861 Jan 10 07:01 06_custom
-rw-r--r-- 1 root root 11608 Apr 11 2014 10_linux
-rwxr-xr-x 1 root root 10412 Apr 11 2014 20_linux_xen
-rw-r--r-- 1 root root 1992 Mar 12 2014 20_memtest86+
-rw-r--r-- 1 root root 11692 Apr 11 2014 30_os-prober
-rwxr-xr-x 1 root root 1416 Apr 11 2014 30_uefi-firmware
-rwxr-xr-x 1 root root 214 Apr 11 2014 40_custom
-rwxr-xr-x 1 root root 216 Apr 11 2014 41_custom
-rw-r--r-- 1 root root 483 Apr 11 2014 README


My grub has been customized and the green files are the only ones executable. But that is for later. The files should match what you have after you've re-installed grub.

As good a way as any to purge grub and re-install it would be to do this; (and you definitely want to complete all the steps before rebooting!!!)
I'm in Trusty and this is what grub files I have installed:

cavsfan@cavsfan-desktop:~$ dpkg -l | grep grub
ii grub-common 2.02~beta2-9ubuntu1 amd64 GRand Unified Bootloader (common files)
ii grub-gfxpayload-lists 0.6 amd64 GRUB gfxpayload blacklist
ii grub-pc 2.02~beta2-9ubuntu1 amd64 GRand Unified Bootloader, version 2 (PC/BIOS version)
ii grub-pc-bin 2.02~beta2-9ubuntu1 amd64 GRand Unified Bootloader, version 2 (PC/BIOS binaries)
ii grub2-common 2.02~beta2-9ubuntu1 amd64 GRand Unified Bootloader (common files for version 2)

So sudo apt-get purge grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub2-common from terminal should do the trick.

Then you most definitely want to re-install before doing anything else:

sudo apt-get install grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub2-common

Then if you don't see it perform sudo grub-install /dev/sda then enter it manually and then enter sudo update-grub and you should be back to the normal default grub.

Again just ignore that i386 message as it does it on every system 32 bit or 64 bit.

Then you can peruse the wiki to customize your grub.

Cavsfan
February 5th, 2015, 07:32 PM
BTW oygle, is there any reason you're hanging on to Windows XP since it has gone past it's EOL?

Read option 1 here: http://windows.microsoft.com/en-us/windows/end-support-help

Here's a bit from that site: ".... itíll become five times more vulnerable to security risks and viruses, which means you could get hacked and have your personal information stolen."

watchpocket
February 15th, 2015, 12:18 AM
So I've purged grub-customizer, its files and proxy files and anything with that name, including its PPA in software sources. And I purged all the grub files and re-installed per suggestions above.

So far all is going well with the customization of my grub and right now I'm customizing menuentries in /etc/grub.d/40_custom, to be saved as /etc/grub.d/06_custom. (I'll first remove my current 06_custom file that you made, Cavsfan).

Meanwhile, a quick question:

In the wiki there's this:


menuentry "Precise Pangolin 12.04 (Recovery Mode)" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro single
initrd /initrd.img
}

Is the word "single" where it is (instead of "recovery nomodeset") because this recovery-mode entry is for Precise Pangolin (as opposed to another version of Ubuntu or another distro)?

Or is it there because this is the first recovery-mode entry in the list, and "single" goes where it is only in that first recovery-mode entry, and "recovery nomodeset" goes in the place of "single" for all subsequent recovery mode menuentries? (I'm guessing the latter, but it would be good to confirm.)

Or neither? Or does it matter? Maybe this was discussed in the wiki but if so, I missed it.

(So if I have Trusty as the first menu entry, and Trusty-recovery-mode as the second menu entry, should I have "single" or "recovery nomodeset" to the right of "ro" in this particular recovery-mode entry?

Oh, I also do not have a "memtest86+" file in /etc/grub.d/ -- I have a feeling it should be there (I see it on various pictures of grub-screen menus). If so, how is it generated or where would I otherwise copy text into it from?

Thank you for any clarification and thanks for all of your and others' work on grub.

watchpocket
February 15th, 2015, 02:31 AM
Actually, I realize now that it doesn't matter because I'm going to leave Precise as my first menu entry anyway (and Precise recovery mode as my 2nd), so that when I want to boot into Precise, I can simply bring up the grub menu and hit <ENTER> without having to use the arrow-keys to move up or down anywhere.

[EDIT -- Minor correction to the above: I see that once grub is displayed, the default menu entry (in my case, #2) is already highlighted, so to choose Precise (which is not the default), I do in fact need to arrow-up and then press <ENTER>.]

I have Trusty as default with the GRUB_DEFAULT setting in /etc/default/grub.

I think I'll leave memtest86+ out of the menu, I don't think I need it, unless someone comes up with a good reason why it should be there.

I'd like to have the grub menu not show at all until I hit a key, but it seems to want to display even with GRUB_TIMEOUT=0 and GRUB_HIDDEN_TIMEOUT=10.

Pic attached, colors are:
118 echo " set color_normal=light-blue/black"
119 echo " set menu_color_normal=light-gray/black"
120 echo " set menu_color_highlight=white/light-blue"259993
(This pic taken with my phone doesn't quite do justice to the background image, which is darker than it appears here. The brownish colors at left & right only appear in this pic.)

Cavsfan
February 15th, 2015, 02:35 PM
Actually, I realize now that it doesn't matter because I'm going to leave Precise as my first menu entry anyway (and Precise recovery mode as my 2nd), so that when I want to boot into Precise, I can simply bring up the grub menu and hit <ENTER> without having to use the arrow-keys to move up or down anywhere.

[EDIT -- Minor correction to the above: I see that once grub is displayed, the default menu entry (in my case, #2) is already highlighted, so to choose Precise (which is not the default), I do in fact need to arrow-up and then press <ENTER>.]

I have Trusty as default with the GRUB_DEFAULT setting in /etc/default/grub.

I think I'll leave memtest86+ out of the menu, I don't think I need it, unless someone comes up with a good reason why it should be there.

I'd like to have the grub menu not show at all until I hit a key, but it seems to want to display even with GRUB_TIMEOUT=0 and GRUB_HIDDEN_TIMEOUT=10.

Pic attached, colors are:
118 echo " set color_normal=light-blue/black"
119 echo " set menu_color_normal=light-gray/black"
120 echo " set menu_color_highlight=white/light-blue"259993
(This pic taken with my phone doesn't quite do justice to the background image, which is darker than it appears here. The brownish colors at left & right only appear in this pic.)

The quiet splash is for any version's normal boot line. The ro single is only for Precise's recovery boot line. Later versions have recovery nomodeset on the recovery boot line.

A forum user bogan (http://ubuntuforums.org/member.php?u=1017537) once pointed the difference in recovery lines to me.

If you want Precise to be your default menu line, edit /etc/default/grub and make GRUB_DEFAULT=0. The entries start at 0 like this: 0,1,2,3...

grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0 entered in terminal will show you this.

If you're happy with the top custom entries, make /etc/grub.d/30_os-prober unexecutable and enter sudo update-grub and you will only see the custom entries.
I have never had a need for memtest86+. I have also never had the need to boot into an older kernel than the latest.
If you ever find a reason to you can just make 30_os-prober executable again and then sudo update-grub, reboot and you have that option back.
But if you want a nice clean menu the former is the way to go.

I also know of no way to make the menu only appear if you press a key.

watchpocket
February 16th, 2015, 02:16 AM
The quiet splash is for any version's normal boot line. The ro single is only for Precise's recovery boot line. Later versions have recovery nomodeset on the recovery boot line.

Thanks -- I thought this might be the case.


[ . . . ]The entries start at 0 like this: 0,1,2,3...

grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0 entered in terminal will show you this.

The output of that command reminds me that I have far too many old kernels. I'd like to get rid of all but -45 and -44, but I'm not sure how to do that. (Do folks generally leave all these old kernels laying around? Seems like unneccessary cruft.)


If you're happy with the top custom entries, make /etc/grub.d/30_os-prober unexecutable and enter sudo update-grub and you will only see the custom entries.

Actually, I'm seeing the custom entries, plus a fifth line ("Ubuntu") and a sixth line ("Advanced options for Ubuntu"). This is fewer lines than appeared before making that change, but I didn't expect to see them. A title like "Ubuntu" -- without even a version number (though I know this is Trusty) -- is kind of useless. If it has to remain, I'd like to add the version number to the title, if possible. Then I'll be done.


I also know of no way to make the menu only appear if you press a key.

That's OK -- I need the grub menu to appear so I can choose between booting to Trusty or Precise.

watchpocket
February 16th, 2015, 03:15 AM
.

Bashing-om
February 16th, 2015, 07:58 PM
watchpocket; Hello;

I also am a student of grub, fascinating little process that it is.



The output of that command reminds me that I have far too many old kernels. I'd like to get rid of all but -45 and -44, but I'm not sure how to do that. (Do folks generally leave all these old kernels laying around? Seems like unneccessary cruft.)


Removing old kernels. If you do not need/want them then YES remove them . The system will not second guess what you want. It is at your discretion to remove them.
'apt-get autoremove' has been re-vamped in later releases to do this, I do not know that it is back ported to precise, and a lot depends on the kernel that is installed.
Try and see if this works for you:


sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get autoremove

else; to remove the old precise kernels will resort to 'apt-get --purge remove linux-image-XXXX ; generic, and headers too.

many prefer to use 'synaptic' to remove the old kernels.



where there is a will there is a way

watchpocket
February 16th, 2015, 08:47 PM
Before I do that, I just want to make sure: Does any functioning depend on the presence of old kernels? In other words, are new kernels built upon previous ones in any way? (Or do they -include- the functionality of a previous one?)

So if I remove an old kernel, there's nothing about doing that that will make the latest kernel lose any functionality, correct? Don't new kernels entirely replace old ones?

watchpocket
February 16th, 2015, 08:57 PM
I wrote, above:

Actually, I'm seeing the custom entries, plus a fifth line ("Ubuntu") and a sixth line ("Advanced options for Ubuntu"). This is fewer lines than appeared before making that change, but I didn't expect to see them. A title like "Ubuntu" -- without even a version number (though I know this is Trusty) -- is kind of useless. If it has to remain, I'd like to add the version number to the title, if possible. Then I'll be done.

I forgot to add that I can't figure out how I would make that change. Edits from within the grub menu are not saved. How or in which file would I be able to edit the title of non-custom menu entries?

Bashing-om
February 16th, 2015, 09:06 PM
watchpocket; Well;

The most important is what kernel you are presently booting:


uname -r


Ideally you want to keep the latest kernel, and one other for a back up. All others can be safely removed IF you are not booting with one of those old kernels.

When all done removing kernels, even though the routine is scripted, does not hurt a thing and is cheap insurance to look at what grub does individually:


sudo update-grub




ain't nothing but a thing

Cavsfan
February 16th, 2015, 09:31 PM
I agree with Bashing-om but I don't use auto-remove because I don't trust it to remove all parts of the kernel.
I keep all of my kernels on a text file and delete one when one is added keeping two.

Here is my (quite long) text file for Precise:

Upgraded Lucid Lynx 10.04 LTS to Precise Pangolin 12.04 LTS
(linux-headers-generic linux-image-generic get updated with each new kernel install)

sudo apt-get purge linux-headers-3.2.0-37 linux-headers-3.2.0-37-generic linux-image-3.2.0-37-generic - purged.

sudo apt-get purge linux-headers-3.2.0-38 linux-headers-3.2.0-38-generic linux-image-3.2.0-38-generic - purged.

sudo apt-get purge linux-headers-3.2.0-39 linux-headers-3.2.0-39-generic linux-image-3.2.0-39-generic - purged.

sudo apt-get purge linux-headers-3.2.0-40 linux-headers-3.2.0-40-generic linux-image-3.2.0-40-generic - purged.

sudo apt-get purge linux-headers-3.2.0-41 linux-headers-3.2.0-41-generic linux-image-3.2.0-41-generic - purged.

sudo apt-get purge linux-headers-3.2.0-43 linux-headers-3.2.0-43-generic linux-image-3.2.0-43-generic - purged.

sudo apt-get purge linux-headers-3.2.0-44 linux-headers-3.2.0-44-generic linux-image-3.2.0-44-generic - purged.

sudo apt-get purge linux-headers-3.2.0-45 linux-headers-3.2.0-45-generic linux-image-3.2.0-45-generic - purged.

sudo apt-get purge linux-headers-3.2.0-48 linux-headers-3.2.0-48-generic linux-image-3.2.0-48-generic - purged.

sudo apt-get purge linux-headers-3.2.0-49 linux-headers-3.2.0-49-generic linux-image-3.2.0-49-generic - purged.

sudo apt-get purge linux-headers-3.2.0-51 linux-headers-3.2.0-51-generic linux-image-3.2.0-51-generic - purged.

sudo apt-get purge linux-headers-3.2.0-52 linux-headers-3.2.0-52-generic linux-image-3.2.0-52-generic - purged.

sudo apt-get purge linux-headers-3.2.0-53 linux-headers-3.2.0-53-generic linux-image-3.2.0-53-generic - purged.

sudo apt-get purge linux-headers-3.2.0-54 linux-headers-3.2.0-54-generic linux-image-3.2.0-54-generic - purged.

sudo apt-get purge linux-headers-3.2.0-56 linux-headers-3.2.0-56-generic linux-image-3.2.0-56-generic - purged.

sudo apt-get purge linux-headers-3.2.0-57 linux-headers-3.2.0-57-generic linux-image-3.2.0-57-generic - purged.

sudo apt-get purge linux-headers-3.2.0-58 linux-headers-3.2.0-58-generic linux-image-3.2.0-58-generic - purged.

sudo apt-get purge linux-headers-3.2.0-59 linux-headers-3.2.0-59-generic linux-image-3.2.0-59-generic - purged.

sudo apt-get purge linux-headers-3.2.0-60 linux-headers-3.2.0-60-generic linux-image-3.2.0-60-generic - purged.

sudo apt-get purge linux-headers-3.2.0-61 linux-headers-3.2.0-61-generic linux-image-3.2.0-61-generic - purged.

sudo apt-get purge linux-headers-3.2.0-63 linux-headers-3.2.0-63-generic linux-image-3.2.0-63-generic - purged.

sudo apt-get purge linux-headers-3.2.0-64 linux-headers-3.2.0-64-generic linux-image-3.2.0-64-generic - purged.

sudo apt-get purge linux-headers-3.2.0-65 linux-headers-3.2.0-65-generic linux-image-3.2.0-65-generic - purged.

sudo apt-get purge linux-headers-3.2.0-67 linux-headers-3.2.0-67-generic linux-image-3.2.0-67-generic - purged.

sudo apt-get purge linux-headers-3.2.0-68 linux-headers-3.2.0-68-generic linux-image-3.2.0-68-generic - purged.

sudo apt-get purge linux-headers-3.2.0-69 linux-headers-3.2.0-69-generic linux-image-3.2.0-69-generic - purged.

sudo apt-get purge linux-headers-3.2.0-70 linux-headers-3.2.0-70-generic linux-image-3.2.0-70-generic - purged.

sudo apt-get purge linux-headers-3.2.0-72 linux-headers-3.2.0-72-generic linux-image-3.2.0-72-generic - purged.

sudo apt-get purge linux-headers-3.2.0-74 linux-headers-3.2.0-74-generic linux-image-3.2.0-74-generic - purged.

sudo apt-get purge linux-headers-3.2.0-75 linux-headers-3.2.0-75-generic linux-image-3.2.0-75-generic

sudo apt-get purge linux-headers-3.2.0-76 linux-headers-3.2.0-76-generic linux-image-3.2.0-76-generic

I guess I don't trust auto-remove because it only wants to remove a piece of the kernel and leave the other pieces.
Definitely on Precise like Bashing-om mentioned.

Here is my text file for Vivid: (versions after Precise added some extra parts as you're probably aware of)

linux-generic linux-headers-generic linux-image-generic

sudo apt-get purge linux-headers-3.18.0-9 linux-headers-3.18.0-9-generic linux-image-3.18.0-9-generic linux-image-extra-3.18.0-9-generic deleted

sudo apt-get purge linux-headers-3.18.0-11 linux-headers-3.18.0-11-generic linux-image-3.18.0-11-generic linux-image-extra-3.18.0-11-generic deleted

sudo apt-get purge linux-headers-3.18.0-12 linux-headers-3.18.0-12-generic linux-image-3.18.0-12-generic linux-image-extra-3.18.0-12-generic deleted

sudo apt-get purge linux-headers-3.18.0-13 linux-headers-3.18.0-13-generic linux-image-3.18.0-13-generic linux-image-extra-3.18.0-13-generic

This wil also show you which kernels you have installed too:

cavsfan@cavsfan-MS-7529:~$ dpkg -l | grep linux
ii libselinux1:amd64 2.3-2 amd64 SELinux runtime shared libraries
ii libv4l-0:amd64 1.6.0-2 amd64 Collection of video4linux support libraries
ii libv4lconvert0:amd64 1.6.0-2 amd64 Video4linux frame format conversion library
ii linux-firmware 1.141 all Firmware for Linux kernel drivers
ii linux-generic 3.18.0.13.13 amd64 Complete Generic Linux kernel and headers
ii linux-headers-3.18.0-13 3.18.0-13.14 all Header files related to Linux kernel version 3.18.0
ii linux-headers-3.18.0-13-generic 3.18.0-13.14 amd64 Linux kernel headers for version 3.18.0 on 64 bit x86 SMP
ii linux-headers-generic 3.18.0.13.13 amd64 Generic Linux kernel headers
ii linux-image-3.18.0-13-generic 3.18.0-13.14 amd64 Linux kernel image for version 3.18.0 on 64 bit x86 SMP
ii linux-image-extra-3.18.0-13-generic 3.18.0-13.14 amd64 Linux kernel extra modules for version 3.18.0 on 64 bit x86 SMP
ii linux-image-generic 3.18.0.13.13 amd64 Generic Linux kernel image
ii linux-libc-dev:amd64 3.18.0-13.14 amd64 Linux Kernel Headers for development
ii linux-sound-base 1.0.25+dfsg-0ubuntu4 all base package for ALSA and OSS sound systems
ii pptp-linux 1.7.2-7 amd64 Point-to-Point Tunneling Protocol (PPTP) Client
ii syslinux 3:6.03~pre18+dfsg-1ubuntu1 amd64 collection of bootloaders (DOS FAT and NTFS bootloader)
ii syslinux-common 3:6.03~pre18+dfsg-1ubuntu1 all collection of bootloaders (common)
ii syslinux-legacy 2:3.63+dfsg-2ubuntu5 amd64 Bootloader for Linux/i386 using MS-DOS floppies
ii util-linux 2.25.2-4ubuntu1 amd64 Miscellaneous system utilities


The red shows the parts that can be removed. You never want to remove linux-generic, linux-headers-generic or linux-image-generic.

I have searched and searched for who in this forum showed me this method but cannot find them. It was in their signature I'm pretty sure.
Here is a way to remove all previous kernels except the current one and there is a very important dry run flag so you can see what it will do before you actually do it.

This has the --dry-run switch to see what it would do:

dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | grep -E "(image|headers)" | xargs sudo apt-get --dry-run remove

Then if you're happy with the output and what will be deleted run this command without the --dry-run switch:


dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | grep -E "(image|headers)" | xargs sudo apt-get -y purge

I found this on this page step 6: http://tuxtweaks.com/2010/10/remove-old-kernels-in-ubuntu-with-one-command/

I ran it and since I have only one kernel it did not offer to delete anything. But I do like that --dry-run switch. :)

Cavsfan
February 16th, 2015, 09:40 PM
Before I do that, I just want to make sure: Does any functioning depend on the presence of old kernels? In other words, are new kernels built upon previous ones in any way? (Or do they -include- the functionality of a previous one?)

So if I remove an old kernel, there's nothing about doing that that will make the latest kernel lose any functionality, correct? Don't new kernels entirely replace old ones?

Nothing depends on previous kernels. I usally keep two but currently have just the latest. I have never in my 5-6 years dealing with Ubuntu had to boot into an old kernel.


I wrote, above:

Actually, I'm seeing the custom entries, plus a fifth line ("Ubuntu") and a sixth line ("Advanced options for Ubuntu"). This is fewer lines than appeared before making that change, but I didn't expect to see them. A title like "Ubuntu" -- without even a version number (though I know this is Trusty) -- is kind of useless. If it has to remain, I'd like to add the version number to the title, if possible. Then I'll be done.

I forgot to add that I can't figure out how I would make that change. Edits from within the grub menu are not saved. How or in which file would I be able to edit the title of non-custom menu entries?

As I mentioned, if you can boot into 12.04 and 14.04 just fine with the custom entries in /etc/grub.d/06_custom then make /etc/grub.d/10_linux and /etc/grub.d/30_os-prober unexecutable with these commands:


sudo chmod -x /etc/grub.d/10_linux && sudo chmod -x/etc/grub.d/30_os-prober && sudo update-grub

Reboot and you will only see the custom entries, which is the purpose of this wiki.

Cavsfan
February 16th, 2015, 09:45 PM
Here is what my grub screen looked like awhile back: I've since changed just the picture.

http://www.zimagez.com/miniature/20141226135835.jpg (http://www.zimagez.com/zimage/20141226135835.php)

watchpocket
February 16th, 2015, 11:15 PM
I've never seen this before, but doing a

sudo chmod -x /etc/grub.d/10_linux

returns this:
chmod: /etc/grub.d/10_linux: new permissions are rw-r-xr-x, not rw-r--r--

Darned if that file does not want to completely un-executable itself.

watchpocket
February 17th, 2015, 01:25 AM
Just to say I was able to purge all my old kernels with that long command. On Trusty, I purged everything except the current kernel (...-45). For some reason that command didn't purge 3.13.0-39, so I just purged that one individually with no ill effects.

On Precise, I decided not to use the long command and purged individually. I left -45, -44, memtest86+, and anything with the name "trusty" in it. During the purge process, two items that were deleted gave a slightly scary warning that they were active in the current kernel. They were my nvidea driver and an nvidea updates file (which drivers btw on trusty made everything weird, so I'm using the free nouveau driver there). So before re-booting, I just went into synaptic and made sure to mark those 2 items for re-install, then hit apply. I re-booted into Precise and all was well.

I'll now refrain from hijacking this grub thread (speaking of which, that non-un-executability still has me scratching my head) with side-talk of old kernels. Thanks loads Cavsfan and bashing-om (great name, btw).

Bashing-om
February 17th, 2015, 02:16 AM
watchpocket; Well,

Final cleanup:


dpkg -l | grep linux-

Those packages marked 'rc',
While there is no built in way to remove all of your configuration information from your removed packages you can remove all configuration data from every removed package with the following command.
where the state is 'rc', the package is removed, but the config files are not removed:


dpkg --list |grep "^rc" | cut -d " " -f 3 | xargs sudo dpkg --purge



I expect now



distinct aroma of a rose

watchpocket
February 17th, 2015, 03:17 AM
This is both the commands run In trusty (not precise):


--> dpkg -l | grep linux- pts/1 Monday 2015-02-16 20:51:31
ii linux-firmware 1.127.11 all Firmware for Linux kernel drivers
ii linux-generic 3.13.0.45.52 amd64 Complete Generic Linux kernel and headers
ii linux-headers-3.13.0-45 3.13.0-45.74 all Header files related to Linux kernel version 3.13.0
ii linux-headers-3.13.0-45-generic 3.13.0-45.74 amd64 Linux kernel headers for version 3.13.0 on 64 bit x86 SMP
ii linux-headers-generic 3.13.0.45.52 amd64 Generic Linux kernel headers
ii linux-image-3.13.0-45-generic 3.13.0-45.74 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii linux-image-extra-3.13.0-45-generic 3.13.0-45.74 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
ii linux-image-generic 3.13.0.45.52 amd64 Generic Linux kernel image
ii linux-libc-dev:amd64 3.13.0-45.74 amd64 Linux Kernel Headers for development
ii linux-sound-base 1.0.25+dfsg-0ubuntu4 all base package for ALSA and OSS sound systems
ii syslinux-common 3:4.05+dfsg-6+deb8u1 all collection of boot loaders (common files)
ii syslinux-legacy 2:3.63+dfsg-2ubuntu5 amd64 Bootloader for Linux/i386 using MS-DOS floppies

Do I really want to remove all of the below? These are all config files with ".rc" at the end? (That must be what the "rc" in each file's far left column indicates. Btw, what does the "ii" refer to in the left column above?)


--> dpkg -l |grep "^rc" pts/1 Monday 2015-02-16 20:54:09
rc dkms 2.2.0.3-1.1ubuntu5.14.04 all Dynamic Kernel Module Support Framework
rc lib32gcc1 1:4.9.1-0ubuntu1 amd64 GCC support library (32 bit Version)
rc libc6-i386 2.19-0ubuntu6.5 amd64 Embedded GNU C Library: 32-bit shared libraries for AMD64
rc libcuda1-331 331.113-0ubuntu0.0.4 amd64 NVIDIA CUDA runtime library
rc libcuda1-331-updates 331.113-0ubuntu0.0.4 amd64 NVIDIA CUDA runtime library
rc libcuda1-346 346.35-0ubuntu1~system76~14.04.2 amd64 NVIDIA CUDA runtime library
rc libvdpau1:amd64 0.7-1 amd64 Video Decode and Presentation API for Unix (libraries)
rc ocl-icd-libopencl1:amd64 2.1.3-4 amd64 Generic OpenCL ICD Loader
rc packagekit 0.8.12-1ubuntu5 amd64 Provides a package management service
rc screen-resolution-extra 0.17.1 all Extension for the GNOME screen resolution applet
rc unity-webapps-common 2.4.17+14.04.20140416-0ubuntu1 all Unity WebApp integration scripts
rc unity-webapps-launchpad 2.4.16+13.10.20130924.2-0ubuntu1 all Unity Webapp for Launchpad

Bashing-om
February 17th, 2015, 03:35 AM
watchpocket; Hey:

In respect to 'rc' packages, I would remove them ..
'rc' mark is (r)emoved but (c)onfig files remain.
'ii' mark is (i)install [desired] (i)nstalled [Status].

Do:


dpkg -l "linux-image*"
for instance; and see the header of the output for an explanation of what the 1st column's 4 possible indices mean ( here we are only discussing 2 of those fields) .



so much to know about the package manager - wonder to behold

watchpocket
February 17th, 2015, 05:11 AM
watchpocket; Hey:
In respect to 'rc' packages, I would remove them ..

Done.

There are, however, 2 possibly curious files in my root dir (where everything else is a directory): an "initrd.img" file -- an "18.3 MiB Link to Raw disk image" (looking at its properties, its Link target is "boot/initrd.img-3.13.0-45-generic); and a "vmlinuz" file, a "5.5 MiB Link to unknown". Looking at its properties, its Link target is "boot/vmlinuz-3.13.0-45-generic".)

They both link to files in the /boot dir. Should I assume it's OK that they're there in / ? I guess the "link to unknown" part bothers me a bit, but maybe it shouldn't. I do notice that these same link files are in the root dir of both my Trusty and my Precise.


'rc' mark is (r)emoved but (c)onfig files remain.
'ii' mark is (i)install [desired] (i)nstalled [Status].

Do:


dpkg -l "linux-image*"
for instance; and see the header of the output for an explanation of what the 1st column's 4 possible indices mean ( here we are only discussing 2 of those fields) .
Wow. Very interesting and very helpful.

so much to know about the package manager - wonder to behold
Truly! Thank you!

Cavsfan
February 17th, 2015, 07:13 PM
I've never seen this before, but doing a

sudo chmod -x /etc/grub.d/10_linux

returns this:
chmod: /etc/grub.d/10_linux: new permissions are rw-r-xr-x, not rw-r--r--

Darned if that file does not want to completely un-executable itself.

That is odd. Are you sure you are not logged into a restricted account?

Enter this in terminal sudo cat /etc/group | grep <your user name> and make sure you're in sudo group.


cavsfan@cavsfan-MS-7529:~$ sudo cat /etc/group | grep cavsfan
adm:x:4:syslog,cavsfan
cdrom:x:24:cavsfan
sudo:x:27:cavsfan
dip:x:30:cavsfan
plugdev:x:46:cavsfan
lpadmin:x:114:cavsfan
cavsfan:x:1000:
sambashare:x:130:cavsfan



If so try this: (give owner root read/write, group and others read only and non executable.)
sudo chmod 644 /etc/grub.d/10_linux likewise with sudo chmod 644 /etc/grub.d/30_os-prober if you have not already got that unexecutable.

If that does not do the trick try this:
in terminal enter gksudo nautilus and enter your password

Then maneuver to /etc/grub.d/ and then right click on 10_linux and go to properties.
Then click the middle tab Permissions.
Uncheck the Execute box at the bottom.
Also do the same to 30_os-prober and 20_memtest86+ if that's needs to be done.
Then close nautilus.

Then in terminal:

Enter cd /etc/grub.d/
Then enter ls -l


It should show 10_linux, 20_memtest86+ and 30_os-prober as white meaning not executable, while green means executable.

Then of course enter sudo update-grub and see if just the custom entries apear in the list.
It should list the picture name you have in /boot/grub/ and show what you have put on the 2nd line of /etc/grub.d/06_custom between the quotes and nothing else.

Cavsfan
February 17th, 2015, 07:23 PM
That is a nice little command to remove the config files Bashing-om.
I might try that on Precise as I probably have tons of those there. The above is on Vivid with few config files hanging.

I always do sudo apt-get purge <package-name> to remove the config files and the package instead of sudo apt-get remove <package-name>, which will leave the config files.
But, we can't control what is auto removed.

watchpocket
February 17th, 2015, 07:52 PM
[ . . . ]
If so try this: (give owner root read/write, group and others read only and non executable.)
sudo chmod 644 /etc/grub.d/10_linux likewise with sudo chmod 644 /etc/grub.d/30_os-prober if you have not already got that unexecutable.

If that does not do the trick
[ . . . ]

It did the trick. It was only that file that was being stubborn, and that last command made it unexecutable. So I sudo upgrade-grub'd and re-booted to see that I now finally have just the custom entries in the grub menu. My god, you're a lifesaver. I bow to you.

My /etc/group read-out btw was indentical to yours. I think I'm done with grub questions now, though I still don't understand why changing permissions from sudo didn't work. Superuser itself must not have had full write permissions. Thanks again for all this problem-solving.

Cavsfan
February 17th, 2015, 11:19 PM
[ . . . ]
If so try this: (give owner root read/write, group and others read only and non executable.)
sudo chmod 644 /etc/grub.d/10_linux likewise with sudo chmod 644 /etc/grub.d/30_os-prober if you have not already got that unexecutable.

If that does not do the trick
[ . . . ]


It did the trick. It was only that file that was being stubborn, and that last command made it unexecutable. So I sudo upgrade-grub'd and re-booted to see that I now finally have just the custom entries in the grub menu. My god, you're a lifesaver. I bow to you.

My /etc/group read-out btw was identical to yours. I think I'm done with grub questions now, though I still don't understand why changing permissions from sudo didn't work. Superuser itself must not have had full write permissions. Thanks again for all this problem-solving.

You are very welcome! :) Glad you got the problem solved and now have a custom grub menu. :popcorn:
Now you will never have to do anything unless you remove or add another Linux system. It will always boot into the latest kernel and it will never let you down.

Feel free at any time to post a question about this custom grub wiki here.

You can change pictures as you please, just remove the one you have as it looks for the first one it finds.

You can also change the font colors to match the picture too. Some times it gets boring and time for a change with the picture and colors.

Cheers :)

watchpocket
February 18th, 2015, 12:20 AM
And a whole lot more, it appears. There's always this (https://www.gnu.org/software/grub/manual/grub.html#Theme-file-format) to dig into for getting really fancy. ;)

Bashing-om
February 18th, 2015, 05:23 PM
watchpocket; Hey;

I somehow missed this:


There are, however, 2 possibly curious files in my root dir (where everything else is a directory): an "initrd.img" file -- an "18.3 MiB Link to Raw disk image" (looking at its properties, its Link target is "boot/initrd.img-3.13.0-45-generic); and a "vmlinuz" file, a "5.5 MiB Link to unknown". Looking at its properties, its Link target is "boot/vmlinuz-3.13.0-45-generic".)

The link to "unknown" just is not right.
Is it still present ?
let's look:


ls -al /
ls -al /boot

where I expect only 4 symlinks (2 current - vmlinuz & initrd.img and 2 for XXX.old - ) that they point to valid files in '/boot' .

when things are not as I expect



I do get into my learning mode

Cavsfan
February 18th, 2015, 05:31 PM
And a whole lot more, it appears. There's always this (https://www.gnu.org/software/grub/manual/grub.html#Theme-file-format) to dig into for getting really fancy. ;)

Feel free to delve into that. I'm keeping this wiki as simple as I can though. It already scares some people away.
But, once you understand what you have to do it gets a lot simpler and there are only a few steps to the process.

I say if it aint broke why fix it? ;)

Cavsfan
February 18th, 2015, 06:29 PM
watchpocket; Hey;

I somehow missed this:

The link to "unknown" just is not right.
Is it still present ?
let's look:


ls -al /
ls -al /boot

where I expect only 4 symlinks (2 current - vmlinuz & initrd.img and 2 for XXX.old - ) that they point to valid files in '/boot' .

when things are not as I expect


I do get into my learning mode





They must be valid or else watchpocket would not be able to boot into those systems as the custom grub uses those symlinks.
At least the one that points to the most currently installed kernel.

Bashing-om
February 18th, 2015, 07:15 PM
@Cavsfan; Agreed;


They must be valid or else watchpocket would not be able to boot into those systems as the custom grub uses those symlinks.
At least the one that points to the most currently installed kernel.

Just to make sure things a tidy.




clean is clean

watchpocket
February 18th, 2015, 08:04 PM
The link to "unknown" just is not right.
Is it still present ?
let's look:


ls -al /
ls -al /boot

where I expect only 4 symlinks (2 current - vmlinuz & initrd.img and 2 for XXX.old - ) that they point to valid files in '/boot' .


In Precise:
--> ls -la /
total 116
4 drwxr-xr-x 26 root root 4096 Feb 11 01:22 ./
4 drwxr-xr-x 26 root root 4096 Feb 11 01:22 ../
4 drwxr-xr-x 2 root root 4096 Jul 18 2014 .rpmdb/
4 drwxr-xr-x 2 root root 4096 Feb 11 01:22 bin/
4 drwxr-xr-x 4 root root 4096 Feb 16 18:56 boot/
4 drwxr-xr-x 2 root root 4096 Jan 11 2014 cdrom/
0 drwxr-xr-x 15 root root 4380 Feb 18 13:28 dev/
12 drwxr-xr-x 152 root root 12288 Feb 18 13:28 etc/
4 drwxr-xr-x 3 root root 4096 Jan 11 2014 home/
0 lrwxrwxrwx 1 root root 33 Feb 11 01:22 initrd.img -> boot/initrd.img-3.13.0-45-generic
0 lrwxrwxrwx 1 root root 33 Jan 16 14:30 initrd.img.old -> boot/initrd.img-3.13.0-44-generic
4 drwxr-xr-x 26 root root 4096 Feb 16 18:32 lib/
4 drwxr-xr-x 2 root root 4096 Feb 3 14:16 lib32/
4 drwxr-xr-x 2 root root 4096 Feb 3 14:16 lib64/
16 drwx------ 2 root root 16384 Jan 11 2014 lost+found/
4 drwxr-xr-x 2 root root 4096 Feb 16 22:24 media/
4 drwxr-xr-x 2 root root 4096 Apr 19 2012 mnt/
4 drwxr-xr-x 4 root root 4096 Jul 6 2014 opt/
0 dr-xr-xr-x 201 root root 0 Feb 18 13:27 proc/
4 drwx------ 13 root root 4096 Feb 16 18:32 root/
0 drwxr-xr-x 21 root root 820 Feb 18 13:28 run/
12 drwxr-xr-x 2 root root 12288 Feb 11 22:29 sbin/
4 drwxr-xr-x 2 root root 4096 Mar 5 2012 selinux/
4 drwxr-xr-x 2 root root 4096 Aug 20 2013 srv/
0 dr-xr-xr-x 13 root root 0 Feb 18 13:27 sys/
4 drwxrwxrwt 8 root root 4096 Feb 18 13:48 tmp/
4 drwxr-xr-x 11 root root 4096 Dec 14 18:48 usr/
4 drwxr-xr-x 13 root root 4096 Feb 17 01:05 var/
0 lrwxrwxrwx 1 root root 30 Feb 11 01:22 vmlinuz -> boot/vmlinuz-3.13.0-45-generic
0 lrwxrwxrwx 1 root root 30 Jan 16 14:30 vmlinuz.old -> boot/vmlinuz-3.13.0-44-generic

--> lf /boot
total 58368
4 drwxr-xr-x 4 root root 4096 Feb 16 18:56 ./
4 drwxr-xr-x 26 root root 4096 Feb 11 01:22 ../
3444 -rw------- 1 root root 3525141 Dec 16 19:55 System.map-3.13.0-44-generic
3444 -rw------- 1 root root 3525572 Jan 15 15:46 System.map-3.13.0-45-generic
1140 -rw-r--r-- 1 root root 1164720 Dec 16 19:55 abi-3.13.0-44-generic
1140 -rw-r--r-- 1 root root 1164967 Jan 15 15:46 abi-3.13.0-45-generic
164 -rw-r--r-- 1 root root 165757 Dec 16 19:55 config-3.13.0-44-generic
164 -rw-r--r-- 1 root root 165757 Jan 15 15:46 config-3.13.0-45-generic
4 drwxr-xr-x 3 root root 4096 Feb 16 18:56 extlinux/
12 drwxr-xr-x 3 root root 12288 Feb 16 19:03 grub/
18484 -rw-r--r-- 1 root root 18920653 Jan 16 14:31 initrd.img-3.13.0-44-generic
18484 -rw-r--r-- 1 root root 18927341 Feb 16 18:34 initrd.img-3.13.0-45-generic
176 -rw-r--r-- 1 root root 176764 Nov 27 2011 memtest86+.bin
176 -rw-r--r-- 1 root root 178944 Nov 27 2011 memtest86+_multiboot.bin
5764 -rw------- 1 root root 5896992 Dec 16 19:55 vmlinuz-3.13.0-44-generic
5764 -rw------- 1 root root 5898624 Jan 15 15:46 vmlinuz-3.13.0-45-generic

watchpocket
February 18th, 2015, 08:12 PM
let's look:


ls -al /
ls -al /boot

where I expect only 4 symlinks (2 current - vmlinuz & initrd.img and 2 for XXX.old - ) that they point to valid files in '/boot' .


And in Trusty:
~$ ls -la /
total 108
drwxr-xr-x 24 root root 4096 Feb 17 02:09 .
drwxr-xr-x 24 root root 4096 Feb 17 02:09 ..
drwxr-xr-x 2 root root 4096 Feb 17 14:03 bin
drwxr-xr-x 3 root root 4096 Feb 16 17:40 boot
drwxrwxr-x 2 root root 4096 Jan 19 00:27 cdrom
drwxr-xr-x 15 root root 4220 Feb 18 14:06 dev
drwxr-xr-x 140 root root 12288 Feb 18 14:06 etc
drwxr-xr-x 3 root root 4096 Jan 19 00:27 home
lrwxrwxrwx 1 root root 33 Jan 30 15:14 initrd.img -> boot/initrd.img-3.13.0-45-generic
drwxr-xr-x 24 root root 4096 Feb 17 02:09 lib
drwxr-xr-x 2 root root 4096 Feb 17 02:09 lib64
drwxr-xr-x 2 root root 4096 Feb 17 02:09 libx32
drwx------ 2 root root 16384 Jan 19 00:24 lost+found
drwxr-xr-x 3 root root 4096 Jan 19 13:59 media
drwxr-xr-x 2 root root 4096 Apr 10 2014 mnt
drwxr-xr-x 3 root root 4096 Jan 25 00:59 opt
dr-xr-xr-x 191 root root 0 Feb 18 14:06 proc
drwx------ 8 root root 4096 Feb 17 13:30 root
drwxr-xr-x 24 root root 840 Feb 18 14:07 run
drwxr-xr-x 2 root root 12288 Feb 12 21:49 sbin
drwxr-xr-x 2 root root 4096 Nov 5 08:16 srv
dr-xr-xr-x 13 root root 0 Feb 18 14:06 sys
drwxrwxrwt 6 root root 4096 Feb 18 14:06 tmp
drwxr-xr-x 12 root root 4096 Feb 17 02:09 usr
drwxr-xr-x 13 root root 4096 Nov 11 10:11 var
lrwxrwxrwx 1 root root 30 Jan 30 15:14 vmlinuz -> boot/vmlinuz-3.13.0-45-generic
~$
~$ ls -la /boot
total 29604
drwxr-xr-x 3 root root 4096 Feb 16 17:40 .
drwxr-xr-x 24 root root 4096 Feb 17 02:09 ..
-rw-r--r-- 1 root root 1164967 Jan 13 15:12 abi-3.13.0-45-generic
-rw-r--r-- 1 root root 165748 Jan 13 15:12 config-3.13.0-45-generic
drwxr-xr-x 5 root root 4096 Feb 17 13:34 grub
-rw-r--r-- 1 root root 19217318 Feb 12 01:16 initrd.img-3.13.0-45-generic
-rw-r--r-- 1 root root 176500 Mar 12 2014 memtest86+.bin
-rw-r--r-- 1 root root 178176 Mar 12 2014 memtest86+.elf
-rw-r--r-- 1 root root 178680 Mar 12 2014 memtest86+_multiboot.bin
-rw------- 1 root root 3389258 Jan 13 15:12 System.map-3.13.0-45-generic
-rw------- 1 root root 5814112 Jan 13 15:12 vmlinuz-3.13.0-45-generic
~$

If something is wrong here, it may be why I'm seeing that half the time when I log into Trusty (Ubuntu-MATE) I get to the logo (before the login screen) with 5 dots below it that turn from green to white, left to right. Half the time after the dots turn white, it hangs and I have to re-boot with the reset button.

(The code above is looking at the root dir from in the terminal. The only place where I see "5.5 MiB Link to unknown" is beside the vmlinuz file, in the "Type" column, when looking at the root dir in the Ubuntu-MATE "Caja" file-viewer (MATE's equivalent of Nautilus. There are other files in other dirs that the file-viewer also seems not to recognize their type and so has "unknown" for, e.g. a binary file or any other kind of file it seems not to recognize.)

Cavsfan
February 18th, 2015, 08:39 PM
In Precise:
--> ls -la /
total 116
4 drwxr-xr-x 26 root root 4096 Feb 11 01:22 ./
4 drwxr-xr-x 26 root root 4096 Feb 11 01:22 ../
4 drwxr-xr-x 2 root root 4096 Jul 18 2014 .rpmdb/
4 drwxr-xr-x 2 root root 4096 Feb 11 01:22 bin/
4 drwxr-xr-x 4 root root 4096 Feb 16 18:56 boot/
4 drwxr-xr-x 2 root root 4096 Jan 11 2014 cdrom/
0 drwxr-xr-x 15 root root 4380 Feb 18 13:28 dev/
12 drwxr-xr-x 152 root root 12288 Feb 18 13:28 etc/
4 drwxr-xr-x 3 root root 4096 Jan 11 2014 home/
0 lrwxrwxrwx 1 root root 33 Feb 11 01:22 initrd.img -> boot/initrd.img-3.13.0-45-generic
0 lrwxrwxrwx 1 root root 33 Jan 16 14:30 initrd.img.old -> boot/initrd.img-3.13.0-44-generic
4 drwxr-xr-x 26 root root 4096 Feb 16 18:32 lib/
4 drwxr-xr-x 2 root root 4096 Feb 3 14:16 lib32/
4 drwxr-xr-x 2 root root 4096 Feb 3 14:16 lib64/
16 drwx------ 2 root root 16384 Jan 11 2014 lost+found/
4 drwxr-xr-x 2 root root 4096 Feb 16 22:24 media/
4 drwxr-xr-x 2 root root 4096 Apr 19 2012 mnt/
4 drwxr-xr-x 4 root root 4096 Jul 6 2014 opt/
0 dr-xr-xr-x 201 root root 0 Feb 18 13:27 proc/
4 drwx------ 13 root root 4096 Feb 16 18:32 root/
0 drwxr-xr-x 21 root root 820 Feb 18 13:28 run/
12 drwxr-xr-x 2 root root 12288 Feb 11 22:29 sbin/
4 drwxr-xr-x 2 root root 4096 Mar 5 2012 selinux/
4 drwxr-xr-x 2 root root 4096 Aug 20 2013 srv/
0 dr-xr-xr-x 13 root root 0 Feb 18 13:27 sys/
4 drwxrwxrwt 8 root root 4096 Feb 18 13:48 tmp/
4 drwxr-xr-x 11 root root 4096 Dec 14 18:48 usr/
4 drwxr-xr-x 13 root root 4096 Feb 17 01:05 var/
0 lrwxrwxrwx 1 root root 30 Feb 11 01:22 vmlinuz -> boot/vmlinuz-3.13.0-45-generic
0 lrwxrwxrwx 1 root root 30 Jan 16 14:30 vmlinuz.old -> boot/vmlinuz-3.13.0-44-generic

--> lf /boot
total 58368
4 drwxr-xr-x 4 root root 4096 Feb 16 18:56 ./
4 drwxr-xr-x 26 root root 4096 Feb 11 01:22 ../
3444 -rw------- 1 root root 3525141 Dec 16 19:55 System.map-3.13.0-44-generic
3444 -rw------- 1 root root 3525572 Jan 15 15:46 System.map-3.13.0-45-generic
1140 -rw-r--r-- 1 root root 1164720 Dec 16 19:55 abi-3.13.0-44-generic
1140 -rw-r--r-- 1 root root 1164967 Jan 15 15:46 abi-3.13.0-45-generic
164 -rw-r--r-- 1 root root 165757 Dec 16 19:55 config-3.13.0-44-generic
164 -rw-r--r-- 1 root root 165757 Jan 15 15:46 config-3.13.0-45-generic
4 drwxr-xr-x 3 root root 4096 Feb 16 18:56 extlinux/
12 drwxr-xr-x 3 root root 12288 Feb 16 19:03 grub/
18484 -rw-r--r-- 1 root root 18920653 Jan 16 14:31 initrd.img-3.13.0-44-generic
18484 -rw-r--r-- 1 root root 18927341 Feb 16 18:34 initrd.img-3.13.0-45-generic
176 -rw-r--r-- 1 root root 176764 Nov 27 2011 memtest86+.bin
176 -rw-r--r-- 1 root root 178944 Nov 27 2011 memtest86+_multiboot.bin
5764 -rw------- 1 root root 5896992 Dec 16 19:55 vmlinuz-3.13.0-44-generic
5764 -rw------- 1 root root 5898624 Jan 15 15:46 vmlinuz-3.13.0-45-generic




And in Trusty:
~$ ls -la /
total 108
drwxr-xr-x 24 root root 4096 Feb 17 02:09 .
drwxr-xr-x 24 root root 4096 Feb 17 02:09 ..
drwxr-xr-x 2 root root 4096 Feb 17 14:03 bin
drwxr-xr-x 3 root root 4096 Feb 16 17:40 boot
drwxrwxr-x 2 root root 4096 Jan 19 00:27 cdrom
drwxr-xr-x 15 root root 4220 Feb 18 14:06 dev
drwxr-xr-x 140 root root 12288 Feb 18 14:06 etc
drwxr-xr-x 3 root root 4096 Jan 19 00:27 home
lrwxrwxrwx 1 root root 33 Jan 30 15:14 initrd.img -> boot/initrd.img-3.13.0-45-generic
drwxr-xr-x 24 root root 4096 Feb 17 02:09 lib
drwxr-xr-x 2 root root 4096 Feb 17 02:09 lib64
drwxr-xr-x 2 root root 4096 Feb 17 02:09 libx32
drwx------ 2 root root 16384 Jan 19 00:24 lost+found
drwxr-xr-x 3 root root 4096 Jan 19 13:59 media
drwxr-xr-x 2 root root 4096 Apr 10 2014 mnt
drwxr-xr-x 3 root root 4096 Jan 25 00:59 opt
dr-xr-xr-x 191 root root 0 Feb 18 14:06 proc
drwx------ 8 root root 4096 Feb 17 13:30 root
drwxr-xr-x 24 root root 840 Feb 18 14:07 run
drwxr-xr-x 2 root root 12288 Feb 12 21:49 sbin
drwxr-xr-x 2 root root 4096 Nov 5 08:16 srv
dr-xr-xr-x 13 root root 0 Feb 18 14:06 sys
drwxrwxrwt 6 root root 4096 Feb 18 14:06 tmp
drwxr-xr-x 12 root root 4096 Feb 17 02:09 usr
drwxr-xr-x 13 root root 4096 Nov 11 10:11 var
lrwxrwxrwx 1 root root 30 Jan 30 15:14 vmlinuz -> boot/vmlinuz-3.13.0-45-generic
~$
~$ ls -la /boot
total 29604
drwxr-xr-x 3 root root 4096 Feb 16 17:40 .
drwxr-xr-x 24 root root 4096 Feb 17 02:09 ..
-rw-r--r-- 1 root root 1164967 Jan 13 15:12 abi-3.13.0-45-generic
-rw-r--r-- 1 root root 165748 Jan 13 15:12 config-3.13.0-45-generic
drwxr-xr-x 5 root root 4096 Feb 17 13:34 grub
-rw-r--r-- 1 root root 19217318 Feb 12 01:16 initrd.img-3.13.0-45-generic
-rw-r--r-- 1 root root 176500 Mar 12 2014 memtest86+.bin
-rw-r--r-- 1 root root 178176 Mar 12 2014 memtest86+.elf
-rw-r--r-- 1 root root 178680 Mar 12 2014 memtest86+_multiboot.bin
-rw------- 1 root root 3389258 Jan 13 15:12 System.map-3.13.0-45-generic
-rw------- 1 root root 5814112 Jan 13 15:12 vmlinuz-3.13.0-45-generic
~$

If something is wrong here, it may be why I'm seeing that half the time when I log into Trusty (Ubuntu-MATE) I get to the logo (before the login screen) with 5 dots below it that turn from green to white, left to right. Half the time after the dots turn white, it hangs and I have to re-boot with the reset button.

I don't see anything wrong here. You only customized one install right? Where you entered sudo grub-install /dev/sdX (X being a or b for which hard drive it is 1 or 2).

Could you post the contents of 06_custom from the system that grub is customized on like this cat /etc/grub.d/06_custom

Also cat /etc/fstab and sudo blkid as well?

Bashing-om
February 18th, 2015, 08:44 PM
watchpocket; Welp; ....

Precise install looks good .
The trusty install, ya took out the backup kernel, -44, I honestly do not know that to be the factor or not. Let's await the next kernel update/install and see what results ( or if ya want can install the -44 kernel) ===>>
But, I think that is a subject for a new thread. Let's not deviate too far from Cavsfan's topic !
For now, rather then doing that bad bad bad hard reset:
The elephants !
http://en.wikipedia.org/wiki/Magic_SysRq_key#Uses
http://unix.stackexchange.com/questions/31818/what-to-do-when-a-linux-desktop-freezes
My sequence ctl+alt+sysrq+ rseiub ( Raising Skinny Elephants Is Utterly Boring); others exist. To reboot, replace the 'b' with 'o' to turn Off.



if I knew everything



I would not be me

watchpocket
February 18th, 2015, 08:50 PM
Will post more late tonight or tomorrow, time to shut down and get into my office where I can only post from a windows machine. Meanwhile see recent edit at the bottom of my previous post, thanks.

Cavsfan
February 18th, 2015, 09:22 PM
Will post more late tonight or tomorrow, time to shut down and get into my office where I can only post from a windows machine. Meanwhile see recent edit at the bottom of my previous post, thanks.

I am in Trusty and my kernel links look the same as yours:

cavsfan@cavsfan-desktop:/$ ls -l | grep -e "initrd" -e "vmlinuz"
lrwxrwxrwx 1 root root 33 Jan 30 17:41 initrd.img -> boot/initrd.img-3.13.0-45-generic
lrwxrwxrwx 1 root root 33 Jan 13 15:07 initrd.img.old -> boot/initrd.img-3.13.0-44-generic
lrwxrwxrwx 1 root root 30 Jan 30 17:41 vmlinuz -> boot/vmlinuz-3.13.0-45-generic
lrwxrwxrwx 1 root root 30 Jan 13 15:07 vmlinuz.old -> boot/vmlinuz-3.13.0-44-generic


cavsfan@cavsfan-desktop:/$ cd /boot
cavsfan@cavsfan-desktop:/boot$ ls -l | grep -e "initrd" -e "vmlinuz"
-rw-r--r-- 1 root root 19203798 Jan 13 15:21 initrd.img-3.13.0-44-generic
-rw-r--r-- 1 root root 19213826 Jan 30 17:43 initrd.img-3.13.0-45-generic
-rw------- 1 root root 5814496 Dec 15 20:17 vmlinuz-3.13.0-44-generic
-rw------- 1 root root 5814112 Jan 13 15:12 vmlinuz-3.13.0-45-generic

I see no need for you to re-install the 3.13.0-44-generic kernel and most probably you can't do it if you wanted to.
But if you did, it would become the one you boot from, which is not what you want. Newer kernels have updates in them such as security fixes etc.

It is the latest kernel that is installed that you will boot from and not the highest numbered kernel.

So, the question will be in which Ubuntu Precise or Trusty that grub is installed on.
Also the contents of sudo blkid and 06_custom on that system as well as the /etc/fstab files on both systems.

But, when you do that hard reset to restart your computer, then are you able to get into Trusty Mate normally?

watchpocket
February 19th, 2015, 01:16 AM
I don't see anything wrong here. You only customized one install right?

That's right. I did not touch (and have never tried to modify) my Precise's grub, which is version 1.99 "legacy" grub. The other day, for just a second, I found it alarming that, while I was in Trusty's grub, at the grub command-line, I entered "exit" and was immediately put into the older 1.99 purple-backgrounded Precise grub menu. But then I thought, "what did I expect? I just exited Trusty's grub (the newer "2.02~beta2-9ubuntu1" grub).

Just to say again that the word "unknown" only appeared under "type" in the file-viewer, not when looking at the same directories in the terminal.


Where you entered sudo grub-install /dev/sdX (X being a or b for which hard drive it is 1 or 2).

Oh, it was definitely on dev/sda where Trusty is.


Could you post the contents of 06_custom from the system that grub is customized on like this cat /etc/grub.d/06_custom

Also cat /etc/fstab and sudo blkid as well?

I'll do this by or before 3:50 tomorrow (Thursday) afternoon.

watchpocket
February 19th, 2015, 02:06 AM
The trusty install, ya took out the backup kernel, -44,

That was deliberate.


I honestly do not know that to be the factor or not.

I'm guessing no, or Cavsfan wouldn't have OK'd it.


. . . or if ya want can install the -44 kernel) ===>>

Mm, I probably wouldn't do that. I do have both the -45 and -44 kernels on Precise.


For now, rather then doing that bad bad bad hard reset:
The elephants !
http://en.wikipedia.org/wiki/Magic_SysRq_key#Uses
http://unix.stackexchange.com/questions/31818/what-to-do-when-a-linux-desktop-freezes
My sequence ctl+alt+sysrq+ rseiub ( Raising Skinny Elephants Is Utterly Boring); others exist. To reboot, replace the 'b' with 'o' to turn Off.

I can't believe I've never heard of this until now. Thank you!

No more using re-set -- I always got a vaguely bad feeling having to do that.

Bashing-om
February 19th, 2015, 02:58 AM
watchpocket; :)

All good.


I can't believe I've never heard of this until now. Thank you!

See what hanging out in the right places gets you .



The Forum



knowledge abounds

watchpocket
February 19th, 2015, 03:33 AM
It is the latest kernel that is installed that you will boot from and not the highest numbered kernel.

Good to know.


So, the question will be in which Ubuntu Precise or Trusty that grub is installed on.

New grub (v2.02) is on Trusty. That's the one I modified. Old grub (v1.99) is on Precise.


Also the contents of sudo blkid and 06_custom on that system as well as the /etc/fstab files on both systems.

Will post asap (tomorrow -- Thursday -- afternoon).


But, when you do that hard reset to restart your computer, then are you able to get into Trusty Mate normally?

Yes. But the freeze is happening almost every other boot-in (to Trusty, not Precise). Doing a re-set login after the freeze does not produce a freeze again. Only when booting normally. I'd say about every third or fourth attempt to boot.

watchpocket
February 19th, 2015, 04:22 AM
My sequence ctl+alt+sysrq+ rseiub ( Raising Skinny Elephants Is Utterly Boring); others exist.

But why <ctl> along with the <alt> and <SysRq> keys? The wikipedia entry you linked to says:


Hold down the Alt and SysRq (Print Screen) keys.

While holding those down, type the following keys in order, several seconds apart: REISUB
Computer should reboot.

and nothing about holding down <ctl>.
Also, any particular reason for the order r-s-e-i-u-b instead of r-e-i-s-u-b ? Is it just that you prefer the "Raising Skinny Elephants Is Utterly Boring" as a mnemonic device as opposed to remembering that "reisub" is "busier" spelled backwards?

watchpocket
February 19th, 2015, 07:56 AM
Also the contents of sudo blkid and 06_custom on that system as well as the /etc/fstab files on both systems.

First, here is the output of all three of the above commands entered in Trusty:

~$ sudo blkid
/dev/sda1: LABEL="UbuntuMATE-14.04" UUID="1742aa67-b8ce-45d2-94ca-05e3579f7e2f" TYPE="ext4"
/dev/sda2: UUID="a88c33fd-88b5-43b2-92f6-457430d206fd" TYPE="swap"
/dev/sdb1: LABEL="Ubuntu-12.04.5" UUID="4d4f7665-f633-4409-82f9-af43d0143823" TYPE="ext4"
/dev/sdb2: UUID="106dae89-e837-4063-9f9c-bcdeae4b2d5a" TYPE="swap"
/dev/sdc1: LABEL="WeirdBeard" UUID="c801726e-7a01-4963-989a-38482e6658cf" TYPE="ext4"



~$ cat /etc/grub.d/06_custom
#!/bin/sh
echo 1>&2 "Adding Ubuntu-MATE 14.04 (Trusty Tahr) and Ubuntu 12.04 (Precise Pangolin)"
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 "Ubuntu-MATE 14.04 (Trusty Tahr)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro quiet splash
initrd /initrd.img
}
menuentry "Ubuntu-MATE 14.04 (Trusty Tahr) (Recovery Mode)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro recovery nomodeset
initrd /initrd.img
}



~$ cat /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/sdb1 during installation
UUID=1742aa67-b8ce-45d2-94ca-05e3579f7e2f / ext4 errors=remount-ro 0 1
# swap was on /dev/sda2 during installation
UUID=106dae89-e837-4063-9f9c-bcdeae4b2d5a none swap sw 0 0
# swap was on /dev/sdb2 during installation
UUID=a88c33fd-88b5-43b2-92f6-457430d206fd none swap sw 0 0




Now here are the contents of my /etc/fstab file on Precise:


# /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>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=4d4f7665-f633-4409-82f9-af43d0143823 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda2 during installation
UUID=106dae89-e837-4063-9f9c-bcdeae4b2d5a none swap sw 0 0


Thanks for offering to look at these.

Cavsfan
February 19th, 2015, 06:12 PM
First, here is the output of all three of the above commands entered in Trusty:

~$ sudo blkid
/dev/sda1: LABEL="UbuntuMATE-14.04" UUID="1742aa67-b8ce-45d2-94ca-05e3579f7e2f" TYPE="ext4"
/dev/sda2: UUID="a88c33fd-88b5-43b2-92f6-457430d206fd" TYPE="swap"
/dev/sdb1: LABEL="Ubuntu-12.04.5" UUID="4d4f7665-f633-4409-82f9-af43d0143823" TYPE="ext4"
/dev/sdb2: UUID="106dae89-e837-4063-9f9c-bcdeae4b2d5a" TYPE="swap"
/dev/sdc1: LABEL="WeirdBeard" UUID="c801726e-7a01-4963-989a-38482e6658cf" TYPE="ext4"



~$ cat /etc/grub.d/06_custom
#!/bin/sh
echo 1>&2 "Adding Ubuntu-MATE 14.04 (Trusty Tahr) and Ubuntu 12.04 (Precise Pangolin)"
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 "Ubuntu-MATE 14.04 (Trusty Tahr)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro quiet splash
initrd /initrd.img
}
menuentry "Ubuntu-MATE 14.04 (Trusty Tahr) (Recovery Mode)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro recovery nomodeset
initrd /initrd.img
}



~$ cat /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/sdb1 during installation
UUID=1742aa67-b8ce-45d2-94ca-05e3579f7e2f / ext4 errors=remount-ro 0 1
# swap was on /dev/sda2 during installation
UUID=106dae89-e837-4063-9f9c-bcdeae4b2d5a none swap sw 0 0
# swap was on /dev/sdb2 during installation
UUID=a88c33fd-88b5-43b2-92f6-457430d206fd none swap sw 0 0




Now here are the contents of my /etc/fstab file on Precise:


# /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>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=4d4f7665-f633-4409-82f9-af43d0143823 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda2 during installation
UUID=106dae89-e837-4063-9f9c-bcdeae4b2d5a none swap sw 0 0


Thanks for offering to look at these.

You really only need one swap file for all of your Ubuntu systems.
Actually you do not even need one if you have at least 4GB RAM and do not wish to use the hibernate feature.
I don't really need one myself but I set up a 1GB swap file that I use for all 4 systems (12.04, 14.04, 15.04 and Mint 17)

The first thing on 14.04 Mate is to edit fstab gksudo gedit /etc/fstab
Change the UUID for sdb1 and the swap file on sdb2 to match the output of blkid as shown in red.
Just copy and paste the contents below into your /etc/fstab file on 14.04 Mate and save it.

This is the most likely cause of your problems booting into Mate.

Or decide which single swap file you want to keep and make the UUID match the one you choose on the /etc/fstab file on both 14.04 Mate and Precise 12.04.
But since you have them on two different drives I guess one on each is fine. Just remember that if you change any partitions fstab has to be edited.


~$ cat /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/sdb1 during installation
UUID=4d4f7665-f633-4409-82f9-af43d0143823 / ext4 errors=remount-ro 0 1
# swap was on /dev/sdb2 during installation
UUID=106dae89-e837-4063-9f9c-bcdeae4b2d5a none swap sw 0 0


Your /etc/grub.d/06_custom file on 14.04 Mate should look like this and you can copy this into that file:



~$ cat /etc/grub.d/06_custom
#!/bin/sh
echo 1>&2 "Adding Ubuntu-MATE 14.04 (Trusty Tahr) and Ubuntu 12.04 (Precise Pangolin)"
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 "Ubuntu-MATE 14.04 (Trusty Tahr)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro quiet splash
initrd /initrd.img
}
menuentry "Ubuntu-MATE 14.04 (Trusty Tahr) (Recovery Mode)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Precise Pangolin 12.04" {
set root=(hd1,1)
linux /vmlinuz root=/dev/sdb1 ro quiet splash
initrd /initrd.img
}
menuentry "Precise Pangolin 12.04 (Recovery Mode)" {
set root=(hd1,1)
linux /vmlinuz root=/dev/sdb1 ro single
initrd /initrd.img
}


You could put Precise first to keep them in numerical order but that is up to you and you would have to edit /etc/default/grub if you wanted to change default systems.
Of course don't forget sudo update-grub after all of the edits are completed.

I would be best if you could edit the Precise /etc/fstab file from Trusty Mate. Just right click on the file and then click copy and paste that into terminal.
It will look something like this: gksudo gedit file:///media/cavsfan/Precise/etc/fstab just make sure you remove the characters in red.
Or if you can't get that to work see if you can boot into Precise and do it there.

Copy the contents below into the file on Precise as both UUIDs are wrong at present:



# /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>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=1742aa67-b8ce-45d2-94ca-05e3579f7e2f / ext4 errors=remount-ro 0 1
# swap was on /dev/sda2 during installation
UUID=a88c33fd-88b5-43b2-92f6-457430d206fd none swap sw 0 0


Once these steps are accomplished you should have no need for /etc/grub.d/30_os-prober to be executable and you will have a truly custom grub. :)

Just make sure you can boot into both Trusty and Precise from the custom lines first.

watchpocket
February 19th, 2015, 08:51 PM
I've made no changes just yet --I have a couple of questions before I go ahead with the changes.


You really only need one swap file for all of your Ubuntu systems.

Is that one swap file best put on my Trusty drive or my Precise drive? Or does it not matter which?

I have 8GB of ram. I never use the hibernate. Right now I have a 20GB swap partition on each of the two drives. Each drive is a one-terabyte drive, and each has only one ext4 partition, plus (at the moment) the one 20GB swap partition.

Since I've recently read that the old rule of having swapspace of just over double your amount of ram is obsolete (and was true mainly in the days when much smaller amounts of ram were used), I'll most likely keep just one swapfile for use with all 3 of my drives (per your suggestion) and reduce its size from 20GB to 10GB or even 9GB. (I previously had assumed that every drive had to have its own swap partition, or swap files.)

But -- what about the occasional situation where you've got Google Earth and 2 or 3 other super-hog programs open? Though it might happen very infrequently, my entire 8GB of ram could get filled up on that rare occasion, no? And I'd be glad I have that 9 or 10GB of ram, yes? Or maybe this is all just overkill.

Also, I have the Swapspace "Dynamic swapspace manager" program (v. 1.10-4) installed on both drives (on the advice of a post by oldfred that I can't find that discusses the wisdom of having one large partition on your drive and using this program with little or no swap partition space). I've sometimes wondered since installing it whether that program might interfere in any way, or make irrelevant, my allotted swap partitions.


The first thing on 14.04 Mate is to edit fstab gksudo gedit /etc/fstab

First off, you're saying that I need to change both my Trusty /etc/fstab file and my Precise /etc/fstab file, per your examples, correct?


Change the UUID for sdb1 and the swap file on sdb2 to match the output of blkid as shown in red.

Just to be clear, the Precise drive UUID ends with 823, and the UUID for the Precise swap partition ends in d5a, according to the output of sudo blkid , when I enter that command in Trusty.

What puzzles me a bit is that it looks to me from the examples as if you're saying to put the Precise UUID and the Precise swap UUID into the /etc/fstab file in Trusty.

Likewise, you say to put what appears to me to be the UUIDs for Trusty into the Precise /etc/fstab file.

I just want to double-check that this is correct, and that it shouldn't be the other way around, exactly the reverse.


Or decide which single swap file you want to keep and make the UUID match the one you choose on the /etc/fstab file on both 14.04 Mate and Precise 12.04.

This is where I'd expect that in the Trusty /etc/fstab I'd have the UUID for the Trusty drive's main partition (sda1) as shown in blkid (which UUID ends with e2f) along with the UUID of the one swap partition I decide to keep (say the one the Precise drive at sdb2, which UUID ends with d5a).

And that in the Precise /etc/fstab, I'd have the UUID for the Precise drive's main partition (sdb1) as shown in blkid (which UUID ends with 823) along with the same swap partition UUID as above (the one ending with d5a). Does that make sense, or do I have it backwards with respect to the (non-swap) UUIDs?


But since you have them on two different drives I guess one on each is fine.

If I only need one swap partition, and it will work with all 3 of my drives, I'll (a) get rid of the other swap partition; and (b) reduce the size of the one I keep from the un-needed 20GB size to something like 9 or 10GB (which I'm beginning to gather that this may also be an unnecessarily large swap-partition size).

Thanks for your indulgence.

Cavsfan
February 20th, 2015, 12:11 AM
I've made no changes just yet --I have a couple of questions before I go ahead with the changes.


You really only need one swap file for all of your Ubuntu systems.

Is that one swap file best put on my Trusty drive or my Precise drive? Or does it not matter which?

I have 8GB of ram. I never use the hibernate. Right now I have a 20GB swap partition on each of the two drives. Each drive is a one-terabyte drive, and each has only one ext4 partition, plus (at the moment) the one 20GB swap partition.

Since I've recently read that the old rule of having swapspace of just over double your amount of ram is obsolete (and was true in the days when much smaller amounts of ram were used), I'll most likely keep just one swapfile for use with both drives (per your suggestion) and reduce its size from 20GB to 10GB or even 9GB. (I previously had assumed that every drive had to have its own swap partition, or swap files.)

But -- what about the occasional situation where you've got Google Earth and 2 or 3 other super-hog programs open? Though it might happen very infrequently, my entire 8GB of ram could get filled up on that rare occasion, no? And I'd be glad I have that 9 or 10GB of ram, yes? Or maybe this is all just overkill.

Also, I have the Swapspace "Dynamic swapspace manager" program (v. 1.10-4) installed on both drives (on the advice of a post by oldfred that I can't find that discusses the wisdom of having one large partition on your drive and using this program with little or no swap partition space). I've sometimes wondered since installing it whether that program might interfere in any way, or make irrelevant, my alloted swap partitions.


The first thing on 14.04 Mate is to edit fstab gksudo gedit /etc/fstab

First off, you're saying that I need to change both my Trusty /etc/fstab file and my Precise /etc/fstab file, per your examples, correct?


Change the UUID for sdb1 and the swap file on sdb2 to match the output of blkid as shown in red.

Just to be clear, the Precise drive UUID ends with 823, and the UUID for the Precise swap partition ends in d5a, according to the output of sudo blkid , when I enter that command in Trusty.

What puzzles me a bit is that it looks to me as if you're saying to put the Precise UUID and the Precise swap UUID into the /etc/fstab file in Trusty.

Likewise, you say to put what appears to me to be the UUIDs for Trusty into the Precise /etc/fstab file.

I just want to double-check that this is correct, and that it shouldn't be the other way around, exactly the reverse.

Thanks for your indulgence.

I believe that is exactly what I am saying: copy and paste the contents of the two fstabs that I corrected for you into the files and copy and past the 06_custom file I corrected and you shall be right as rain as the lady on The Matrix once said. :p
Your current fstab files are exactly backwards. Look at the output of blkid and compare that to your fstab files and you will see.

The /etc/fstab files do not get updated when you move stuff around and that is why these changes are needed.
The sudo blkid output does not lie and is accurate.
An even better way to use that command is sudo blkid -c /dev/null -o list but you will need to resize terminal not full but bigger than normal small size.

But that's not really important. What is important is that the UUIDs in fstab match the UUIDs from blkid.
This is what I got from your blkid:

/dev/sda1: UbuntuMATE-14.04 UUID="1742aa67-b8ce-45d2-94ca-05e3579f7e2f"
/dev/sda2: UUID="a88c33fd-88b5-43b2-92f6-457430d206fd" TYPE="swap"

/dev/sdb1: Ubuntu-12.04.5 UUID="4d4f7665-f633-4409-82f9-af43d0143823"
/dev/sdb2: UUID="106dae89-e837-4063-9f9c-bcdeae4b2d5a" TYPE="swap"

So this, what you see in red is correct while your fstab files are not.
You can double check again if you want but I spent many hours today checking and double checking myself and I believe I have it right.

I am slow and do not like making mistakes so be sure you do double check my results but the fstab records are lying to you and blkid is never wrong.
I just double and triple checked and I believe my fstabs and 06_custom files are all correct so you can just copy and paste when you feel satisfied that I am correct.

I know that the Precise code is correct as I copied it from my 06_custom file and changed it to point to drive 2 partition 1.

And about the swap files. I feel that would be better suited for a new thread under general help. I'm not going to get into that on this wiki thread.

But, do let me know if this fixes your problems booting into both Trusty and Precise from the custom entries.

watchpocket
February 20th, 2015, 03:15 AM
[ . . . ] but I spent many hours today checking and double checking myself and I believe I have it right.

And I do appreciate that.

I'm sure you're right, and I will make the changes tonight when I get home.

The source of my confusion was that I simply overlooked or wasn't paying attention to these comment lines in the fstab files telling me what's what & where it belongs:


# / was on /dev/sdb1 during installation
# swap was on /dev/sdb2 during installation

Apologies for that. I will let you know if the booting problem is fixed.

watchpocket
February 20th, 2015, 10:29 AM
So I've made the changes and, so far at least, all appears well with booting (I only had the hangs booting into Trusty, not Precise). I'll know for sure in a day or two.

The problem is that from the minute I did sudo upgrade-grub after changing the Trusty fstab file, I no longer had ( and do not now have) a way to mount Precise from Trusty or vice-versa.
I saw right away that in the "Places" menu, the item "Ubuntu 12.04" was missing. Same thing when logged into Precise, "Ubuntu 14.04" is missing from the Precise "Places" menu. My third drive of course is still listed in Places.

Looking in gparted, the keys in /dev/sdb are beside sdb2 "linux-swap", instead of beside sdb1, the ext4 partition, where in sda and sdc the keys are beside the ext4 partition (though sdc of course doesn't have a swap partition).

Looking in the Disks util, it shows /dev/sda1 as mounted and /dev/sda2 (swap) as "Not Active". And it shows /dev/sdb1 as "Not Mounted" and /dev/sdb2 swap as "Active."

Here is the trusty /etc/fstab file, I cut/pasted exactly:



~$ cat /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/sdb1 during installation
UUID=4d4f7665-f633-4409-82f9-af43d0143823 / ext4 errors=remount-ro 0 1
# swap was on /dev/sdb2 during installation
UUID=106dae89-e837-4063-9f9c-bcdeae4b2d5a none swap sw 0 0
It seems I need to take another step with this to finish. Thanks.

Cavsfan
February 20th, 2015, 06:56 PM
So I've made the changes and, so far at least, all appears well with booting (I only had the hangs booting into Trusty, not Precise). I'll know for sure in a day or two.

The problem is that from the minute I did sudo upgrade-grub after changing the Trusty fstab file, I no longer had ( and do not now have) a way to mount Precise from Trusty or vice-versa.
I saw right away that in the "Places" menu, the item "Ubuntu 12.04" was missing. Same thing when logged into Precise, "Ubuntu 14.04" is missing from the Precise "Places" menu. My third drive of course is still listed in Places.

Looking in gparted, the keys in /dev/sdb are beside sdb2 "linux-swap", instead of beside sdb1, the ext4 partition, where in sda and sdc the keys are beside the ext4 partition (though sdc of course doesn't have a swap partition).

Looking in the Disks util, it shows /dev/sda1 as mounted and /dev/sda2 (swap) as "Not Active". And it shows /dev/sdb1 as "Not Mounted" and /dev/sdb2 swap as "Active."

Here is the trusty /etc/fstab file, I cut/pasted exactly:



~$ cat /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/sdb1 during installation
UUID=4d4f7665-f633-4409-82f9-af43d0143823 / ext4 errors=remount-ro 0 1
# swap was on /dev/sdb2 during installation
UUID=106dae89-e837-4063-9f9c-bcdeae4b2d5a none swap sw 0 0
It seems I need to take another step with this to finish. Thanks.

You are welcome. I'm a little slow these days so I wanted to make sure I was telling you correctly about the fstabs. I have no idea why the other drive would dis-mount.

I have only a 500GB drive and a 1TB USB drive which both mount when I boot into any of my Linux systems every time.
Here is my gparted from Precise sda:

260108

sdb:

260109

Let me know how it turns out.

watchpocket
February 20th, 2015, 08:23 PM
Since I do need the drive I'm not logged into to mount, for right now I may temporarily revert to my previous fstabs. I'm going to dig further into the overall problem, or rather, the specific problem of the drives not mounting, and ask about this in other forums and look around on stack exchange, ask ubuntu, etc.

You've gone beyond the call of duty and I'm not going to keep taking up your time. I've learned a lot and really appreciate it. Going forward I'll continue to look at this thread for learning more about grub. Thanks again for all the help. :)

Cavsfan
February 21st, 2015, 12:08 AM
Since I do need the drive I'm not logged into to mount, for right now I may temporarily revert to my previous fstabs. I'm going to dig further into the overall problem, or rather, the specific problem of the drives not mounting, and ask about this in other forums and look around on stack exchange, ask ubuntu, etc.

You've gone beyond the call of duty and I'm not going to keep taking up your time. I've learned a lot and really appreciate it. Going forward I'll continue to look at this thread for learning more about grub. Thanks again for all the help. :)

OK good luck! However, your fstabs should match the UUIDs in the output of blkid. I think the problem is more with the reason both drives do not automatically mount.
I don't see how correcting the fstab files would cause that but, I hope you find your solution.

I gave it my best shot and you are welcome! :)

Cavsfan
March 7th, 2015, 11:31 PM
Installed Vivid Mate 15.04 and the first picture I found worked like a charm.
Booting with systemd as default with the option to use upstart.

I could have used better colors but they'll do for the time being.

http://en.zimagez.com/miniature/20150307081900.jpg (http://en.zimagez.com/zimage/20150307081900.php)

That is with magenta for normal, yellow for menu and red for highlight menu.
I'll probably change them but they look fairly good in the mean time.

Pink is for breast cancer awareness anyway and I like magenta. ;)

Cavsfan
April 3rd, 2015, 07:24 PM
Decided to do new installs and get my disk in order.

I have Windows 7, Linux Mint 17.1 and Ubuntu Trusty Mate 14.04 on physical partitions.

The swap file and a 15 GB partition for developmental releases (currently Vivid Mate 15.05) are on logical partitions.

http://en.zimagez.com/miniature/20150403092541.jpg (http://en.zimagez.com/zimage/20150403092541.php)

I went with these colors:


echo " set color_normal=red/black"
echo " set menu_color_normal=cyan/black"
echo " set menu_color_highlight=light-cyan/black"

Cavsfan
April 19th, 2015, 08:25 PM
I'm hoping to simplify this wiki a lot when Vivid Vervet 15.04 is released by cutting out a lot of extraneous things that should not be in it. I realize I got a little too wordy in many places.

Vivid Vervet 15.04 will be very different that past versions as it will come with systemd as default with an option to use upstart.

Also I should have put editing /etc/default/grub after the creation/update portion of the custom grub entries in /etc/grub.d/06_custom as that makes more sense.

Any way hopefully it will be a lot easier to understand. Hindsight is always better than foresight. :)

von Stalhein
April 21st, 2015, 10:20 AM
Thanks for all your hard work Cavsfan, I for one certainly appreciate it and I know I'm not alone.

Cavsfan
April 21st, 2015, 05:23 PM
Thanks for all your hard work Cavsfan, I for one certainly appreciate it and I know I'm not alone.

You are very welcome! It's nice to hear when someone appreciates the wiki! Judging from the amount of views many people use it, but I don't know.

I know that some people may get intimidated first looking at it. I did myself when Ranch Hand first showed me this method of customizing grub.

It took me a few days before I was ready to take the plunge. Hopefully I will able to simplify it more so that it is a lot less intimidating.

Precise 12.04 is unique with it's 2 grub entries one for normal and one for recovery but every version after that until Utopic is the same.

Vivid will have a normal systemd boot that is just like the rest of the normal boot entries along with an option to boot with upstart and that will have a special part to it.
The recovery line will be just like the other systems.

von Stalhein
April 22nd, 2015, 09:51 AM
Yes, I've skimmed over a couple of articles about systemd but I need to put some time in and get my head around it.

I used to spend hours on conky configs, compiz, cli stuff and other tweaks but when a PC died a while back I subsisted on a Win work laptop using it mainly for email etc.

I re-purposed an old-ish mobo and cpu to get back into Ubuntu but lost about 14 months "practice" so have been a bit out of the loop. The first thing I did do was tart up the GRUB screen :p

How do you get shots of the screen - is it just via phone camera or similar or is there another method?

Cavsfan
April 22nd, 2015, 03:52 PM
Yes, I've skimmed over a couple of articles about systemd but I need to put some time in and get my head around it.

I used to spend hours on conky configs, compiz, cli stuff and other tweaks but when a PC died a while back I subsisted on a Win work laptop using it mainly for email etc.

I re-purposed an old-ish mobo and cpu to get back into Ubuntu but lost about 14 months "practice" so have been a bit out of the loop. The first thing I did do was tart up the GRUB screen :p

How do you get shots of the screen - is it just via phone camera or similar or is there another method?

Glad to hear your back! That is also the first thing I do - get the grub menu looking nice.

Yes, the only way to get a picture of the grub screen is to take a picture. I use my phone most of the time and upload it to my PC via wifi. My phone takes 3264x2448 pictures.

Something else I'm going to try to add to the wiki is something I learned not too long ago.

That is if you have multiple Linux systems and do not like for grub to be installed on each system during installation or during an update to grub you can simply install the system's grub to the PBR on the systems you do not want to control grub. E.G. install grub to PBR /dev/sda4 instead of MBR /dev/sda like normal.

Then you have one system that will retain control of your grub and when other systems have their grub updated, it has zero effect on your main system's grub.

I was constantly, after an update to grub on one system, going to the sytem I wanted to be in control and issuing a sudo grub-install /dev/sda command from there.

This prevents the need for doing that. So your grub menu never changes or moves around on you. You just have to remember which system your grub is installed on.

oldfred
April 22nd, 2015, 04:20 PM
I also have installed to partition but found these also, have not tried any yet.

This launches the installer program (Ubiquity) with an option (-b) to not install a boot loader from live installer in live mode:
In the Terminal window, type ubiquity -b.


Better install to PBR core.img alone
https://wiki.archlinux.org/index.php/Grub#Generate_core.img_alone

Cavsfan
April 22nd, 2015, 04:43 PM
I also have installed to partition but found these also, have not tried any yet.

This launches the installer program (Ubiquity) with an option (-b) to not install a boot loader from live installer in live mode:
In the Terminal window, type ubiquity -b.


Better install to PBR core.img alone
https://wiki.archlinux.org/index.php/Grub#Generate_core.img_alone

Thank you for that information oldfred! :D

von Stalhein
April 23rd, 2015, 10:02 AM
You just have to remember which system your grub is installed on.
Yes. Having seen your GRUB screen over a period I would think that could be an issue sometimes ;)

Although you do have the pics to fall back on!

I spent most of last night trying to set up a VPN using SoftEther - I think I may leave it another day.
The chook is in the oven and the bread is baking!!

I will post a pic of my screen after the next boot - there's only 2 systems but I reckon the pic is OK :)

von Stalhein
April 23rd, 2015, 11:43 AM
261488

Hope it comes up OK.

A Bali farm terrace from a coffee farm on the hill above it.

Yes, I need to change the text colour :-)

Cavsfan
April 23rd, 2015, 04:01 PM
261488

Hope it comes up OK.

A Bali farm terrace from a coffee farm on the hill above it.

Yes, I need to change the text colour :-)

Nice but where is the custom entries? Have you just not gotten around to it?

You could post the output of sudo blkid -c /dev/null here and I could set it up for you if you'd like.

Oh I guess you did find an old hard drive. Windows XP is no longer supported so I'd be careful with that or not run it at all.

http://www.microsoft.com/en-us/windows/enterprise/end-of-support.aspx

Cavsfan
April 25th, 2015, 04:04 PM
Vivid Vervet 15.04 was released Thursday April 23rd. Only 2 flavors got upstart as an option with systemd as default. The rest just got systemd only.



Ubuntu - upstart
Kubuntu
Xubuntu - upstart
Lubuntu
Ubuntu Gnome
Ubuntu Mate


So until I can get this added to the wiki and rewrite most of it here is what custom entries look like:

If you are using Ubuntu or Xubuntu:


menuentry "Vivid Vervet Mate 15.04 Mate" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro quiet splash
initrd /initrd.img
}
menuentry "Vivid Vervet Mate 15.04 Mate Upstart" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro quiet splash init=/sbin/upstart
initrd /initrd.img
}
menuentry "Vivid Vervet Mate 15.04 Mate (Recovery Mode)" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro recovery nomodeset
initrd /initrd.img
}

If you are using the others, it's just the regular enteries:


menuentry "Vivid Vervet Mate 15.04 Mate" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro quiet splash
initrd /initrd.img
}
menuentry "Vivid Vervet Mate 15.04 Mate (Recovery Mode)" {
set root=(hd0,5)
linux /vmlinuz root=/dev/sda5 ro recovery nomodeset
initrd /initrd.img
}

von Stalhein
April 27th, 2015, 08:40 AM
Hello Cavsfan,
Yes, well aware of XP issues but I have a lot of legacy gaming stuff and some old uni DOS programs I use from time to time.
I very rarely boot to it atm as the GPU in this box is very underpowered so gaming is not really an option.

Thanks for that offer, only have the 2 OS'es so it's not a big drama.


/dev/sda1: LABEL="DSK1_VOL1" UUID="01C3D871F965AC80" TYPE="ntfs" PARTUUID="960c960c-01"
/dev/sdc1: UUID="d69eeee0-eb0b-459d-9f3b-5ed5191247ff" TYPE="ext4" PARTUUID="9fa5e4ea-01"
/dev/sdc5: UUID="6f05285e-1d92-4f10-8ebd-172e0096c890" TYPE="swap" PARTUUID="9fa5e4ea-05"
/dev/sdb5: LABEL="Disk 2" UUID="A83CB1173CB0E18C" TYPE="ntfs" PARTUUID="a3f79c20-05"
/dev/sdd1: LABEL="SeagateExternal" UUID="6EC484A1C4846D61" TYPE="ntfs" PARTUUID="c75b1e2d-01"
/dev/sde1: LABEL="Vistaback" UUID="445CA27758215EB1" TYPE="ntfs"
/dev/sde2: LABEL="Ubuntback" UUID="4B7B4D5000549C38" TYPE="ntfs"




Disk 1 is the XP drive
SDC1 carries Vivid
Disk 2 is data (mainly Win games, music)
SDD1 is a Seagate external HDD
Vistaback and Ubuntuback are on another external HDD. The SDE1 Vista backup is my daughter's laptop and the SDE2 Ubuntuback is the backup of the machine since Feisty.

Cavsfan
April 27th, 2015, 06:53 PM
Hello Cavsfan,
Yes, well aware of XP issues but I have a lot of legacy gaming stuff and some old uni DOS programs I use from time to time.
I very rarely boot to it atm as the GPU in this box is very underpowered so gaming is not really an option.

Thanks for that offer, only have the 2 OS'es so it's not a big drama.


/dev/sda1: LABEL="DSK1_VOL1" UUID="01C3D871F965AC80" TYPE="ntfs" PARTUUID="960c960c-01"
/dev/sdc1: UUID="d69eeee0-eb0b-459d-9f3b-5ed5191247ff" TYPE="ext4" PARTUUID="9fa5e4ea-01"
/dev/sdc5: UUID="6f05285e-1d92-4f10-8ebd-172e0096c890" TYPE="swap" PARTUUID="9fa5e4ea-05"
/dev/sdb5: LABEL="Disk 2" UUID="A83CB1173CB0E18C" TYPE="ntfs" PARTUUID="a3f79c20-05"
/dev/sdd1: LABEL="SeagateExternal" UUID="6EC484A1C4846D61" TYPE="ntfs" PARTUUID="c75b1e2d-01"
/dev/sde1: LABEL="Vistaback" UUID="445CA27758215EB1" TYPE="ntfs"
/dev/sde2: LABEL="Ubuntback" UUID="4B7B4D5000549C38" TYPE="ntfs"



Disk 1 is the XP drive
SDC1 carries Vivid
Disk 2 is data (mainly Win games, music)
SDD1 is a Seagate external HDD
Vistaback and Ubuntuback are on another external HDD. The SDE1 Vista backup is my daughter's laptop and the SDE2 Ubuntuback is the backup of the machine since Feisty.



Here is all you need I believe for your custom file:

#!/bin/sh
echo 1>&2 "Adding Vivid Vervet 15.04 and Windows XP"
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 "Vivid Vervet 15.04" {
set root=(hd2,1)
linux /vmlinuz root=/dev/sdc1 ro quiet splash
initrd /initrd.img
}
menuentry "Vivid Vervet 15.04 Upstart" {
set root=(hd2,1)
linux /vmlinuz root=/dev/sdc1 ro quiet splash init=/sbin/upstart
initrd /initrd.img
}
menuentry "Vivid Vervet 15.04 (Recovery Mode)" {
set root=(hd2,1)
linux /vmlinuz root=/dev/sdc1 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Windows XP" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 01C3D871F965AC80
chainloader +1
}

The upstart entry is only if you have installed vanilla Ubuntu with Unity or Xubuntu, otherwise delete that menu entry.

Just save that file as /etc/grub.d/06_custom and then make it executable - sudo chmod +x /etc/grub.d/06_custom

Then of course sudo update-grub and when you enter that it should list "Adding Vivid Vervet 15.04 and Windows XP" in the output.

When you are satisfied that both or all three menu selections work to your satisfaction.

Enter

sudo chmod -x /etc/grub.d/20_memtest86+
sudo chmod -x /etc/grub.d/10_linux
sudo chmod -x /etc/grub.d/30_os-prober
sudo update-grub

Then you should just see "Adding Vivid Vervet 15.04 and Windows XP" only in the output of sudo update-grub.

Then if you want to leave Vivid systemd as the default line you don't need to do anything but if you want another line
edit /etc/default/grub and change the GRUB_DEFAULT=N N being the number you want to have as default. It starts at 0,1,2,3 etc.

Enter this in terminal and you will see the numbers that could go there.

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

Cheers mate and let me know how this works for you. :)

von Stalhein
April 28th, 2015, 10:50 AM
How did it work?

Perfectly!!! You little beauty!
Hang on, an issue. When I select items 2 or 3 I get "Partition not found" so I must've stuffed up something in your elegantly simple instructions.


user@user:~$ grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0
0 menuentry "Vivid Vervet 15.04" {
1 menuentry "Vivid Vervet 15.04 Upstart" {
2 menuentry "Vivid Vervet 15.04 (Recovery Mode)" {
3 menuentry "Windows XP" {

Lovely to be back in the program though!

Will go again from the start and report back.

Hmm, now if I select menu entry 0 I get the same problem. This means my only working OS from the GRUB menu atm is XP.
Not. Good.

I can get into Vivid by changing the {hd2,1} to {hd1,1} and then the 'ol ctrl-x

von Stalhein
April 28th, 2015, 12:41 PM
(later)
XP will boot but I still need to change the hd# in GRUB to get back into Vivid.

Have been through the Wiki but I'm not seeing the no doubt obvious remedy.

Cavsfan
April 28th, 2015, 02:48 PM
How did it work?

Perfectly!!! You little beauty!
Hang on, an issue. When I select items 2 or 3 I get "Partition not found" so I must've stuffed up something in your elegantly simple instructions.


user@user:~$ grep -e "menuentry " -e "submenu" /boot/grub/grub.cfg | sed 's/^[ \t]*//' | cut -d "'" -f1,2 | nl --starting-line-number=0
0 menuentry "Vivid Vervet 15.04" {
1 menuentry "Vivid Vervet 15.04 Upstart" {
2 menuentry "Vivid Vervet 15.04 (Recovery Mode)" {
3 menuentry "Windows XP" {

Lovely to be back in the program though!

Will go again from the start and report back.

Hmm, now if I select menu entry 0 I get the same problem. This means my only working OS from the GRUB menu atm is XP.
Not. Good.

I can get into Vivid by changing the {hd2,1} to {hd1,1} and then the 'ol ctrl-x

From the output of blkid Vivid is on /dev/sdc1, which should equate to hd2,1 since the first drive letter sdc1 equates to 2 as the numbering starts at 0 (a),1 (b),2 (c), etc.
Then sdc1 points to partition 1 of that hard drive c.

This makes no sense but try editing the custom file - gksudo gedit /etc/grub.d/06_custom and changing the three places where hd2,1 is to hd1,1.
That would point to HD2, Partition 1 but let me know what happens.

Did you enter sudo blkid or sudo blkid -c /dev/null ? The later is supposed to be more correct I believe.

Edit: Make sure you enter sudo update-grub afterwards.

oldfred
April 28th, 2015, 03:21 PM
I have had lots of issues of drive order. It does not match the mounted system drive order.
I normally booted from sdc or sdd with my older system. And drives were in SATA port order on motherboard. But I must have skipped a port as if I plugged in a flash drive it became hd2 (usually unless boot drive) and sdb.

And boot drive is always hd0. So when I boot from sdd drive that is hd0, then drive that was sda would be hd1. But then depending on whether flash drive was plugged in it would be hd2 or my normal internal sdb would be.
Same sort of issue when using sdc as boot drive. Then it was hd0.

Cavsfan
April 28th, 2015, 04:17 PM
I have had lots of issues of drive order. It does not match the mounted system drive order.
I normally booted from sdc or sdd with my older system. And drives were in SATA port order on motherboard. But I must have skipped a port as if I plugged in a flash drive it became hd2 (usually unless boot drive) and sdb.

And boot drive is always hd0. So when I boot from sdd drive that is hd0, then drive that was sda would be hd1. But then depending on whether flash drive was plugged in it would be hd2 or my normal internal sdb would be.
Same sort of issue when using sdc as boot drive. Then it was hd0.

Thanks a lot! I was hoping you would see this and step in. So, if hd1,1 works for sdc1, I guess you have to just roll with it? That is exactly what von Stalhein is experiencing.

I have one 500GB HD partitioned into 4 physical partitions: sda1 is windows 7, sda2 is Mint 17.1 Rebecca, sda3 is Trusty 14.04 using FB all the time, the 4th being the extended partition.

Then there is a sda5 which is Vivid Mate (and will be the next developmental version) and my swap is on sda6. Sdb1 is my 1TB USB Phantom drive.
When I plug in my 5GB USB thumb drive it becomes sdc1. Luckily they stay in that same order.

I could see disconnecting drives that are in the grub menu or connecting drives that are not in the grub menu causing problems.

Bashing-om
April 28th, 2015, 09:22 PM
Guys;

At one time I also experienced my drives changing .
I found mapping the drives solved it for me:
see:


man grub-mkdevicemap

You can determine what GRUB thinks your disk devices are by running:


sudo grub-mkdevicemap --device-map=device.map

Which will create the file; To see the contents of that created file:


cat device.map

//
The device.map file is located in /boot/grub/ It isn't required but can be used in Grub 2.



there are those times



ya got to give the system a bit of help

von Stalhein
April 29th, 2015, 09:02 AM
Yes, interesting.
cat device map gives

(hd0) /dev/disk/by-id/ata-ST3120026AS_3JT308HS
(hd1) /dev/disk/by-id/ata-ST3120026AS_3JT3SE3N
(hd2) /dev/disk/by-id/ata-ST3250410AS_6RY57G1E


So, in the above:
(hd0) would be the XP disk
(hd1) would be the Vivid disk
(hd2) would be the data disk (carries all windows games, music etc,)

I think!

I'm also getting a kernel load error
[ 0.619398] ACPI PCC probe failed starting version 219 which from my reading is harmless.
That wasn't there before I changed the GRUB commands but a kernel update came through earlier that evening so I'm putting it down to that.

Thanks all!!!

Cavsfan
April 29th, 2015, 04:13 PM
Guys;

At one time I also experienced my drives changing .
I found mapping the drives solved it for me:
see:


man grub-mkdevicemap

You can determine what GRUB thinks your disk devices are by running:


sudo grub-mkdevicemap --device-map=device.map

Which will create the file; To see the contents of that created file:


cat device.map

//
The device.map file is located in /boot/grub/ It isn't required but can be used in Grub 2.

there are those times


ya got to give the system a bit of help







Thanks for that information!


Yes, interesting.
cat device map gives

(hd0) /dev/disk/by-id/ata-ST3120026AS_3JT308HS
(hd1) /dev/disk/by-id/ata-ST3120026AS_3JT3SE3N
(hd2) /dev/disk/by-id/ata-ST3250410AS_6RY57G1E


So, in the above:
(hd0) would be the XP disk
(hd1) would be the Vivid disk
(hd2) would be the data disk (carries all windows games, music etc,)

I think!

I'm also getting a kernel load error
[ 0.619398] ACPI PCC probe failed starting version 219 which from my reading is harmless.
That wasn't there before I changed the GRUB commands but a kernel update came through earlier that evening so I'm putting it down to that.

Thanks all!!!

Don't worry about that message:

[ 0.619398] ACPI PCC probe failed starting version 219
Everyone gets that booting up I'm pretty sure. At least I've seen it for the past several months even before final release.

So, if Vivid is indeed on hd1 (2nd) drive instead of sdc1 (3rd) drive as it first appeared.

That would explain why when you edited the grub line it succussfully booted into Vivid.

Just change your file like this:

gksudo gedit /etc/grub.d/06_custom and replace it with this:


#!/bin/sh
echo 1>&2 "Adding Vivid Vervet 15.04 and Windows XP"
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 "Vivid Vervet 15.04" {
set root=(hd1,1)
linux /vmlinuz root=/dev/sdb1 ro quiet splash
initrd /initrd.img
}
menuentry "Vivid Vervet 15.04 Upstart" {
set root=(hd1,1)
linux /vmlinuz root=/dev/sdb1 ro quiet splash init=/sbin/upstart
initrd /initrd.img
}
menuentry "Vivid Vervet 15.04 (Recovery Mode)" {
set root=(hd1,1)
linux /vmlinuz root=/dev/sdb1 ro recovery nomodeset
initrd /initrd.img
}
menuentry "Windows XP" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 01C3D871F965AC80
chainloader +1
}

And of course sudo update-grub to make the changes stick. Then you should be good to go.

Let me know if this solves your problem.

Cavsfan
May 5th, 2015, 06:38 PM
Well, I think I finally cleaned the wiki up enough that it should be easier to understand and work with.

I also added Vivid Vervet and whether you installed vanilla Ubuntu with Unity or Xubuntu there are commands to boot with systemd as the default and upstart as an option.
If you installed any other version you will only have systemd unless you install upstart manually. They appropriate custom entries are there for either situation.

Let me know if I left anything out or made any mistakes. I left the same pictures there as they are only examples.
I hope to add some new pictures soon.

Regards...

von Stalhein
May 6th, 2015, 10:17 AM
Hi Cavsfan,
Sorry for the delay, life keeps getting in the way.
I couldn't remember whether I'd completed all the steps in your last post so I went through them again last night and rebooted the box for the first time in 6 days.

And got this :)

261797

Pretty annoying.

I mucked around with Hirens but eventually found a Precise disc and got to a live cd situation.
Before trying the sequence again I used boot-repair which gave me a menu with all the kernels on this box. These were all appended under the Vivid menu. From a repair option I did a repair & then a reboot.
I thought I may have needed to chmod the rest of the files as above and that was why the busybox error occurred but I don't think that was the case as I made sure the same sequence for both choices was completed.
I went through all the commands for the second choice again above being careful not to omit any.

That just got me back to the above black screen again which caused me to have to repeat the live cd process :p

So I then tried the original file you parsed for me and it worked perfectly.

I have no idea why, but I obviously stuffed something up in the cmd process with the second mod. However, I did reboot a couple of times during that process without the busybox error occurring so it's a bit confusing.

It's ages since I've had to do a recovery so it took a while to remember some steps and alternatives, but I've had plenty of practice now!!

Thanks again ):P :popcorn:

Cavsfan
May 6th, 2015, 02:48 PM
Hi Cavsfan,
Sorry for the delay, life keeps getting in the way.
I couldn't remember whether I'd completed all the steps in your last post so I went through them again last night and rebooted the box for the first time in 6 days.

And got this :)

261797

Pretty annoying.

I mucked around with Hirens but eventually found a Precise disc and got to a live cd situation.
Before trying the sequence again I used boot-repair which gave me a menu with all the kernels on this box. These were all appended under the Vivid menu. From a repair option I did a repair & then a reboot.
I thought I may have needed to chmod the rest of the files as above and that was why the busybox error occurred but I don't think that was the case as I made sure the same sequence for both choices was completed.
I went through all the commands for the second choice again above being careful not to omit any.

That just got me back to the above black screen again which caused me to have to repeat the live cd process :p

So I then tried the original file you parsed for me and it worked perfectly.

I have no idea why, but I obviously stuffed something up in the cmd process with the second mod. However, I did reboot a couple of times during that process without the busybox error occurring so it's a bit confusing.

It's ages since I've had to do a recovery so it took a while to remember some steps and alternatives, but I've had plenty of practice now!!

Thanks again ):P :popcorn:

You are welcome!
So, you did get it corrected?

von Stalhein
May 6th, 2015, 10:48 PM
You are welcome!
So, you did get it corrected?

Yep, all good now.

Cavsfan
May 6th, 2015, 10:51 PM
My first grub screen on Wily Werewolf 15.04.

I like this blue circle wallpaper pretty much.
It has these font colors:


echo " set color_normal=cyan/black"
echo " set menu_color_normal=yellow/black"
echo " set menu_color_highlight=red/black"

http://en.zimagez.com/miniature/20150506171543.jpg (http://en.zimagez.com/zimage/20150506171543.php)

Cavsfan
May 7th, 2015, 02:15 PM
You are welcome!
So, you did get it corrected?


Yep, all good now.

Fantastical! Glad to hear that! I guess we posted about the same time so I did not see this until today.

Cavsfan
July 8th, 2015, 03:59 PM
I actually got Arch Linux installed and added to my custom entries. I just looked at the grub.cfg file and figured out how to do it and it worked. ;)


menuentry "Arch Linux" {
set root=(hd0,3)
linux /boot/vmlinuz-linux root=/dev/sda3 rw quiet
initrd /boot/initramfs-linux.img
}

This will boot Arch Linux believe it or not.

Something else I have come to understand (at least on non-SSD drives) is that grub only recognizes 4 partitions whether they are physical or if 3 are physical and the 4th is an extended partition.
It will recognize the 1st logical partition but beyond that it fails to see the rest. I've been though my share of multiple OSs and how Grub2 reacts to them.

So, my 5th logical partition appears to be on /dev/sda7 or that is what grub shows at bootup but if you edit the line this is pointing to the correct partition set root=(hd0,7).
But the line below that has /dev/sda2 and that will appear on every subsequent partition after the 4th one.
So without a custom grub I have to edit that line and change it to sda7 to boot intot that system. Otherwise you boot into what is on partition sda2 in tty mode.

Arch is quite the system to get installed but once you do it is sweet. ):P

von Stalhein
July 14th, 2015, 10:55 AM
I courageously did it in VirtualBox :p
Undecided on whether it's the way to go as a main dist though!

Cavsfan
July 14th, 2015, 05:31 PM
I courageously did it in VirtualBox :p
Undecided on whether it's the way to go as a main dist though!

I think it's a little harder than on VirtualBox but I know nothing about VirtualBox.

That is great though! :D The more you get into it the better you'll like it. Took me about 2 weeks before I got my mouse wheel to scroll but finally got that working.

It is truly a custom system that only has what you put on it. I just went with Xcfe as my DE and love it. Nothing else compares.

Here is a screenie of my Arch Linux custom grub screen. I finally figured out how to add a picture for the background.

http://en.zimagez.com/miniature/20150714111241.jpg (http://en.zimagez.com/zimage/20150714111241.php)

von Stalhein
July 15th, 2015, 10:58 AM
Yes, definitely harder than putting it on a "real" partition!
If something goes' wrong you can just hose the install in the sandbox and start again.

It's certainly highly customisable and as you have no doubt sussed contains some tricks for the unwary, especially where it mightn’t be obvious what dependencies are required for some packages!

Enjoyable working though these things. When it's in VirtualBox you can afford to be brave :-) And, nice pic BTW!

Cavsfan
July 15th, 2015, 06:18 PM
Yes, definitely harder than putting it on a "real" partition!
If something goes' wrong you can just hose the install in the sandbox and start again.

It's certainly highly customisable and as you have no doubt sussed contains some tricks for the unwary, especially where it mightnít be obvious what dependencies are required for some packages!

Enjoyable working though these things. When it's in VirtualBox you can afford to be brave :-) And, nice pic BTW!

Thank you!
Yes installing Arch Linux involves installing the DVD/CD and then you have a text based environment until you get the system installed.
It took me about a week or more to get to where I could add a DE which I chose Xcfe.
I tried gnome, gnome-flashback-session, cinnamon and non of them worked; they had really big icons for everything and then it took me another 2 weeks before I got compiz and emerald working well.

I purged gnome, gnome-flashback-session, cinnamon which ended up purging xcfe4 and xcfe4-goodies so I re-installed them and everything was back to normal.

Surprisingly I could not boot into Arch except through my custom entry. Everything else failed.

Cavsfan
July 17th, 2015, 07:44 PM
What I'm currently using to boot Arch Linux in 06_custom:


menuentry "Arch Linux" {
set root=(hd0,3)
linux /boot/vmlinuz-linux root=/dev/sda3 rw quiet
initrd /boot/initramfs-linux.img
}
menuentry "Arch Linux (Recovery Mode)" {
set root=(hd0,3)
linux /boot/vmlinuz-linux root=/dev/sda3 rw single
initrd /boot/initramfs-linux.img
}

There's a fallback and lts kernel but I left them out and this works just fine. :)

Cavsfan
August 2nd, 2015, 10:54 PM
If any one has installed Arch Linux and is insterested in getting a custom grub screen like the one I am currently using in post #366 (http://ubuntuforums.org/showthread.php?t=2076205&page=37&p=13320921#post13320921).
Just let me know and I'll explain how I did it.

There is no /etc/grub.d/05_debian_theme file in Arch.

Cavsfan
August 24th, 2015, 08:49 PM
If there is any Arch Linux users who multi-boot and want to try this out, if you haven't already figured out how.

Most of what is done is in /etc/default/grub as there is no 05_debian_theme file in Arch.

That, a 06_custom file and a picture is all that is needed.

I created it and then less than a half hour later it was put in the dustbin (trash). I guess they prefer everything to be in their wiki format, which I just cannot do at this point.

https://bbs.archlinux.org/viewtopic.php?id=200995

Also, there is a different way they update grub rather than sudo update-grub.

In Arch Linux you enter sudo grub-mkconfig -o /boot/grub/grub.cfg

QDR06VV9
August 24th, 2015, 10:45 PM
There used to be a nice how to for Arch and custom grub configs but I can't find it ATM will post back after I try to get a hold
of couple of friends.

Also, there is a different way they update grub rather than sudo update-grub.

You mean

# grub-mkconfig -o /boot/grub/grub.cfg:p
Kind Regards

Cavsfan
August 24th, 2015, 11:21 PM
There used to be a nice how to for Arch and custom grub configs but I can't find it ATM will post back after I try to get a hold
of couple of friends.


Also, there is a different way they update grub rather than sudo update-grub.

You mean

# grub-mkconfig -o /boot/grub/grub.cfg:p
Kind Regards

Indeed! They have no update-grub command that I know of. I have seen grub-customizer but nothing like this method. I was surprised but pleased when I got Arch customized. ;)

I also installed all the rest of the Linux systems in the PBR so it doesn't get wiped out by an update to a grub on another partition.

How to do that, which I learned from Kansasnoob, Zika and some others in this forum is on 1.8 of the wiki right here If you multiboot mutiple Linux installs and want one Grub to control all of your OSs (https://help.ubuntu.com/community/MaintenanceFreeCustomGrub2Screen#If_you_multiboot_ mutiple_Linux_installs_and_want_one_Grub_to_contro l_all_of_your_OSs)

Also through the years, at least on my system grub does not recognize anything past the 4 partition.
The 4th partion can even be the first logical partition with the 4th and last physical being the extended partition.

But it will never get the 5th partition correct and I have Arch, Mint, 2 Ubuntus and Windows 10 on my system.
So, the 5th partion "looks" like it will boot into the selected system but will end up in the 1st Linux partition in tty mode.

You can tell by what it says in tty mode. So, in addition to this being Kool, it is effective as well if you have more than 4 systems.

oldfred
August 24th, 2015, 11:32 PM
That grub command in Arch is really the same. In grub legacy it also was sudo update-grub.


fred@trusy-ar:~$ whereis update-grub
update-grub: /usr/sbin/update-grub /usr/share/man/man8/update-grub.8.gz
fred@trusy-ar:~$ cat /usr/sbin/update-grub
#!/bin/sh
set -e
exec grub-mkconfig -o /boot/grub/grub.cfg "$@"
fred@trusy-ar:~$

Cavsfan
August 25th, 2015, 02:59 PM
That grub command in Arch is really the same. In grub legacy it also was sudo update-grub.


fred@trusy-ar:~$ whereis update-grub
update-grub: /usr/sbin/update-grub /usr/share/man/man8/update-grub.8.gz
fred@trusy-ar:~$ cat /usr/sbin/update-grub
#!/bin/sh
set -e
exec grub-mkconfig -o /boot/grub/grub.cfg "$@"
fred@trusy-ar:~$


Yes, I guess in Arch they just did not create the script.
I had run grub-mkconfig just to produce the output of grub in a text file before. So it makes sense that it would work.

von Stalhein
October 23rd, 2015, 11:46 PM
Just updated to 15.10 and can't make the grub update name that dist - i.e. it remains as Vivid after a sudo update-grub

Before I go fiddling and give myself another intensive "learning experience", what's the obvious thing I'm missing here?

Cavsfan
October 24th, 2015, 04:10 PM
Just updated to 15.10 and can't make the grub update name that dist - i.e. it remains as Vivid after a sudo update-grub

Before I go fiddling and give myself another intensive "learning experience", what's the obvious thing I'm missing here?


gksudo gedit /etc/grub.d/06_custom

That is where your custom entries should be.

That is where you change them and whatever you put between the quotes at the top as well as in each menu entry is what will display after a sudo update-grub.

Cavsfan
October 24th, 2015, 04:14 PM
I'll be editing the wiki today to get Utopic out as it's past EOL and Wily Werewolf 15.10 in it.

Cavsfan
October 24th, 2015, 05:26 PM
I updated the wiki adding Wily Werewolf 15.10. Let me know if there you see any errors.

von Stalhein
October 26th, 2015, 09:11 AM
gksudo gedit /etc/grub.d/06_custom

That is where your custom entries should be.

That is where you change them and whatever you put between the quotes at the top as well as in each menu entry is what will display after a sudo update-grub.

Thanks Cavsfan, awesome!

Cavsfan
October 26th, 2015, 03:24 PM
Thanks Cavsfan, awesome!

Glad I could help! :)

Cavsfan
October 27th, 2015, 08:45 PM
Thought it was time to post a new screenie of grub.

http://en.zimagez.com/miniature/20151027143535.jpg (http://en.zimagez.com/zimage/20151027143535.php)

It's the same picture because I like how the cyan and red look with that background.

Cavsfan
November 19th, 2015, 08:15 PM
@oldfred,
I did finally notice that there is an update-grub in Arch in the AUR.

But, on Arch I'm keeping everything default so I didn't install it.

Cavsfan
February 1st, 2016, 07:40 PM
If you have your customized grub on Xenial Xerus 16.04, with today's update to grub-pc the font location changed in /etc/grub.d/05_debian_theme.

Instead of the font colors going after line 165, it's back up to after line 122:

122 echo "if background_image `make_system_path_relative_to_its_root "${1}"`; then"
123 echo " set color_normal=light-red/black"
124 echo " set menu_color_normal=cyan/black"
125 echo " set menu_color_highlight=red/black"

Cavsfan
March 19th, 2016, 04:51 PM
Just 3 OSs on my system now.

http://www.zimagez.com/miniature/20160229163727.jpg (http://www.zimagez.com/zimage/20160229163727.php)

Cavsfan
April 8th, 2016, 10:28 PM
Finally a new pic on Arch Linux with white at the top and bottom, cyan as the normal color (box and inside the box) and red as the highlighted color.
Although that is hard to see from the picture; that is what it is.

http://en.zimagez.com/miniature/20160408161917.jpg (http://en.zimagez.com/zimage/20160408161917.php)

von Stalhein
April 11th, 2016, 09:54 AM
Nice job Cavsfan :D Keep up the good work!

Cavsfan
April 11th, 2016, 04:08 PM
Nice job Cavsfan :D Keep up the good work!

Thank you kindly! :D

Cavsfan
April 25th, 2016, 05:40 PM
I'm unable to edit the wiki right now so until that issue is resolved, I just post the only change that is necessary for 16.04.

It was from a previous post up the page a little.

http://ubuntuforums.org/showthread.php?t=2076205&page=39&p=13432553#post13432553

I still need to add to the wiki newly released 16.04 and remove 15.04 as it's past EOL.

Cavsfan
April 26th, 2016, 05:25 PM
I was finally able to fix the wiki to remove Vivid Vervet 15.04 and add Xenial Xerus 16.04 LTS.

Please let me know if you find any errors or problems.

I left out upstart with 16.04 because I was never able to successfully use it anyway.
Systemd is the way of the future and upstart will likely be phased out in the near future.

Kind regards :)

von Stalhein
April 27th, 2016, 12:31 PM
The only issue I encountered was that for some reason the upgrade borked keyboard and mouse capability in GRUB.

I was able to re-enable through the BIOS in the Integrated Peripherals table, in the USB menu - weird!

I will fiddle with my text colour though as when not highlighted (cyan) it's white & hard to see.

First world problems!

BTW - what’s the best way to screenshot the GRUB screen?

Cavsfan
April 27th, 2016, 02:11 PM
The only issue I encountered was that for some reason the upgrade borked keyboard and mouse capability in GRUB.

I was able to re-enable through the BIOS in the Integrated Peripherals table, in the USB menu - weird!

I will fiddle with my text colour though as when not highlighted (cyan) it's white & hard to see.

First world problems!

BTW - whatís the best way to screenshot the GRUB screen?

I take a picture with my phone's camera and upload it to my pc via wifi.

I created an account on http://en.zimagez.com/
That way you can edit or delete pictures if you're logged in.
I upload them there and it gives you the forum code for posting in this forum.

Grub first looks for the 1st picture it finds in /boot/grub/ then it will find your colors in /etc/grub.d/05_debian_theme after line 122.

If there is no picture it will not use those colors you have setup. And not all pictures work, sometimes I've had to try more than one, but rarely.

von Stalhein
April 29th, 2016, 10:23 AM
Cheers for that - I'll fiddle with the text. Thanks for the image hosting link, I'll give it a go - will probably use the phone as I don't have a wifi card in the Canon - yet :-)

GRUB finds the pic so nothing is wrong there AFAIK.

Cavsfan
April 29th, 2016, 04:31 PM
Cheers for that - I'll fiddle with the text. Thanks for the image hosting link, I'll give it a go - will probably use the phone as I don't have a wifi card in the Canon - yet :-)

GRUB finds the pic so nothing is wrong there AFAIK.

Good mate! :) I was going to ask you if you ever got it fixed and looking good.

Let me know if you need anything or when you get it done.

Cavsfan
July 1st, 2016, 06:31 PM
I seriously cannot understand why anyone would use the default grub.

I added another install of Xubuntu 16.04 just for the halibut :P and everytime it adds a kernel through updates, I wait about 2-3 minutes on it updating grub (default).
It does this twice every time a new kernel is added.
The long wait occurs after it finds the kernels (/etc/grub.d/10_linux) and before the other OSs are updated (/etc/grub.d/30_os-prober)

I have to customize this thing because once done it goes through an update-grub in about 2 seconds.
Lets see 2-3 minutes or 2 seconds; I'll take 2 seconds.

Cheers

Cavsfan
July 19th, 2016, 08:55 PM
I'm finding that PNG pictures work a lot better than JPG pictures. I tried to grow a JPG picture in pixel size with GIMP and while it listed the pic in the output of update-grub, it would not show at boot.
So, I got frustrated, did some research and seen where someone had posted that PNG pictures work better with Grub in Arch.

So, I took that same picture in GIMP and exported it as a PNG file and viola it worked like it should have. ;)

It has to work better in any distro...

Cavsfan
July 19th, 2016, 10:51 PM
Forgot to mention that nano is probably the best editor as you can just enter sudo nano /etc/default/grub etc.

Cntl+Shift+V will paste whatever is on your clipboard just like it does in terminal.
You can copy stuff from gedit, mousepad or whatever text editor you use and paste it into the file.

But, gksudo gedit file or gksudo mousepad file, etc. works too. Whatever floats your boat. :p

Cavsfan
July 25th, 2016, 11:04 PM
Newest screenshot:

http://en.zimagez.com/miniature/20160725175516.jpg (http://en.zimagez.com/zimage/20160725175516.php)

von Stalhein
July 26th, 2016, 12:05 PM
Not a lot going on here Cavsfan :)

http://i.imgur.com/x5GgnsUm.jpg (http://imgur.com/x5GgnsU)

Cavsfan
July 26th, 2016, 05:56 PM
Not a lot going on here Cavsfan :)

http://i.imgur.com/x5GgnsUm.jpg (http://imgur.com/x5GgnsU)

Nice! I see you have XP still. I was using Vista and hated it.
Then I got in on testing Windows 7 and my son showed me where I could get a full install ISO for cheap.
Which I installed and then in the last 6 months he showed me that I could upgrade to Windows 10 for free.

I could live without windows easily but, I like to keep up with it so I can help a family member or a friend.
Plus my wife uses it at work.

Looking good though and thanks for posting a screenshot! :)

von Stalhein
July 27th, 2016, 12:31 PM
Cheers!
I only have XP in the list as this machine is a Frankenstein of old parts and that OS is on an old HDD from about 2003. In the near future I'm hoping to build something with some serious grunt but funds are tight!

I'm running Arch & Fedora in a VM but don't have the space to "promote" any more OS's to GRUB atm.

The image is that of rice paddy terraces taken from a civet coffee (https://en.wikipedia.org/wiki/Kopi_Luwak) farm in Bali, where we visited a couple of years ago.

Cavsfan
July 27th, 2016, 04:38 PM
Cheers!
I only have XP in the list as this machine is a Frankenstein of old parts and that OS is on an old HDD from about 2003. In the near future I'm hoping to build something with some serious grunt but funds are tight!

I'm running Arch & Fedora in a VM but don't have the space to "promote" any more OS's to GRUB atm.

The image is that of rice paddy terraces taken from a civet coffee (https://en.wikipedia.org/wiki/Kopi_Luwak) farm in Bali, where we visited a couple of years ago.

I totally understand. I've had this machine since 2009 and have replaced the HD and a bunch of fans including the CPU fan, plus the monitor.
But, that's about it and I'm hoping it'll hang on a couple more years.

That's a long way to go for a good cup of coffee. :D Nice image though!

Kind regards

Cavsfan
August 1st, 2016, 05:11 PM
I just edited the Wiki to add that you can use whatever type editor you are best suited with near the top.

I also added the different types of picture types that Grub2 accepts: *.jpg, *.jpeg, *.png and *.tga pictures. But, PNG pictures seem to work the best.

Cheers

Cavsfan
September 25th, 2016, 08:51 PM
If any one is interested, Yaketty Yak 16.10 grub customization is identical to Xenial Xerux 16.04.

I installed it yesterday and while going through the installation process, I noticed it stayed on "running 'update-grub'" for about 5 minutes.
So, before I installed the kernel that was in the update queue, I customized, rebooted and then installed the kernel.

Once customized it flies through update-grub in about one second. It seems to hang while probing for other operating systems, namely Windows 10 and Arch Linux.
It may not take that long on your system, but I had to do it myself since I'm on an old SATA drive with no SSD but, one of these days...

Cavsfan
October 17th, 2016, 08:46 PM
I just updated the wiki to include Yakkety Yak 16.10 and also removed Wily Werewolf 15.10.

When I removed 15.10 I also removed the code for using upstart.

Systemd is the way of future anyway.

Cavsfan
November 10th, 2016, 05:18 PM
My latest Grub screen with all Arch entries. Although it is on Arch, it could be on any Linux distro that I've used so far:

http://www.zimagez.com/miniature/20161025132409.jpg (http://www.zimagez.com/zimage/20161025132409.php)

von Stalhein
November 11th, 2016, 02:17 AM
I've spent an hour looking through the wiki(s), my directories and the web but I can't find/remember how I customised the terminal output when running
sudo update-grub
It outputs the distributions as it adds them to the GRUB menu. :(

Cavsfan
November 11th, 2016, 06:53 PM
I've spent an hour looking through the wiki(s), my directories and the web but I can't find/remember how I customised the terminal output when running
sudo update-grub
It outputs the distributions as it adds them to the GRUB menu. :(

Not sure what you are asking. sudo update-grub will update the /boot/grub/grub.cfg file and the boot entries based on what is executable in /etc/grub.d/ like 06_custom.

If you have customized the grub and have /etc/grub.d/06_custom not executable, then those entries will not show up at boot time.
Make it executable by this command:

sudo chmod +x /etc/grub.d/06_custom

Then sudo update-grub should list the custom entries above all of the other entries. Then when you are good with the way they work make these files unexecutable:

sudo chmod -x/etc/grub.d/10_linux
sudo chmod -x/etc/grub.d/30_os-prober

and once again sudo update-grub and it should list only your picture that you are using and what you have between the quotes in the 2nd line of /etc/grub.d/06_custom.

BTW, PNG pictures work much better than JPG.

I hope this is what you needed.

von Stalhein
November 15th, 2016, 07:10 AM
Hi Cavsfan - yep that was it.

I have a little message in the start of that bash file that echoes what's actually going on and I'd upgraded to 16.10 & hadn't tidied it up.
Cheers!! ):P

Cavsfan
November 15th, 2016, 06:23 PM
Hi Cavsfan - yep that was it.

I have a little message in the start of that bash file that echoes what's actually going on and I'd upgraded to 16.10 & hadn't tidied it up.
Cheers!! ):P

Great! I thought that might be it.
Cheers! ):P

Cavsfan
November 15th, 2016, 06:38 PM
Just for an explanation of why you do edit the custom file even though it says not to.
It's because you add an echo line to list your systems or else all you would see is the picture listed e.g. /boot/grub/picture.png in the output of sudo update-grub.

The file originally contains this:

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

The +3 in the 2nd line means to start execution at the 3rd line.

But, after adding the line listing the systems it needs to be changed to +4 so it will start execution at the 4th line.

#!/bin/sh
echo 1>&2 "Adding Arch Linux, Xubuntu Xenial Xerus 16.04 LTS, Xubuntu Yakkety Yak 16.10, Xubuntu Zesty Zapus 17.04 and Windows 10"
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.

The 4th line would be the 1st menuentry line.

Cavsfan
March 3rd, 2017, 07:34 PM
I got bored...

http://en.zimagez.com/miniature/20170222163033.jpg (http://en.zimagez.com/zimage/20170222163033.php)

Cavsfan
March 7th, 2017, 04:51 PM
Installed Zesty Zapus 17.04 and customized the grub on it.

For those brave enough to have your custom grub on 17.04, the 16.04 and 16.10 method is exactly the same.

Zesty does appear to be working pretty well. I installed Xubuntu of course.

von Stalhein
March 8th, 2017, 09:59 AM
Does one need to be "very" brave to use 17.04 Cavsfan?? :P

Cavsfan
March 8th, 2017, 05:11 PM
Does one need to be "very" brave to use 17.04 Cavsfan?? :P

Not sure, it seems to be pretty good, but it's just a nine month release. I prefer to have my grub on an LTS or I have mine now on Arch Linux.
Haven't kept up with it until now. I'm sure it would be OK as long as one is prepared if something happens.

von Stalhein
March 9th, 2017, 09:44 AM
Cheers! I tend to update every release but do a clean install every second one.
A bigger priority is updating this box to the 20th C :-)
Keep up the good work!

Cavsfan
March 9th, 2017, 04:44 PM
Cheers! I tend to update every release but do a clean install every second one.
A bigger priority is updating this box to the 20th C :-)
Keep up the good work!

Ha! Thank you kindly! :)

Cavsfan
April 19th, 2017, 10:28 PM
My newest Grub menu on Zesty Zapus 17.04:

http://en.zimagez.com/miniature/20170419165958.jpg (http://en.zimagez.com/zimage/20170419165958.php)


If you can't tell it has these colors in /etc/grub.d/05_debian_theme:

echo " set color_normal=yellow/black"
echo " set menu_color_normal=cyan/black"
echo " set menu_color_highlight=red/black"

von Stalhein
May 17th, 2017, 11:53 AM
Hello Cavsfan - I want to change the font colours on my screen as they are hard to see on the background.

The wiki says to replace the lines from #122 but mine is a bit different (or is it??) :p

From line #116 in my /etc/grub.d/05_debian_theme file:


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"
}

So, does that all gets scrubbed and replaced with:


echo "if background_image `make_system_path_relative_to_its_root "${1}"`; then"
echo " set color_normal=cyan/black"
echo " set menu_color_normal=yellow/black"
echo " set menu_color_highlight=red/black"

My colours would be different but I've used the wiki example.
Thanks!

Cavsfan
May 22nd, 2017, 07:46 PM
Hello Cavsfan - I want to change the font colours on my screen as they are hard to see on the background.

The wiki says to replace the lines from #122 but mine is a bit different (or is it??) :p

From line #116 in my /etc/grub.d/05_debian_theme file:


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"
}

So, does that all gets scrubbed and replaced with:


echo "if background_image `make_system_path_relative_to_its_root "${1}"`; then"
echo " set color_normal=cyan/black"
echo " set menu_color_normal=yellow/black"
echo " set menu_color_highlight=red/black"

My colours would be different but I've used the wiki example.
Thanks!

Hi von Stalhein!
I don't know why but, I am not getting notifications that you posted this.

But, the answer to your question is that you just insert the 3 lines below the red line that is line 122.
Do not remove anything, just add those 3 lines as the colors you want to see.

Here is my /etc/grub.d/05_debian_theme starting with line 121 (the red lines below are lines 123, 124 and 125):

echo "insmod ${reader}"
echo "if background_image `make_system_path_relative_to_its_root "${1}"`; then"
echo " set color_normal=black/black"
echo " set menu_color_normal=blue/black"
echo " set menu_color_highlight=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"

This is on Xenial Xerus 16.04 but, 17.04 is identical to 16.10 about customizing the grub.

von Stalhein
May 23rd, 2017, 10:55 AM
Awesome Cavsfan, thanks & please excuse my denseness :-)

Cavsfan
May 23rd, 2017, 08:58 PM
Awesome Cavsfan, thanks & please excuse my denseness :-)

Glad you got it sorted out! No one is perfect my friend!

Looking at some of these files is overwhelming even to me but, I've just played around with them enough to find where to put the colors at to get them to work. :)

Cheers Mate!

Cavsfan
June 27th, 2017, 10:45 PM
I have always had a DVI to HDMI cable. The DVI end plugged into the Nvidia GeForce 9800 GT card and the HDMI end plugged into the LED monitor in my 10 year old PC.

I have always had to use the increased size of the font in Grub2 for it to look correct.

However, I replaced a fan in my PC a few days ago and noticed that the Nvidia card also had an HDMI port, so I used an HDMI to HDMI cable and plugged it into the Nvidia card for the 1st time ever.

I turn the thing on and the font was very large and I had to scroll up and down to see which option I needed.
I commented out the GRUB_FONT line in the /etc/default/grub file and then it looked normal again.

I know for sure at one time this was necessary but, with some of the new technology, which I am not using all of yet, it appears that this part has changed and the Grub font is normally bigger than it used to be.

Have I been missing that point all this time - that using an HDMI cable negates the need for a larger font in Grub2?

Cavsfan
June 29th, 2017, 04:17 AM
Fresh install on older computer Xubuntu Zesty Zapus 17.04 default grub update time 5 minutes and 30 seconds:
With Arch Linux, Xubuntu Xenial Xerus 16.04 LTS, Xubuntu Zesty Zapus 17.04, Xubuntu Artful Aardvark 17.10 and Windows 10 also installed on it.

cavsfan@cavsfan-Le-Beast:/etc/grub.d$ lsa
total 100
drwxr-xr-x 2 root root 4096 Jun 28 21:50 .
drwxr-xr-x 147 root root 12288 Jun 28 21:29 ..
-rwxr-xr-x 1 root root 9783 Mar 30 17:45 00_header
-rwxr-xr-x 1 root root 6258 Nov 1 2016 05_debian_theme
-rwxr-xr-x 1 root root 2299 Jun 28 21:50 06_custom
-rwxr-xr-x 1 root root 12676 Mar 30 17:45 10_linux
-rwxr-xr-x 1 root root 11281 Mar 30 17:45 20_linux_xen
-rwxr-xr-x 1 root root 1992 Jan 28 2016 20_memtest86+
-rwxr-xr-x 1 root root 12059 Mar 30 17:45 30_os-prober
-rwxr-xr-x 1 root root 1418 Mar 30 17:45 30_uefi-firmware
-rwxr-xr-x 1 root root 214 Mar 30 17:45 40_custom
-rwxr-xr-x 1 root root 216 Mar 30 17:45 41_custom
-rw-r--r-- 1 root root 483 Mar 30 17:45 README
It stopped and took the most time after 20_memtest86+ displayed.

cavsfan@cavsfan-Le-Beast:/etc/grub.d$ date && sudo update-grub && date
Wed Jun 28 22:11:15 EDT 2017
Generating grub configuration file ...
Adding Arch Linux, Xubuntu Xenial Xerus 16.04 LTS, Xubuntu Zesty Zapus 17.04, Xubuntu Artful Aardvark 17.10 and Windows 10
Found linux image: /boot/vmlinuz-4.10.0-24-generic
Found initrd image: /boot/initrd.img-4.10.0-24-generic
Found linux image: /boot/vmlinuz-4.10.0-19-generic
Found initrd image: /boot/initrd.img-4.10.0-19-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 10 on /dev/sda1
Found Arch Linux on /dev/sda2
Found Ubuntu 16.04.2 LTS (16.04) on /dev/sda4
Found Ubuntu 17.04 (17.04) on /dev/sda6
done
Wed Jun 28 22:14:38 EDT 2017

After customization 2 seconds:

cavsfan@cavsfan-Le-Beast:/etc/grub.d$ sudo chmod -x 10_linux
cavsfan@cavsfan-Le-Beast:/etc/grub.d$ sudo chmod -x 20_memtest86+
cavsfan@cavsfan-Le-Beast:/etc/grub.d$ sudo chmod -x 30_os-prober
cavsfan@cavsfan-Le-Beast:/etc/grub.d$ lsa
cavsfan@cavsfan-Le-Beast:/etc/grub.d$ lsa
total 100
drwxr-xr-x 2 root root 4096 Jun 28 21:50 .
drwxr-xr-x 147 root root 12288 Jun 28 21:29 ..
-rwxr-xr-x 1 root root 9783 Mar 30 17:45 00_header
-rwxr-xr-x 1 root root 6258 Nov 1 2016 05_debian_theme
-rwxr-xr-x 1 root root 2299 Jun 28 21:50 06_custom
-rw-r--r-- 1 root root 12676 Mar 30 17:45 10_linux
-rwxr-xr-x 1 root root 11281 Mar 30 17:45 20_linux_xen
-rw-r--r-- 1 root root 1992 Jan 28 2016 20_memtest86+
-rw-r--r-- 1 root root 12059 Mar 30 17:45 30_os-prober
-rwxr-xr-x 1 root root 1418 Mar 30 17:45 30_uefi-firmware
-rwxr-xr-x 1 root root 214 Mar 30 17:45 40_custom
-rwxr-xr-x 1 root root 216 Mar 30 17:45 41_custom
-rw-r--r-- 1 root root 483 Mar 30 17:45 README

cavsfan@cavsfan-Le-Beast:/etc/grub.d$ date && sudo update-grub && date
Wed Jun 28 22:16:45 EDT 2017
Generating grub configuration file ...
Adding Arch Linux, Xubuntu Xenial Xerus 16.04 LTS, Xubuntu Zesty Zapus 17.04, Xubuntu Artful Aardvark 17.10 and Windows 10
done
Wed Jun 28 22:16:47 EDT 2017

deadflowr
June 29th, 2017, 06:11 AM
You can use time like

time sudo update-grub
(Or at least I can)

Cavsfan
June 29th, 2017, 08:38 PM
You can use time like

time sudo update-grub
(Or at least I can)

Thanks. I tried that and it didn't work. I just tried typing in time and it gave an error, so I went with date, which did work.

I dist-upgraded a fresh 17.04 install to a 17.10 install just now and do not know if that made any difference or not. But, it works now.

But, I at first just made my 06_custom executable because I could see grub would be updated and didn't want to go through the wait time.
Since that is all I did, it was slow so I thought I would time it like that. 5 and a half minutes versus 2 seconds; I'll take the 2 seconds any day of the week.

It's likely that on newer, faster computers perhaps with SSDs the time is not a factor but, for me now it most definitely is.

Cavsfan
July 19th, 2017, 02:57 PM
Grub has gotten much more simple to customize over the last few Ubuntu versions. The Wiki has been noted with some * where entries are no longer required.

Now, you just need to basically drop a desktop sized picture - PNG works best into /boot/grub/ and then add your colors to /etc/grub.d/05_debian_theme.

Create a file with your custom boot entries in /etc/grub.d/06_custom

Change your default boot line in /etc/default/grub (if you do not want the 1st one) and change the timeout (if you prefer something other than 10 seconds).

Update-grub and your are basically ready to go.

von Stalhein
July 21st, 2017, 11:32 AM
Gee whiz Cavsfan, not having to spend hours chasing up obscure settings and avoiding screens and screens of cli work is going to upset the purists!!!
:lolflag:

Cavsfan
July 22nd, 2017, 09:24 PM
:lolflag:
Gee whiz Cavsfan, not having to spend hours chasing up obscure settings and avoiding screens and screens of cli work is going to upset the purists!!!

I guess you can still got through all of that if you want. But, when I went to using an HDMI to HDMI cable the letters were HUGE and I had to comment the fonts out.
Then I discovered a few other things by accident that weren't needed with the newer versions of Grub.

:lolflag:

I haven't gotten to look at Arch Linux grub but, Ubuntu grub definitely works without as much fiddling. :popcorn:

Cavsfan
July 28th, 2017, 08:26 PM
I installed Artful Aardvark 17.10 a few days ago and as default, the fonts were big just like making the old fonts were with my non-HDMI cable.
So, I just edited /etc/default/grub, set the default, the timeout and that was it.
I then copied my 06_custom file into /etc/grub.d/, made it executable and made these other 3 files unexecutable.

cavsfan@cavsfan-Le-Beast:/etc/grub.d$ lsa | grep -e "10_l" -e "20_m" -e "30_o"
-rw-r--r-- 1 root root 12676 Jul 5 18:23 10_linux
-rw-r--r-- 1 root root 1992 Jan 28 2016 20_memtest86+
-rw-r--r-- 1 root root 12059 Jul 5 18:23 30_os-prober


sudo update-grub and bam I had everything but, the picture and colored fonts.

On older computers like mine that just have 4 partitions and logical partitions, grub does not see past the physical partitions.
So, to login to Zesty Zapus 17.04, which is on a logical partition sda6, it had it as sda4 and to boot into it I had to edit that boot line.

But, I don't have to any longer. ;)

Cavsfan
July 30th, 2017, 10:37 PM
I spent a few hours today cleaning this wiki up: removing much of the unnecessary wording, the outdated material and hopefully simplified the whole thing.

I have to remove the one old outdated grub screenshot and add some newer ones and I think that is about all that is left.

If you get a chance take a look at it and see if it is cleaner and simpler to work with.

Also, feel free to post pictures of your grub screen. I use my phone camera, then upload it to my pc and post it on http://en.zimagez.com/

That site seems to be pretty stable. I have a login and can view pictures I've posted before. I know whatever site I used to post pics on vanished.

Here is my latest grub screen on Artful Aardvark 17.10:

http://en.zimagez.com/miniature/20170730134559.jpg (http://en.zimagez.com/zimage/20170730134559.php)

Regards

Bashing-om
July 30th, 2017, 10:46 PM
Cavsfan; Hey ...

You do good work ,, Looks fine to me - simple and straight forward .



when you are good



you are good

oldfred
July 30th, 2017, 11:07 PM
I like to add a spacer line for separation if types of systems, my ISO files as configfile, and reboot or shutdown from grub in my 40_custom.
Although one time in testing the number to boot with, I tried to boot a spacer line. That did not too well..


# spacer line
menuentry " " {
set root=
}

menuentry 'Live ISOs on SSD' {
configfile (hd0,5)/livecdimage.cfg
}

menuentry 'Live ISOs on HDD (boot on SSD)' {
configfile (hd1,6)/livecdimage.cfg
}

# spacer line
menuentry " " {
set root=
}

menuentry "System restart" {
echo "System rebooting..."
insmod reboot
reboot
}

menuentry "System shutdown" {
echo "System shutting down..."
insmod halt
halt
}

Cavsfan
July 31st, 2017, 04:41 PM
Cavsfan; Hey ...

You do good work ,, Looks fine to me - simple and straight forward .

when you are good


you are good







Thank you for looking it over! I had gotten way too wordy and there was so much unneeded junk in there I had to take it out.

Now, hopefully it is as straight forward as it can get and more people will use it because it is so simple now.
I seen where in many places it could be confusing but, that should be gone now.

Now to add more up to date screenshots...

Cavsfan
July 31st, 2017, 05:38 PM
I like to add a spacer line for separation if types of systems, my ISO files as configfile, and reboot or shutdown from grub in my 40_custom.
Although one time in testing the number to boot with, I tried to boot a spacer line. That did not too well..


# spacer line
menuentry " " {
set root=
}

menuentry 'Live ISOs on SSD' {
configfile (hd0,5)/livecdimage.cfg
}

menuentry 'Live ISOs on HDD (boot on SSD)' {
configfile (hd1,6)/livecdimage.cfg
}

# spacer line
menuentry " " {
set root=
}

menuentry "System restart" {
echo "System rebooting..."
insmod reboot
reboot
}

menuentry "System shutdown" {
echo "System shutting down..."
insmod halt
halt
}

That's pretty nice. I might try that spacer menuentry sometime. Just curious as to why you use 40_custom as it would be on the bottom?

My son is going to sell me his 3 year old PC soon. He has a friend that is building him an even better one.

This is an i7 5th or 6th gen with 16GB memory, several SSDs and a 2 1TB SATA drive setup I believe in Raid 1. It boots up in about ~3 seconds.
He has an Nvidia GeForce GTX 1080 Ti, which he plans to sell because I'm not a gamer like he is.
Still much better than this nearly 10 year old PC i'm working from. It has been good to me though. I've just had to replace a few fans, including the CPU fan and the HD.

I expect my knowledge about the newer stuff will grow then.

I'v never shut it down except to clean it out or when severe storms passed by. I just put it in suspend mode or sleep on Windows 10.

I believe now I could make entries for the 2 kernels most people keep on Ubuntu but, why?

In 8-10 years of dealing with Linux I have not seen the need to boot into an older kernel not even once.
I don't care to have that many choices and have to scroll down to see them.

Bashing-om
July 31st, 2017, 08:27 PM
Cavsfan; Hey;

I throw my 2 cents in here .


I believe now I could make entries for the 2 kernels most people keep on Ubuntu but, why?

In 8-10 years of dealing with Linux I have not seen the need to boot into an older kernel not even once.
I don't care to have that many choices and have to scroll down to see them.


1) The way I tend to mess around; there have been a number of times I was glad I kept an old booting kernel around :)
2) Many times I have assisted in re-installing a graphic's driver that is broke upon a new kernel install. Nice to have a fall back.
3) There are those times a new kernel just is not happy with the hardware; whereas the old kernel is fine - awaiting a kernel update !
4) Just having a back up for what ever might happen - is a good thing -> cheap insurance.

2 kernels. recovery kernels and maybe "upstart" Though I have not touched upstart since the advent of systemd .


never can tell



what might happen

Cavsfan
July 31st, 2017, 09:41 PM
Cavsfan; Hey;

I throw my 2 cents in here .


1) The way I tend to mess around; there have been a number of times I was glad I kept an old booting kernel around :)
2) Many times I have assisted in re-installing a graphic's driver that is broke upon a new kernel install. Nice to have a fall back.
3) There are those times a new kernel just is not happy with the hardware; whereas the old kernel is fine - awaiting a kernel update !
4) Just having a back up for what ever might happen - is a good thing -> cheap insurance.

2 kernels. recovery kernels and maybe "upstart" Though I have not touched upstart since the advent of systemd .
never can tell


what might happen





OK, I'll have to add that. People will have the option to add it or not; simple choice. But, choices are nice from what I gather. :)

I tried it once and failed but, I've come a long way since then. I managed to customize the Arch Linux grub which is somewhat different but, not that much.
I tried to do that and couldn't figure it out at first then came back after a while and did it.
It seems like over the years my knowledge of Grub has grown, along with the input from others. I've learned a thing or two from oldfred.

LoL! I'm using Vivaldi now, an offshoot of Chrome I understand. I love it. But, control b will make something bold posting in the forum and it also brings up a tab with Bookmarks in it, so it does both.
But, I believe it uses less memory than Firefox. I use it in Windows 10 too as I've seen a pop-up warning me to close Firefox because I'm getting low on memory (I only have 4GB).
Pretty sad when I only have a spreadsheet and Firefox open. :p

If it was just me I'd do away with Windows but, I still have some uses for it, like helping friends with their problems, so it stays...

Cavsfan
July 31st, 2017, 11:02 PM
@Bashing-om, check the Wiki now. I've added the ability to boot into the backup kernel.

I edited the 1st post and mentioned that as well as mentioned that it should be easier now.

See what you think.

Bashing-om
July 31st, 2017, 11:26 PM
Cavsfan; well ...
Hummm ...


menuentry "Xubuntu Xenial Xerus 16.04 LTS (backup kernel)" {
set root=(hd0,2)
linux /vmlinuz.old root=/dev/sda2 ro recovery nomodeset
initrd /initrd.img.old

I would not think that we want a recovery console or to defeat kernel mode setting (nomodeset) on our back up kernel .
It is great that you advise there are choices !

Overall, though - looking better alla the time .



like fine wine



get better with time

Cavsfan
August 1st, 2017, 05:06 PM
Cavsfan; well ...
Hummm ...


menuentry "Xubuntu Xenial Xerus 16.04 LTS (backup kernel)" {
set root=(hd0,2)
linux /vmlinuz.old root=/dev/sda2 ro recovery nomodeset
initrd /initrd.img.old

I would not think that we want a recovery console or to defeat kernel mode setting (nomodeset) on our back up kernel .
It is great that you advise there are choices !

Overall, though - looking better alla the time .

like fine wine


get better with time







Thanks for pointing that error out. I fixed it as well as a couple of other things I spotted.
It should be good to go now but, let me know if you see anything else. I appreciate you taking the time to look at it.
I want nothing less than perfection on something as important as the Grub menu.

I was going to try it on Artful but, there I currently have only one kernel.
So, I got on Xenial and tried the backup kernel and it worked great.

Then later I got on Zesty and tried it there; it worked there too. So, I'd say it's good and will boot into the backup kernel.

Just now when I tried to boot into Artful I accidentally selected the backup kernel and it gave an error but, at least it just said press any key and took me back to the menu to select the right one.

So, :guitar:

Now, I just need to add some current example pictures.

Bashing-om
August 1st, 2017, 06:59 PM
Cavsfan; Uh Huh /

Looking good .

You have no idea how many times and places I recommend your method(s). Yeah we want it right and the simpler the better .

But


we do not knock what works :)

Cavsfan
August 1st, 2017, 09:51 PM
Cavsfan; Uh Huh /

Looking good .

You have no idea how many times and places I recommend your method(s). Yeah we want it right and the simpler the better .

But

we do not knock what works :)




Well, thank you very much! I really appreciate that! :)

Cavsfan
August 9th, 2017, 08:58 PM
OK, so I finally added some new pictures to the Wiki with some current versions.

I even found what I had always been meaning to add - the "Back to top" links.

See what you think. Did I get the "Back to top" links in the proper places?

Cheers

Bashing-om
August 9th, 2017, 09:18 PM
Cavsfan; Yepper .

Look'n good . The - "Back to top" links are a nice touch and are functional . The link makes it so much easier for someone to make sure their thoughts are in order :)


just goes to show - no matter how good



can always be better

Cavsfan
August 10th, 2017, 04:24 AM
Cavsfan; Yepper .

Look'n good . The - "Back to top" links are a nice touch and are functional . The link makes it so much easier for someone to make sure their thoughts are in order :)
just goes to show - no matter how good


can always be better






Thanks for taking a good look at it for me! :)

I hope the word gets around that's it's much, much simpler to do now.

I tried my best to change it to a logical order that one can follow in sequence.
Before you had to jump around from here to there and back, etc.

BTW, I found that the default Grub takes a long time updating when it's looking at /etc/grub.d/30_os-prober.
Probably because my system is so old and there often are 3 to 5 systems on it. It takes 3-5 minutes at that point for me.
It's torturous for me to go through a kernel installation where it updates Grub twice.
But, once customized it takes 2-3 seconds to update.

Cavsfan
August 22nd, 2017, 06:31 PM
I just discovered something interesting about recovery mode. I had the 17.10 alpha installed on a partition and accidentally installed the nVidia driver, which I knew would not work, so I tried to cancel it.

That did not work so, I tried recovery mode, dropped to a root shell and since it is read only I could not purge the nVidia driver, etc. so I edited the grub line and made it read/write. That worked like it should have in the first place.

So, I updated the Wiki for the Recovery line to be rw instead of ro.

I do not know why you would want to boot into recovery mode read-only when you are trying to fix your system; seems odd to me.
If you do not know what you are doing, you should not be in recovery mode in the first place, if that is why it is read only.

But, this sure saved me from doing another install of Artful 17.10. Plus why have to go through the process of editing the grub line to change it from ro to rw?

Win win I do believe....

If you find yourself needing to use recovery mode to drop to a root shell and do not have access to make the necessary updates, do this:
edit the recovery line at boot time and change the ro recovery nomodeset to rw recovery nomodeset so it will be a temporary change.

That will accomplish what you need.

oldfred
August 22nd, 2017, 07:21 PM
I thought it was read only so you could run fsck.
And does not recovery mode give a menu anymore, it used to have a menu with several options including command line with Internet, or continue booting, plus others?

Cavsfan
August 22nd, 2017, 08:21 PM
I thought it was read only so you could run fsck.
And does not recovery mode give a menu anymore, it used to have a menu with several options including command line with Internet, or continue booting, plus others?

Thanks for the reply!

Yes, it gives you the menu. The first item is normal boot and there are several others just as it has been normally.
I did not see a command line with internet, only an option to get the network started, then it comes back to that menu; this alpha failed to get the network started but, I didn't need that.
But, when I selected the option to drop to a root shell and purge the nVidia files I had installed it gave me errors because I was in read-only mode.

I tried to cancel out of installing them but, it was too late and 17.10 will not boot up with an nVidia driver installed this early.

Not sure why you would want to be in read/only mode to run fsck or how being in read/write mode could hurt that either.

But, when dropping to a root shell to fix your system read only mode will not allow it.

Arch Linux uses read/write mode for every boot option, I just made the recovery mode read/write mode because there is no problem during a normal boot in Ubuntu.

Do you foresee a problem booting into recovery mode in read/write mode?

oldfred
August 22nd, 2017, 08:28 PM
With fsck the partition must be unmounted, so that may be the same as ro?
Otherwise I do not know.

Cavsfan
August 22nd, 2017, 08:38 PM
With fsck the partition must be unmounted, so that may be the same as ro?
Otherwise I do not know.

Thanks, I'll check into it.

Cavsfan
August 22nd, 2017, 09:49 PM
With fsck the partition must be unmounted, so that may be the same as ro?
Otherwise I do not know.

Thank you very much for jumping on that so quick and pointing out that which I did not think of.
That is not a good idea what I was doing, maybe just for the fsck part but, that is enough to stop it.

I corrected the Wiki and post #446 (https://ubuntuforums.org/showthread.php?t=2076205&page=45&p=13678930#post13678930) to say to change the ro to rw ONLY at boot time and ONLY for that one purpose.

I've learned my lesson about making decisions based on Alpha systems. I tried it on Zesty 17.04 and got the same thing; it was sort of iffy.
But, when I went to Xenial Xerus 16.04.3 it really showed me that it was the wrong thing to do.

Thanks again! :)

Bashing-om
August 22nd, 2017, 10:00 PM
Cavsfan; Uh Huh /

Concur that mounting the file system r/w is not a good thing to contemplate.
Even in the normal boot it is initially mounted ro .


cat /proc/cmdline
cat /var/log/Xorg.0.log | grep -i "command line"

Only remounted as rw after initramfs completes (??) .



got to be a reason it is done this way

Cavsfan
August 22nd, 2017, 11:06 PM
Cavsfan; Uh Huh /

Concur that mounting the file system r/w is not a good thing to contemplate.
Even in the normal boot it is initially mounted ro .


cat /proc/cmdline
cat /var/log/Xorg.0.log | grep -i "command line"

Only remounted as rw after initramfs completes (??) .

got to be a reason it is done this way




Thanks for confirming that!

Cavsfan
September 23rd, 2017, 11:45 PM
This is so easy to do now, I just installed Ubuntu 17.10 and customized it from memory. I've never done that before.

Cavsfan
February 7th, 2018, 05:59 PM
I deleted the part that contained this as both the new and backup kernels are in the Grub menu now.


Just in Case

If you need to access an older kernel or for any reason need to see the regular menu entries.
(If you are multi-booting more than one Ubuntu and the one you want to see the other kernels is not where your Grub is installed.
Login to that Ubuntu and if it is not possible to get into the system normally, Recovery for that system will do the job.
Choose "root console" from the Recovery menu.)
Enter sudo grub-install /dev/sda (where sda is the disk it is installed on) sudo blkid -c /dev/null will show the correct one if it is not known.
Enter this:
sudo chmod +x /etc/grub.d/10_linux && sudo update-grub and/or
sudo chmod +x /etc/grub.d/30_os-prober && sudo update-grub, reboot and the menu entries will be restored.

Cavsfan
March 16th, 2018, 06:15 PM
Since the previous website I had pictures on went down. Here is a new one with my current and latest grub screen:

http://i.imgur.com/WGaf0xtl.jpg (https://imgur.com/WGaf0xt)

Cavsfan
March 16th, 2018, 10:41 PM
I just added Restart and Shutdown as the bottom two options in the 06_custom file in Section 1.4.3 (https://help.ubuntu.com/community/MaintenanceFreeCustomGrub2Screen#Making_the_custom _Grub2_Menu_entries).

von Stalhein
March 22nd, 2018, 08:17 AM
I just added Restart and Shutdown as the bottom two options in the 06_custom file in Section 1.4.3 (https://help.ubuntu.com/community/MaintenanceFreeCustomGrub2Screen#Making_the_custom _Grub2_Menu_entries). Thanks Cavsfan, appreciate your work!

Cavsfan
March 24th, 2018, 05:01 PM
I just added Restart and Shutdown as the bottom two options in the 06_custom file in Section 1.4.3 (https://help.ubuntu.com/community/MaintenanceFreeCustomGrub2Screen#Making_the_custom _Grub2_Menu_entries).


Thanks Cavsfan, appreciate your work!

You are most welcome!

Cavsfan
March 29th, 2018, 06:52 PM
You gotta love Ubuntu Grub as it has 3 different colors. Arch Linux is cool but, it only has 2 colors.

This is on my new Bionic Beaver 18.04 install.

And I can attest to the fact that the picture is what makes Grub use the colors because yesterday I initially forgot to copy a picture to /boot/grub/ and the colors were black and white.
Once I added the picture, the colors appeared.

http://i.imgur.com/4x43scIl.jpg (https://imgur.com/4x43scI)

cecilpierce
April 2nd, 2018, 11:52 AM
How can I add Burg boot loader to Bionic Beaver ?

cecilpierce
April 2nd, 2018, 12:21 PM
How can I add Burg boot loader to Bionic Beaver ?

Sorry for the repost 1

oldfred
April 2nd, 2018, 02:07 PM
Burg has not been supported for years. Best not to use it.
If using BIOS, this thread is your best source for grub configuration.

If you have a newer (last 5 years) hardware and it will be UEFI. And and installs should be UEFI.
Then you can use rEFInd boot manager which also is a gui.
http://www.rodsbooks.com/refind/

New UEFI systems have their own boot manager (menu).
Grub is both the boot manager and boot loader for most Linux systems.

Cavsfan
April 22nd, 2018, 09:23 PM
@oldfred, I'm slowly coming to the conclusion that an UEFI computer cannot be customized in the same manor as Legacy MBR partitioning allowed.

I've got a newer computer and have everything installed on a 480GB SSD UEFI - Windows 10, Arch Linux and Xubuntu 16.04 so far and the Xubuntu kernels are named differently.
Instead of the generic names:
linux /vmlinuz
initrd /initrd.img

In EFI they are:
linux /boot/vmlinuz-4.13.0-38-generic
interd /boot/initrd.img-4.13.0-38-generic

This would require editing the custom entries every time a new kernel gets installed, which is the exact opposite reason this idea came about. There is a whole lot more than just the kernel names it appears too.

What do you think?

Dennis N
April 22nd, 2018, 10:21 PM
This would require editing the custom entries every time a new kernel gets installed, which is the exact opposite reason this idea came about...

Just a comment (pardon me for butting in before oldfred).

/vmlinuz and /initrd.img are just symbolic links to the newest kernel, and they function the same regardless of whether you installed under UEFI or BIOS. So that should be no problem, at least when sticking with Ubuntu flavors or Linux Mint.

Other distros (like Fedora) don't use these symbolic links but it is still possible to have a maintainance free system including those on a UEFI system. I don't think it's always possible with BIOS. So advantage to UEFI.

oldfred
April 22nd, 2018, 10:37 PM
+1 on Dennis N's comments.

I am still using 40_custom as you and Ranch Hand recommened way back when. And now I only have UEFI.

I turn off os-prober and use 40_custom to boot other installs.
The issue I have with Ubuntu's version of grub is that it is hard coded to "ubuntu" throughout. Other versions of grub seem to use this:
efi_distributor = bootloader_id; I did see a bug report long time ago where someone wanted an entry for Kubuntu so that modified grub like this from:
install_efi_ubuntu_flavours.patch
efi_distributor = bootloader_id;
+ if (strcmp (efi_distributor, "kubuntu") == 0)
+ efi_distributor = "ubuntu";
switch (platform)

I do not understand the c code, but they replace Ubuntu with Kubuntu.

I have wanted different distributors so I could directly boot more than one Ubuntu directly from UEFI. But all install to one ESP or /EFI/ubuntu.

Cavsfan
April 23rd, 2018, 12:46 AM
Just a comment (pardon me for butting in before oldfred).

/vmlinuz and /initrd.img are just symbolic links to the newest kernel, and they function the same regardless of whether you installed under UEFI or BIOS. So that should be no problem, at least when sticking with Ubuntu flavors or Linux Mint.

Other distros (like Fedora) don't use these symbolic links but it is still possible to have a maintainance free system including those on a UEFI system. I don't think it's always possible with BIOS. So advantage to UEFI.


+1 on Dennis N's comments.

I am still using 40_custom as you and Ranch Hand recommened way back when. And now I only have UEFI.

I turn off os-prober and use 40_custom to boot other installs.
The issue I have with Ubuntu's version of grub is that it is hard coded to "ubuntu" throughout. Other versions of grub seem to use this:
efi_distributor = bootloader_id; I did see a bug report long time ago where someone wanted an entry for Kubuntu so that modified grub like this from:
install_efi_ubuntu_flavours.patch
efi_distributor = bootloader_id;
+ if (strcmp (efi_distributor, "kubuntu") == 0)
+ efi_distributor = "ubuntu";
switch (platform)

I do not understand the c code, but they replace Ubuntu with Kubuntu.

I have wanted different distributors so I could directly boot more than one Ubuntu directly from UEFI. But all install to one ESP or /EFI/ubuntu.

Boy, that is some good news! Thanks Dennis for the comments. I thought this Wiki was going to become obsolete with EFI Boot.

@oldfred, those are also encouraging words! When I first installed Xubuntu 16.04 LTS, the grub would not even boot back into Xubuntu for some reason.

Luckily, in BIOS, I was able to change it to Arch_grub and it booted just fine into anything.

I'll work on it some more and see if I can come with what needs done for EFI, this stuff is Greek to me. :P

But, that which doesn't kill you, makes you stronger! :lolflag:

oldfred
April 23rd, 2018, 03:46 PM
I quickly learned to backup ESP - efi system partition.
Each install of Ubuntu overwrites the previous install in ESP. But it is only 3 lines as configfile to find full grub.cfg in your install. So now I often just manually edit to correct UUID & partition.
But editing ESP requires changes or use of live flash drive, I know try to remember to change setting while still in live installer, but some newer versions do not let install user 999 edit anything else.

In fstab is a setting on mounting ESP. With 14.04 it was defaults, but now they change it to 'umask=0077' or no permissions. I may change settings back to that, as I assume it is for security. With defaults any user in your system could change settings since with FAT32 only ownership & permissions are set at mounting. But I keep finding many times I want to change, backup or edit something in ESP. Note that Boot-Repair also changes to defaults so it can edit settings.

After my last install of bionic and with fstab permissions set so I can access it.
sudo cp -a /boot/efi/EFI/ubuntu/ /boot/efi/EFI/bionic
sudo cp -a /boot/efi/EFI/ubuntu_bu/grub.cfg /boot/efi/EFI/ubuntu/grub.cfg


fred@Asusz97:~$ cat /boot/efi/EFI/ubuntu/grub.cfg
search.fs_uuid 255a2800-b871-4fdf-a809-16987e64b8b3 root hd0,gpt6
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg


I installed Fedora, more just to see difference with grub2 than for any other reason. When I installed Fedora to sdb I told it to install grub to ESP on sdb which I do with Ubuntu, but Ubuntu never does. I was presently surprised that Fedora's grub2 did install to ESP on sdb. but it has full grub.cfg embedded in the .efi boot file and some caution on how to reinstall grub or grub2 defaults to a different configuration than Fedora's default.I prefer that Ubuntu's grub.cfg is separate.

Cavsfan
April 24th, 2018, 12:51 AM
I quickly learned to backup ESP - efi system partition.
Each install of Ubuntu overwrites the previous install in ESP. But it is only 3 lines as configfile to find full grub.cfg in your install. So now I often just manually edit to correct UUID & partition.
But editing ESP requires changes or use of live flash drive, I know try to remember to change setting while still in live installer, but some newer versions do not let install user 999 edit anything else.

In fstab is a setting on mounting ESP. With 14.04 it was defaults, but now they change it to 'umask=0077' or no permissions. I may change settings back to that, as I assume it is for security. With defaults any user in your system could change settings since with FAT32 only ownership & permissions are set at mounting. But I keep finding many times I want to change, backup or edit something in ESP. Note that Boot-Repair also changes to defaults so it can edit settings.

After my last install of bionic and with fstab permissions set so I can access it.
sudo cp -a /boot/efi/EFI/ubuntu/ /boot/efi/EFI/bionic
sudo cp -a /boot/efi/EFI/ubuntu_bu/grub.cfg /boot/efi/EFI/ubuntu/grub.cfg


fred@Asusz97:~$ cat /boot/efi/EFI/ubuntu/grub.cfg
search.fs_uuid 255a2800-b871-4fdf-a809-16987e64b8b3 root hd0,gpt6
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg


I installed Fedora, more just to see difference with grub2 than for any other reason. When I installed Fedora to sdb I told it to install grub to ESP on sdb which I do with Ubuntu, but Ubuntu never does. I was presently surprised that Fedora's grub2 did install to ESP on sdb. but it has full grub.cfg embedded in the .efi boot file and some caution on how to reinstall grub or grub2 defaults to a different configuration than Fedora's default.I prefer that Ubuntu's grub.cfg is separate.

Thanks for all of that information. I'm brain dead today, I'll definitely make notes and re-read that tomorrow.

You should see the way you have to do grub-install on Arch, it isn't to a simple drive like /dev/sda.

It is like this:

grub-install --target=x86_64-efi --efi-directory=/boot/grub/x86_64-efi/ --bootloader-id=ArchLinux

oldfred
April 24th, 2018, 12:57 AM
That is the full grub command, I think other installs build the command by adding the parameters they want.
I have used that type of command to just install grub to a smaller flash drive with just ISO so I could boot the ISO with grub. But now normally do a full install as larger flash drives are now relatively inexpensive.

Cavsfan
April 24th, 2018, 10:09 PM
I guess I've got a lot to learn about this EFI stuff. I've noticed over the last few years that you have developed a lot of knowledge about EFI.

I'll probably be checking out the link in your signature A LOT! :)

Cavsfan
April 24th, 2018, 11:34 PM
I quickly learned to backup ESP - efi system partition.
Each install of Ubuntu overwrites the previous install in ESP. But it is only 3 lines as configfile to find full grub.cfg in your install. So now I often just manually edit to correct UUID & partition.
But editing ESP requires changes or use of live flash drive, I know try to remember to change setting while still in live installer, but some newer versions do not let install user 999 edit anything else.

In fstab is a setting on mounting ESP. With 14.04 it was defaults, but now they change it to 'umask=0077' or no permissions. I may change settings back to that, as I assume it is for security. With defaults any user in your system could change settings since with FAT32 only ownership & permissions are set at mounting. But I keep finding many times I want to change, backup or edit something in ESP. Note that Boot-Repair also changes to defaults so it can edit settings.

After my last install of bionic and with fstab permissions set so I can access it.
sudo cp -a /boot/efi/EFI/ubuntu/ /boot/efi/EFI/bionic
sudo cp -a /boot/efi/EFI/ubuntu_bu/grub.cfg /boot/efi/EFI/ubuntu/grub.cfg


fred@Asusz97:~$ cat /boot/efi/EFI/ubuntu/grub.cfg
search.fs_uuid 255a2800-b871-4fdf-a809-16987e64b8b3 root hd0,gpt6
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg


I installed Fedora, more just to see difference with grub2 than for any other reason. When I installed Fedora to sdb I told it to install grub to ESP on sdb which I do with Ubuntu, but Ubuntu never does. I was presently surprised that Fedora's grub2 did install to ESP on sdb. but it has full grub.cfg embedded in the .efi boot file and some caution on how to reinstall grub or grub2 defaults to a different configuration than Fedora's default.I prefer that Ubuntu's grub.cfg is separate.

Glad I read this thoroughly before I installed Bionic on this computer! You're saying to backup the contents of /boot/efi/EFI/ubuntu/ which would include the /boot/efi/EFI/ubuntu/grub.cfg file.
So, what is the 2nd copy statement for? Copying the one you want to boot with back into that folder?

What is the problem with the /boot/efi/EFI/ubuntu/ folder being written over with each subsequent install of Ubuntu?
Sounds like the grub in control moves to the next installation like normal but, this is different somehow?

Possibly the making copies of that ubuntu folder and simply copying the one you want to boot from into it negates the need to do a grub-install on the system you want to boot from?

Well, that's 5 questions and if we were playing 20 questions I'd have 15 more. :P

Thanks for sharing!

Dennis N
April 25th, 2018, 02:55 AM
What is the problem with the /boot/efi/EFI/ubuntu/ folder being written over with each subsequent install of Ubuntu?
Sounds like the grub in control moves to the next installation like normal but, this is different somehow?

No it's not different. And it's only a problem if you want to continue using the previous Ubuntu to boot by default. I'm not concerned by this since I use a non-Ubuntu OS (Manjaro) to boot by default and its ESP files don't get overwritten by anything.

Possibly the making copies of that ubuntu folder and simply copying the one you want to boot from into it negates the need to do a grub-install on the system you want to boot from?
Saving it and copying it back just saves you from editing the grub.cfg file in the ESP. You can choose not to save and restore the old ubuntu folder (or its grub.cfg). Just use the terminal and edit the newly-installed grub.cfg in the ESP to be like the old one.

oldfred
April 25th, 2018, 04:30 AM
I have several copies of my ESP.
I copy most of it to the ESP on sdb.
I also copy my main working install to another folder in my ESP, so I have both the versions of grub & grub.cfg or anything else in it.
I usually end up using the newest vesion's shimx64.efi or grubx64.efi, but older versions grub.cfg. So far no issues with version of grub in ESP and rest of grub configuration files in an install.
So I just edit grub.cfg or copy back the grub.cfg from my other folder.


fred@Asusz97:~$ ll /boot/efi/EFI
total 44
drwxr-xr-x 11 root root 4096 Sep 6 2017 ./
drwxr-xr-x 4 root root 4096 Dec 31 1969 ../
drwxr-xr-x 2 root root 4096 Apr 15 2016 asus_ar/
drwxr-xr-x 2 root root 4096 May 9 2017 Boot/
drwxr-xr-x 2 root root 4096 Aug 28 2017 debian/
drwxr-xr-x 3 root root 4096 Sep 26 2016 mate/
drwxr-xr-x 2 root root 4096 Apr 23 2015 trusty/
drwxr-xr-x 3 root root 4096 Feb 19 12:53 ubuntu/
drwxr-xr-x 2 root root 4096 Sep 6 2017 ubuntu_mate/
drwxr-xr-x 2 root root 4096 Jul 31 2017 xenial/
drwxr-xr-x 2 root root 4096 Aug 16 2016 yakkety/

My other system has bionic folder, so not shown here.

Cavsfan
April 25th, 2018, 07:57 PM
Ok, I see this a little more clearly now.
I also have Arch Linux, which I installed after Windows 10.

So on Arch this is what I have (I backed up the ubuntu folder to xenial while in Xenial, like you recommended.

[cavsfan@ArchLinux ~]$ ls /boot/EFI/
Arch_grub Boot Microsoft ubuntu xenial

So this would be the way to install grub to a ubuntu partition. If needed after the initial install.

grub-install --target=x86_64-efi --efi-directory=/boot/grub/x86_64-efi/ --bootloader-id=ubuntu

Cavsfan
April 25th, 2018, 08:14 PM
I've got so much to do. New hardware requires special treatment it would appear.
I have a Soundblaster Audigy 5/Rx sound card, which Arch picked up on but, It isn't the default and getting that solved is one trick I need to do.

I need to get that sound card working on Xubuntu Xenial Xerus 16.04 plus a lot of other stuff on that system like resizing the conkys to fit this ginormous monitor.
Think the sound card works some places and not others on that system too.

Also need to play around with the grub so I can get that figured out for this wiki.

Then tomorrow Bionic Beaver 18.04 LTS is released, so installing that and then the same thing as above on that system.

There is not enough time in the day...

Cavsfan
April 26th, 2018, 01:18 AM
One good thing about EFI boot is that I totally messed my grub up in Arch and could not boot into anything.

So, on the old computer I was downloading an ISO so I could do a live boot repair, then suddenly realized maybe that was not necessary.

I rebooted and got into BIOS and changed the boot to the Ubuntu grub and it worked.
It had no way to get into Arch because it got an error on 30_os-prober so I was able to copy my custom grub file from Arch into Xubuntu 16.04.
(The custom grub file is really identical to the regular grub entries just in my order - for now.)

I ran update-grub and it didn't get any errors this time.

Rebooted via BIOS into the Ubuntu grub and selected Arch and I was back in.

It was already set to default boot with Arch grub so I recovered the easy way.

oldfred
April 26th, 2018, 04:26 AM
It is one advantage of UEFI, that you in effect have the equivalent of many MBRs all on one drive.
Each folder in ESP can be a different boot entry. And that is where I wish I could rename different Ubuntu flavors or even different test Ubuntu installs to boot from UEFI, not just grub.
Those booting other distributions than can from UEFI boot menu boot any of them directly.

UEFI is a boot manager/menu, grub is a boot menu & boot loader. So you have two menus to choose from.

Cavsfan
April 29th, 2018, 06:46 AM
I installed Bionic Beaver 16.04 LTS and the grub got everything but part of the Arch Linux kernel correct.
The last 2 lines in Xubuntu:

linux /vmlinuz-linux root=/dev/sdc5 rw quiet
initrd /intel-ucode.img


It put the Microcode img but it left off the initramfs Arch img:

linux /vmlinuz-linux root='/dev/sdc5' rw quiet
initrd /intel-ucode.img /initramfs-linux.img

Good thing I had the lts kernel installed as it does not use the Microcode img and it got that one right.

Roger_Williams
May 7th, 2018, 10:53 PM
On my laptop Iím multi-booting Ubuntu, Kubuntu and Kali. Ubuntu is my main OS and runs on my internal while Kubuntu and Kali are on seperate external SSDs. My problem is that Kubuntu and Ubuntu are labelled as ďUbuntuĒ in the Grub menu. I want to edit it to distinguish between the two. I read the Wiki a bit and I think below is what I want to do to get them labelled properly. Am I correct?


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.

oldfred
May 7th, 2018, 11:36 PM
I do have issues with my entires. I had USB SSD installed & flash drive and all my hd0, became hd2. I had to experiment to see which was correct.

This is my 40_custom:


fred@Xenial_z97:~$ cat /etc/grub.d/40_custom
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.

menuentry "Xenial on sdb3" {
set root=(hd1,gpt3)
linux /vmlinuz root=/dev/sdb3 ro quiet splash
initrd /initrd.img
}

menuentry "Bionic 18.04 on sda7 configfile" {
configfile (hd0,gpt7)/boot/grub/grub.cfg
}

menuentry "Bionic 18.04 on sda7" {
set root=(hd0,gpt7)
linux /vmlinuz root=/dev/sda7 ro quiet splash
initrd /initrd.img
}


menuentry "Bionic 18.04 on SSD" {
set root=(hd3,gpt3)
linux /vmlinuz root=/dev/sdc3 ro quiet splash
initrd /initrd.img
}

menuentry "Artful 17.10 on sdb9" {
set root=(hd1,gpt9)
linux /vmlinuz root=/dev/sdb9 ro quiet splash
initrd /initrd.img
}

menuentry "Ubuntu 9 on sdb8" {
set root=(hd1,gpt10)8
linux /vmlinuz root=/dev/sdb8 ro quiet splash
initrd /initrd.img
}


menuentry "Mate 16.10 on sdb10" {
set root=(hd1,gpt10)
linux /vmlinuz root=/dev/sdb10 ro quiet splash
initrd /initrd.img
}


menuentry "USB SSD on sdc3" {
set root=(hd2,gpt3)
linux /vmlinuz root=/dev/sdc3 ro quiet splash
initrd /initrd.img
}

# spacer line
menuentry " " {
set root=
}

menuentry 'Live ISOs on SSD' {
configfile (hd0,5)/livecdimage.cfg
}

menuentry 'Live ISOs on HDD (boot on SSD)' {
configfile (hd1,6)/livecdimage.cfg
}

# spacer line
menuentry " " {
set root=
}

menuentry "System restart" {
echo "System rebooting..."
insmod reboot
reboot
}

menuentry "System shutdown" {
echo "System shutting down..."
insmod halt
halt
}

# Boot whatever is in the CD drive
menuentry "CD on (cdrom/dvd)" {
set root=(cd0)
chainloader /EFI/BOOT/grubx64.efi

Roger_Williams
May 8th, 2018, 02:25 AM
Thank you this will help so much 😄


I do have issues with my entires. I had USB SSD installed & flash drive and all my hd0, became hd2. I had to experiment to see which was correct.

This is my 40_custom:


fred@Xenial_z97:~$ cat /etc/grub.d/40_custom
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.

menuentry "Xenial on sdb3" {
set root=(hd1,gpt3)
linux /vmlinuz root=/dev/sdb3 ro quiet splash
initrd /initrd.img
}

menuentry "Bionic 18.04 on sda7 configfile" {
configfile (hd0,gpt7)/boot/grub/grub.cfg
}

menuentry "Bionic 18.04 on sda7" {
set root=(hd0,gpt7)
linux /vmlinuz root=/dev/sda7 ro quiet splash
initrd /initrd.img
}


menuentry "Bionic 18.04 on SSD" {
set root=(hd3,gpt3)
linux /vmlinuz root=/dev/sdc3 ro quiet splash
initrd /initrd.img
}

menuentry "Artful 17.10 on sdb9" {
set root=(hd1,gpt9)
linux /vmlinuz root=/dev/sdb9 ro quiet splash
initrd /initrd.img
}

menuentry "Ubuntu 9 on sdb8" {
set root=(hd1,gpt10)8
linux /vmlinuz root=/dev/sdb8 ro quiet splash
initrd /initrd.img
}


menuentry "Mate 16.10 on sdb10" {
set root=(hd1,gpt10)
linux /vmlinuz root=/dev/sdb10 ro quiet splash
initrd /initrd.img
}


menuentry "USB SSD on sdc3" {
set root=(hd2,gpt3)
linux /vmlinuz root=/dev/sdc3 ro quiet splash
initrd /initrd.img
}

# spacer line
menuentry " " {
set root=
}

menuentry 'Live ISOs on SSD' {
configfile (hd0,5)/livecdimage.cfg
}

menuentry 'Live ISOs on HDD (boot on SSD)' {
configfile (hd1,6)/livecdimage.cfg
}

# spacer line
menuentry " " {
set root=
}

menuentry "System restart" {
echo "System rebooting..."
insmod reboot
reboot
}

menuentry "System shutdown" {
echo "System shutting down..."
insmod halt
halt
}

# Boot whatever is in the CD drive
menuentry "CD on (cdrom/dvd)" {
set root=(cd0)
chainloader /EFI/BOOT/grubx64.efi

Roger_Williams
May 8th, 2018, 03:53 AM
Running the commands what I could find is the following shown below. Ubuntu was install in UEFI mode and I'm pretty sure Kubuntu was as well. So I'm guessing that sda2 is Kubuntu. How do I figure out the drive number though? Like here how you have "set root=(hd1,gpt3)".Yes I am a noob. Ubuntu and Kubuntu use the entire disk they are installed on while Kali has a swap. I'm pretty sure I have everything setup but I've commented out the changes I made to the 06_custom until I know that it's all correct.

Ubuntu: /dev/sdb2
Kali: /dev/sdd1

/dev/sda1: UUID="1B0A-70B6" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="e7732e71-000a-43a6-b259-327d87412d3a"


/dev/sda2: UUID="e9c24939-98c7-4af4-9431-e9f7c3772a40" TYPE="ext4" PARTUUID="7b19e85f-63c4-4927-b7c7-c419fd17db6b"


/dev/sdb1: UUID="EA33-3A4D" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="3d2c10dd-1e64-4c6a-b8e1-f0adbb541229"


Ubuntu /dev/sdb2: UUID="b66785e3-d995-470a-98c7-7fa86297e40f" TYPE="ext4" PARTUUID="8f2a7053-4205-4d22-a38d-e9c0d93a64d7"


/dev/sdc1: PARTUUID="3653f0a2-01"


Kali /dev/sdd1: UUID="9e01f911-304a-43b2-b188-afa894dee1ba" TYPE="ext4" PARTUUID="a0a68dd4-01"


/dev/sdd5: UUID="75bc88c8-16a8-4d5b-bda1-532b7cdd6640" TYPE="swap" PARTUUID="a0a68dd4-05"

oldfred
May 8th, 2018, 04:29 AM
Drives should match how once booted they become devices. Or hd0 should be sda.
But UEFI or BIOS may see drives differently. Maybe due to timing?
I thought drives were enumerated by UEFI/BIOS by SATA port order. But I try to use SATA0 as first port. But then when I plug a flash drive as sdc, on reboot it is hd0. But may be sdc or sda?

Depending on what extra flash drive(s) I have plugged in, I often have to manually edit the custom boot entries that use hd0. They my be hd1 or hd2 even. Same with sdb that should be hd1, may then be hd2. And then if I unplug flash drive and reboot, it is back to hd0.

Or sometimes you just have to experiment, when grub gives error message. It usually goes back to grub menu, so you can try again.

If not a removable drive, I probably should be using UUID as the set root command.
This is what UEFI uses in its grub to find full grub using configfile.


fred@Xenial_z97:~$ cat /boot/efi/EFI/ubuntu/grub.cfg
#search.fs_uuid 8c92557f-cc60-438b-b1ea-ffea0adf0a1a root hd0,gpt7
search.fs_uuid 255a2800-b871-4fdf-a809-16987e64b8b3 root hd0,gpt6
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

deadflowr
May 8th, 2018, 04:30 AM
My problem is that Kubuntu and Ubuntu are labelled as “Ubuntu” in the Grub menu. I want to edit it to distinguish between the two. I read the Wiki a bit and I think below is what I want to do to get them labelled properly. Am I correct?
The partition label and the grub name are different.
(But it's really helpful to rename the partition labels though anyway)
As that makes is much easier to know which partition is which.
Refer to the wiki on how to actually set the customized grub names for each install.
https://help.ubuntu.com/community/MaintenanceFreeCustomGrub2Screen#Making_the_custom _Grub2_Menu_entries

Edit: nevermind last page didn't load so I was reading this post as if the last post
https://ubuntuforums.org/showthread.php?t=2076205&page=16&p=13764313#post13764313

I also took awhile.

oldfred
May 8th, 2018, 04:58 AM
from my notes, I have renamed like this (really old note).

sudo nano -B /etc/default/grub
#GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_DISTRIBUTOR="Xubuntu-12.04-amd64 Precise"
sudo update-grub

But with newer versions & UEFI, it will add a new UEFI folder with that name, if short enough and valid characters for UEFI entry (not like one above). And I got a separate UEFI entry. But the new folder it created had grubx64.efi which internally was hard coded to find the configfile grub in /EFI/ubuntu. Or it did not really work.

Cavsfan
May 8th, 2018, 09:35 PM
Thank you these will help me too as I have not gotten UEFI grub down at all.

I use tune2fs to label my partitions even UEFI partitions. It is already installed.


sudo tune2fs -L "ArchLinux" /dev/sdc5
sudo tune2fs -L "Xenial" /dev/sdc6
sudo tune2fs -L "Bionic" /dev/sdc7

This worked for me. You do not need quotes around a single word, I just left them there.
But, you definitely do with something like "Bionic Beaver" but, I'd still suggest adding a dash in there to be able to copy across partitions.

A space in the label will prevent that.

Roger_Williams
May 9th, 2018, 04:09 PM
OK so I ran lshw -class disk and this is what I got. I've marked the disks with which Distro it's running. I'm looking at the bus info and thinking for example scsi@4:0.0.0 would be set root=(hd4,x) does that sound about right? My 40_custom is pasted below let me know if I've got the right idea? Also my next problem is knowing what to put as the x number in (hd0,x) for example.


Kali
====
description: SCSI Disk
product: SATAWire
vendor: Apricorn
physical id: 0.0.0
bus info: scsi@4:0.0.0
logical name: /dev/sdd
version: 1.08
serial: 1352095FFF5B
size: 111GiB (120GB)
capabilities: partitioned partitioned:dos
configuration: ansiversion=4 logicalsectorsize=512 sectorsize=512 signature=a0a68dd4

Kubuntu
=======
*-disk
description: SCSI Disk
vendor: Apricorn
physical id: 0.0.0
bus info: scsi@2:0.0.0
logical name: /dev/sdb
version: 0128
serial: P577492-DDBX-902
size: 119GiB (128GB)
capabilities: gpt-1.00 partitioned partitioned:gpt
configuration: ansiversion=6 guid=cf2bfe61-5fcc-4e35-a516-32ae68398ede logicalsectorsize=512 sectorsize=512

Ubuntu
======
*-disk
description: ATA Disk
product: TOSHIBA MQ01ABD1
vendor: Toshiba
physical id: 0.0.0
bus info: scsi@0:0.0.0
logical name: /dev/sda
version: 3D
serial: 86GNT7OPT
size: 931GiB (1TB)
capabilities: gpt-1.00 partitioned partitioned:gpt
configuration: ansiversion=5 guid=929e1ceb-b32d-429c-9cff-137b042579b5 logicalsectorsize=512 sectorsize=4096

*-cdrom
description: DVD-RAM writer
product: DVD+-RW DU-8A5LH
vendor: PLDS
physical id: 0.0.0
bus info: scsi@1:0.0.0
logical name: /dev/cdrom
logical name: /dev/cdrw
logical name: /dev/dvd
logical name: /dev/dvdrw
logical name: /dev/sr0
version: 6D11
capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram
configuration: ansiversion=5 status=nodisc



#menuentry "Bionic Beaver" {
# set root=(hd0,x)
# linux /vmlinuz root=/dev/sda2 ro quiet splash
# initrd /initrd.img
#}

#menuentry "Bionic K" {
# set root=(hd2,gptx)
# linux /vmlinuz root=/dev/sdb2 ro quiet splash
# initrd /initrd.img
#}

#menuentry "Kali" {
# set root=(hd4,x)
# linux /vmlinuz root=/dev/sdd1 ro quiet splash
# initrd /initrd.img
#}

menuentry "System restart" {
echo "System rebooting..."
insmod reboot
reboot
}

menuentry "System shutdown" {
echo "System shutting down..."
insmod halt
halt
}

oldfred
May 9th, 2018, 05:37 PM
Your x is the partition number.

But because of my issues on drive changing depending on whether flash drive and/or external SSD are plugged in or not, the hdX, my hd0 may be hd1 or hd2 depending on where UEFI has assigned drive.

It seems I have two different installs in third partitions on different drives, so once when drive order was not correct, I booted my old 14.04 install. Still booted. :)

Roger_Williams
May 9th, 2018, 07:12 PM
Your x is the partition number.

But because of my issues on drive changing depending on whether flash drive and/or external SSD are plugged in or not, the hdX, my hd0 may be hd1 or hd2 depending on where UEFI has assigned drive.

It seems I have two different installs in third partitions on different drives, so once when drive order was not correct, I booted my old 14.04 install. Still booted. :)

OK I think I'm ok with the drives just wanted a second opinion. I'm not so sure about the partitions. I know with Ubuntu there's sda1 and sda2 and Ubuntu is on sda2 so does that mean I put (hd0,2) or how do I know if it's gpt? would I put gpt2 then? lol I'm such a noob when it comes to Linux. Ubuntu and Kubuntu are installed in EUFI but Kali is Bios mode. Ubuntu and Kubuntu use the whole drive while Kali has a swap partition. I guess I'll just try it and I could always boot to live and undo if I needed to anyway lol.

oldfred
May 9th, 2018, 07:41 PM
If all systems are not in same boot mode, you cannot boot from grub, only from UEFI.
Some systems may require you to also turn on/off UEFI or legacy/BIOS/CSM boot modes to match how installed system is to boot.

UEFI & BIOS write hardware data differently to hard drive for operating system to use. So they are not compatible. Or once you start booting in one mode you cannot switch. But you can boot directly from UEFI.

This will show if gpt or not, may show dos, or msdos.
sudo parted -l

Roger_Williams
May 9th, 2018, 08:36 PM
If all systems are not in same boot mode, you cannot boot from grub, only from UEFI.
Some systems may require you to also turn on/off UEFI or legacy/BIOS/CSM boot modes to match how installed system is to boot.

UEFI & BIOS write hardware data differently to hard drive for operating system to use. So they are not compatible. Or once you start booting in one mode you cannot switch. But you can boot directly from UEFI.

This will show if gpt or not, may show dos, or msdos.
sudo parted -l

I installed Kali before I installed Ubuntu and Kubuntu. As it is I know Ubuntu and Kubuntu boot from UEFI for sure. I'm a noob but my machine powers on it asks for the bios password then it boots to the Ubuntu grub where I can select Ubuntu, Kubuntu or Kali and they all boot. In the past my UEFI was turned off so I had to hit F12 to get the UEFI boot menu and choose ubuntu. I turned UEFI on but secure boot off and it has been booting the way I described above since then.
I opened /boot/grub/grub.cfg in gedit and I searched through and found that Kubuntu was hd2,gpt2, Kali was hd3,msdos3 but I didn't look for Ubuntu. I rebooted and Ubuntu doesn't work but Kubuntu booted up no problems. I have to get a few days use out of Kubuntu so I'm leaving it at that for now. After that I will get back into it and figure out Ubuntu. Then my last step is to figure out how to get rid of the system menu entries that are being pulled from grub.cfg

Roger_Williams
May 10th, 2018, 03:06 PM
OK I was going about this too complicated. I took it back to simple methods. I removed the custom menu and edited the /boot/grub/grub.cfg. I did a find and looked for Ubuntu. I only changed the 18.04 on sdb2. I know you're not supposed to edit it but I'm litterally adding one letter. I made the changes and on reboot BAM it shows Ubuntu and Kubuntu YAY! lol

Cavsfan
May 10th, 2018, 10:41 PM
Your x is the partition number.

But because of my issues on drive changing depending on whether flash drive and/or external SSD are plugged in or not, the hdX, my hd0 may be hd1 or hd2 depending on where UEFI has assigned drive.

It seems I have two different installs in third partitions on different drives, so once when drive order was not correct, I booted my old 14.04 install. Still booted. :)


OK I think I'm ok with the drives just wanted a second opinion. I'm not so sure about the partitions. I know with Ubuntu there's sda1 and sda2 and Ubuntu is on sda2 so does that mean I put (hd0,2) or how do I know if it's gpt? would I put gpt2 then? lol I'm such a noob when it comes to Linux. Ubuntu and Kubuntu are installed in EUFI but Kali is Bios mode. Ubuntu and Kubuntu use the whole drive while Kali has a swap partition. I guess I'll just try it and I could always boot to live and undo if I needed to anyway lol.

You could try lsblk or lsblk -fs - that will definitely give you the partitions.

Also sudo blkid too.

Me, I'm stuck between a rock and a hard place. I have Grub installed on Arch Linux and of course Arch handles everything differently than Ubuntu or any Debian distro.
And I can switch where I'm booting from with BIOS temporarily but, it's not that easy to do a grub-install with EFI because it's not just a simple sudo grub install /dev/sda etc.

I'm on Xenial 16.04 right now.

I did get a working custom boot menuentry for Windows 10 though:

menuentry "Microsoft Windows 10 UEFI/GPT" {
insmod part_gpt
insmod fat
set root='hd2,gpt1'
insmod search_fs_uuid
insmod chain
search --no-floppy --fs-uuid --set=root 688D-126B
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}


Of course everything points to the EFI system partition sdc1, while Windows 10 is actually on sdc3

cavsfan@cavsfan-Xenial-Xerus:~$ sudo blkid | grep sdc
/dev/sdc1: UUID="688D-126B" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="3c1b6d6f-8a24-43da-b595-8c304ceee48d"
/dev/sdc3: UUID="C4968A52968A44C0" TYPE="ntfs" PARTLABEL="Windows_10" PARTUUID="345c85f4-bce7-4bc7-bbe0-db03eb319cad"
/dev/sdc4: UUID="701AE4631AE427B4" TYPE="ntfs" PARTUUID="1e337754-b45d-45a5-a971-b8cdcae8a002"
/dev/sdc5: UUID="ad60d57b-f7b9-4a83-8ce0-74382d2e3281" TYPE="swap" PARTLABEL="Basic data partition" PARTUUID="3a259867-656d-41ed-9931-cf15a3bd0148"
/dev/sdc6: LABEL="ArchLinux" UUID="bbca28b2-503e-4dc8-9850-c54bd0492da8" TYPE="ext4" PARTLABEL="Arch_Linux" PARTUUID="5312b771-0835-4957-80a6-9a8a7107f24a"
/dev/sdc7: LABEL="Xenial" UUID="c0a5062e-6847-44a0-9f4e-cfbb7292b037" TYPE="ext4" PARTLABEL="Xenial_Xerus" PARTUUID="57075798-adb7-4590-ae23-6a75d976c3c1"
/dev/sdc8: LABEL="Bionic" UUID="21cf477b-a314-4691-85f6-256e6209d5d9" TYPE="ext4" PARTLABEL="Bionic_Beaver" PARTUUID="c4e0fdc9-7eac-4661-a7c6-c5a00c9a46fc"
/dev/sdc9: UUID="f716b510-b16b-4fd0-b89f-ea86e90c2533" TYPE="ext4" PARTLABEL="Basic data partition" PARTUUID="ac30cd57-1b77-4924-ba8c-7bc94c8f961b"
/dev/sdc2: PARTLABEL="Microsoft reserved partition" PARTUUID="49992d5b-79cd-4934-a12f-11782bb345bd"


I am getting closer though.

PS: I just now seen there were more posts on the next page. This UEFI stuff is trying to say the least.

Cavsfan
May 13th, 2018, 08:00 PM
@oldfred
So, I installed my Grub on Bionic Beaver 18.04 with this difficult command:

sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi/EFI/ubuntu --bootloader-id=ubuntu

I don't think that is the same on everyone's system, although I could be wrong.

But, I have not been able to customize the Xubuntu entry for 18.04:

This is the only thing that will work:

menuentry 'Ubuntu 18.04 LTS, with Linux 4.15.0-20-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-20-generic-advanced-21cf477b-a314-4691-85f6-256e6209d5d9' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd2,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt7 --hint-efi=hd2,gpt7 --hint-baremetal=ahci2,gpt7 21cf477b-a314-4691-85f6-256e6209d5d9
else
search --no-floppy --fs-uuid --set=root 21cf477b-a314-4691-85f6-256e6209d5d9
fi
echo 'Loading Linux 4.15.0-20-generic ...'
linux /boot/vmlinuz-4.15.0-20-generic root=UUID=21cf477b-a314-4691-85f6-256e6209d5d9 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-20-generic
}


I do know that it meets the IF criteria so I could take all of the stuff around the 2nd line of the if statement out but, that's still a mess.

If I try something like this:

menuentry "Ubuntu 18.04 LTS custom entry" {
set root=(hd2,gpt8)
linux /vmlinuz.old root=/dev/sdc8 ro quiet splash
initrd /initrd.img
}

The system will tell me it cannot find (hd2,gpt8) and says to load the kernel first.
I've tried parens and quotes and neither work.

oldfred
May 13th, 2018, 08:24 PM
Why are you using gpt8, your boot stanza shows gpt7?

I think you are just using the full command for grub-install. With Ubuntu it is a script that assigns all the variables.

Cavsfan
May 14th, 2018, 12:58 AM
Why are you using gpt8, your boot stanza shows gpt7?

I think you are just using the full command for grub-install. With Ubuntu it is a script that assigns all the variables.

What is the normal grub-install line for Ubuntu? Just sudo grub-install /dev/gpt8 (for Bionic)?

gpt7 is Xenial gpt8 is Bionic but, it gives this error if I try to boot that custom entry with either 7 or 8:

error: disk 'hd2.gpt8' not found
error: you need to load the kernel first

This perplexes me also: the Arch boot line points to gpt1 "EFI system partition" just as Windows 10 does.
Only the UUID on the linux /vmlinuz like points to the Arch partition, everything else is just like the Windows boot entry.
Here is the disk:

cavsfan@cavsfan-Bionic-Beaver:~$ sudo blkid | grep sdc
[sudo] password for cavsfan:
/dev/sdc1: UUID="688D-126B" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="3c1b6d6f-8a24-43da-b595-8c304ceee48d"
/dev/sdc2: PARTLABEL="Microsoft reserved partition" PARTUUID="49992d5b-79cd-4934-a12f-11782bb345bd"
/dev/sdc3: UUID="C4968A52968A44C0" TYPE="ntfs" PARTLABEL="Windows_10" PARTUUID="345c85f4-bce7-4bc7-bbe0-db03eb319cad"
/dev/sdc4: UUID="701AE4631AE427B4" TYPE="ntfs" PARTUUID="1e337754-b45d-45a5-a971-b8cdcae8a002"
/dev/sdc5: UUID="ad60d57b-f7b9-4a83-8ce0-74382d2e3281" TYPE="swap" PARTLABEL="Basic data partition" PARTUUID="3a259867-656d-41ed-9931-cf15a3bd0148"
/dev/sdc6: LABEL="ArchLinux" UUID="bbca28b2-503e-4dc8-9850-c54bd0492da8" TYPE="ext4" PARTLABEL="Arch_Linux" PARTUUID="5312b771-0835-4957-80a6-9a8a7107f24a"
/dev/sdc7: LABEL="Xenial" UUID="c0a5062e-6847-44a0-9f4e-cfbb7292b037" TYPE="ext4" PARTLABEL="Xenial_Xerus" PARTUUID="57075798-adb7-4590-ae23-6a75d976c3c1"
/dev/sdc8: LABEL="Bionic" UUID="21cf477b-a314-4691-85f6-256e6209d5d9" TYPE="ext4" PARTLABEL="Bionic_Beaver" PARTUUID="c4e0fdc9-7eac-4661-a7c6-c5a00c9a46fc"
/dev/sdc9: UUID="f716b510-b16b-4fd0-b89f-ea86e90c2533" TYPE="ext4" PARTLABEL="Basic data partition" PARTUUID="ac30cd57-1b77-4924-ba8c-7bc94c8f961b"

But, here are the first 2 menuentries in 30_os-prober:

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/sdc1)' --class windows --class os $menuentry_id_option 'osprober-efi-688D-126B' {
insmod part_gpt
insmod fat
set root='hd2,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt1 --hint-efi=hd2,gpt1 --hint-baremetal=ahci2,gpt1 688D-126B
else
search --no-floppy --fs-uuid --set=root 688D-126B
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry 'Arch Linux (rolling) (on /dev/sdc6)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-bbca28b2-503e-4dc8-9850-c54bd0492da8' {
insmod part_gpt
insmod fat
set root='hd2,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt1 --hint-efi=hd2,gpt1 --hint-baremetal=ahci2,gpt1 688D-126B
else
search --no-floppy --fs-uuid --set=root 688D-126B
fi
linux /vmlinuz-linux root=UUID=bbca28b2-503e-4dc8-9850-c54bd0492da8 rw quiet
initrd /intel-ucode.img
}

Here is the entire /boot/grub/grub.cfg without the custom entries (grub installed on Bionic):

#
# 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
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi


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
}


if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_gpt
insmod ext2
set root='hd2,gpt8'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt8 --hint-efi=hd2,gpt8 --hint-baremetal=ahci2,gpt8 21cf477b-a314-4691-85f6-256e6209d5d9
else
search --no-floppy --fs-uuid --set=root 21cf477b-a314-4691-85f6-256e6209d5d9
fi
font="/usr/share/grub/unicode.pf2"
fi


if loadfont $font ; then
set gfxmode=auto
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=30
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=60
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=60
fi
fi
### END /etc/grub.d/00_header ###


### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_gpt
insmod ext2
set root='hd2,gpt8'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt8 --hint-efi=hd2,gpt8 --hint-baremetal=ahci2,gpt8 21cf477b-a314-4691-85f6-256e6209d5d9
else
search --no-floppy --fs-uuid --set=root 21cf477b-a314-4691-85f6-256e6209d5d9
fi
insmod png
if background_image /boot/grub/band-2560x1440.png; then
set color_normal=yellow/black
set menu_color_normal=cyan/black
set menu_color_highlight=red/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/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=1
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-21cf477b-a314-4691-85f6-256e6209d5d9' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd2,gpt8'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt8 --hint-efi=hd2,gpt8 --hint-baremetal=ahci2,gpt8 21cf477b-a314-4691-85f6-256e6209d5d9
else
search --no-floppy --fs-uuid --set=root 21cf477b-a314-4691-85f6-256e6209d5d9
fi
linux /boot/vmlinuz-4.15.0-20-generic root=UUID=21cf477b-a314-4691-85f6-256e6209d5d9 ro quiet splash $vt_handoff
initrd /boot/initrd.img-4.15.0-20-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-21cf477b-a314-4691-85f6-256e6209d5d9' {
menuentry 'Ubuntu, with Linux 4.15.0-20-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-20-generic-advanced-21cf477b-a314-4691-85f6-256e6209d5d9' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd2,gpt8'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt8 --hint-efi=hd2,gpt8 --hint-baremetal=ahci2,gpt8 21cf477b-a314-4691-85f6-256e6209d5d9
else
search --no-floppy --fs-uuid --set=root 21cf477b-a314-4691-85f6-256e6209d5d9
fi
echo 'Loading Linux 4.15.0-20-generic ...'
linux /boot/vmlinuz-4.15.0-20-generic root=UUID=21cf477b-a314-4691-85f6-256e6209d5d9 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-20-generic
}
menuentry 'Ubuntu, with Linux 4.15.0-20-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-20-generic-recovery-21cf477b-a314-4691-85f6-256e6209d5d9' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd2,gpt8'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt8 --hint-efi=hd2,gpt8 --hint-baremetal=ahci2,gpt8 21cf477b-a314-4691-85f6-256e6209d5d9
else
search --no-floppy --fs-uuid --set=root 21cf477b-a314-4691-85f6-256e6209d5d9
fi
echo 'Loading Linux 4.15.0-20-generic ...'
linux /boot/vmlinuz-4.15.0-20-generic root=UUID=21cf477b-a314-4691-85f6-256e6209d5d9 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.15.0-20-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/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###


### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/sdc1)' --class windows --class os $menuentry_id_option 'osprober-efi-688D-126B' {
insmod part_gpt
insmod fat
set root='hd2,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt1 --hint-efi=hd2,gpt1 --hint-baremetal=ahci2,gpt1 688D-126B
else
search --no-floppy --fs-uuid --set=root 688D-126B
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
menuentry 'Arch Linux (rolling) (on /dev/sdc6)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-bbca28b2-503e-4dc8-9850-c54bd0492da8' {
insmod part_gpt
insmod fat
set root='hd2,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt1 --hint-efi=hd2,gpt1 --hint-baremetal=ahci2,gpt1 688D-126B
else
search --no-floppy --fs-uuid --set=root 688D-126B
fi
linux /vmlinuz-linux root=UUID=bbca28b2-503e-4dc8-9850-c54bd0492da8 rw quiet
initrd /intel-ucode.img
}
submenu 'Advanced options for Arch Linux (rolling) (on /dev/sdc6)' $menuentry_id_option 'osprober-gnulinux-advanced-bbca28b2-503e-4dc8-9850-c54bd0492da8' {
menuentry 'Arch Linux (on /dev/sdc6)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-linux--bbca28b2-503e-4dc8-9850-c54bd0492da8' {
insmod part_gpt
insmod fat
set root='hd2,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt1 --hint-efi=hd2,gpt1 --hint-baremetal=ahci2,gpt1 688D-126B
else
search --no-floppy --fs-uuid --set=root 688D-126B
fi
linux /vmlinuz-linux root=UUID=bbca28b2-503e-4dc8-9850-c54bd0492da8 rw quiet
initrd /intel-ucode.img /initramfs-linux.img
}
menuentry 'Arch Linux (Fallback) (on /dev/sdc6)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-linux--bbca28b2-503e-4dc8-9850-c54bd0492da8' {
insmod part_gpt
insmod fat
set root='hd2,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt1 --hint-efi=hd2,gpt1 --hint-baremetal=ahci2,gpt1 688D-126B
else
search --no-floppy --fs-uuid --set=root 688D-126B
fi
linux /vmlinuz-linux root=UUID=bbca28b2-503e-4dc8-9850-c54bd0492da8 rw quiet
initrd /initramfs-linux-fallback.img
}
menuentry 'Arch Linux (on /dev/sdc6)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-linux--bbca28b2-503e-4dc8-9850-c54bd0492da8' {
insmod part_gpt
insmod fat
set root='hd2,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt1 --hint-efi=hd2,gpt1 --hint-baremetal=ahci2,gpt1 688D-126B
else
search --no-floppy --fs-uuid --set=root 688D-126B
fi
linux /vmlinuz-linux root=UUID=bbca28b2-503e-4dc8-9850-c54bd0492da8 rw quiet
initrd /intel-ucode.img
}
menuentry 'Arch Linux, with Linux linux (on /dev/sdc6)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-linux--bbca28b2-503e-4dc8-9850-c54bd0492da8' {
insmod part_gpt
insmod fat
set root='hd2,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt1 --hint-efi=hd2,gpt1 --hint-baremetal=ahci2,gpt1 688D-126B
else
search --no-floppy --fs-uuid --set=root 688D-126B
fi
linux /vmlinuz-linux root=UUID=bbca28b2-503e-4dc8-9850-c54bd0492da8 rw quiet
initrd /intel-ucode.img
}
menuentry 'Arch Linux, with Linux linux (fallback initramfs) (on /dev/sdc6)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-linux--bbca28b2-503e-4dc8-9850-c54bd0492da8' {
insmod part_gpt
insmod fat
set root='hd2,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt1 --hint-efi=hd2,gpt1 --hint-baremetal=ahci2,gpt1 688D-126B
else
search --no-floppy --fs-uuid --set=root 688D-126B
fi
linux /vmlinuz-linux root=UUID=bbca28b2-503e-4dc8-9850-c54bd0492da8 rw quiet
initrd /initramfs-linux-fallback.img
}
}


menuentry 'Ubuntu 16.04.4 LTS (16.04) (on /dev/sdc7)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-c0a5062e-6847-44a0-9f4e-cfbb7292b037' {
insmod part_gpt
insmod ext2
set root='hd2,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt7 --hint-efi=hd2,gpt7 --hint-baremetal=ahci2,gpt7 c0a5062e-6847-44a0-9f4e-cfbb7292b037
else
search --no-floppy --fs-uuid --set=root c0a5062e-6847-44a0-9f4e-cfbb7292b037
fi
linux /boot/vmlinuz-4.13.0-41-generic.efi.signed root=UUID=c0a5062e-6847-44a0-9f4e-cfbb7292b037 ro quiet splash $vt_handoff
initrd /boot/initrd.img-4.13.0-41-generic
}
submenu 'Advanced options for Ubuntu 16.04.4 LTS (16.04) (on /dev/sdc7)' $menuentry_id_option 'osprober-gnulinux-advanced-c0a5062e-6847-44a0-9f4e-cfbb7292b037' {
menuentry 'Ubuntu (on /dev/sdc7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.13.0-41-generic.efi.signed--c0a5062e-6847-44a0-9f4e-cfbb7292b037' {
insmod part_gpt
insmod ext2
set root='hd2,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt7 --hint-efi=hd2,gpt7 --hint-baremetal=ahci2,gpt7 c0a5062e-6847-44a0-9f4e-cfbb7292b037
else
search --no-floppy --fs-uuid --set=root c0a5062e-6847-44a0-9f4e-cfbb7292b037
fi
linux /boot/vmlinuz-4.13.0-41-generic.efi.signed root=UUID=c0a5062e-6847-44a0-9f4e-cfbb7292b037 ro quiet splash $vt_handoff
initrd /boot/initrd.img-4.13.0-41-generic
}
menuentry 'Ubuntu, with Linux 4.13.0-41-generic (on /dev/sdc7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.13.0-41-generic.efi.signed--c0a5062e-6847-44a0-9f4e-cfbb7292b037' {
insmod part_gpt
insmod ext2
set root='hd2,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt7 --hint-efi=hd2,gpt7 --hint-baremetal=ahci2,gpt7 c0a5062e-6847-44a0-9f4e-cfbb7292b037
else
search --no-floppy --fs-uuid --set=root c0a5062e-6847-44a0-9f4e-cfbb7292b037
fi
linux /boot/vmlinuz-4.13.0-41-generic.efi.signed root=UUID=c0a5062e-6847-44a0-9f4e-cfbb7292b037 ro quiet splash $vt_handoff
initrd /boot/initrd.img-4.13.0-41-generic
}
menuentry 'Ubuntu, with Linux 4.13.0-41-generic (upstart) (on /dev/sdc7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.13.0-41-generic.efi.signed--c0a5062e-6847-44a0-9f4e-cfbb7292b037' {
insmod part_gpt
insmod ext2
set root='hd2,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt7 --hint-efi=hd2,gpt7 --hint-baremetal=ahci2,gpt7 c0a5062e-6847-44a0-9f4e-cfbb7292b037
else
search --no-floppy --fs-uuid --set=root c0a5062e-6847-44a0-9f4e-cfbb7292b037
fi
linux /boot/vmlinuz-4.13.0-41-generic.efi.signed root=UUID=c0a5062e-6847-44a0-9f4e-cfbb7292b037 ro quiet splash $vt_handoff init=/sbin/upstart
initrd /boot/initrd.img-4.13.0-41-generic
}
menuentry 'Ubuntu, with Linux 4.13.0-41-generic (recovery mode) (on /dev/sdc7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.13.0-41-generic.efi.signed-root=UUID=c0a5062e-6847-44a0-9f4e-cfbb7292b037 ro recovery nomodeset-c0a5062e-6847-44a0-9f4e-cfbb7292b037' {
insmod part_gpt
insmod ext2
set root='hd2,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt7 --hint-efi=hd2,gpt7 --hint-baremetal=ahci2,gpt7 c0a5062e-6847-44a0-9f4e-cfbb7292b037
else
search --no-floppy --fs-uuid --set=root c0a5062e-6847-44a0-9f4e-cfbb7292b037
fi
linux /boot/vmlinuz-4.13.0-41-generic.efi.signed root=UUID=c0a5062e-6847-44a0-9f4e-cfbb7292b037 ro recovery nomodeset
initrd /boot/initrd.img-4.13.0-41-generic
}
menuentry 'Ubuntu, with Linux 4.13.0-39-generic (on /dev/sdc7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.13.0-39-generic.efi.signed--c0a5062e-6847-44a0-9f4e-cfbb7292b037' {
insmod part_gpt
insmod ext2
set root='hd2,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt7 --hint-efi=hd2,gpt7 --hint-baremetal=ahci2,gpt7 c0a5062e-6847-44a0-9f4e-cfbb7292b037
else
search --no-floppy --fs-uuid --set=root c0a5062e-6847-44a0-9f4e-cfbb7292b037
fi
linux /boot/vmlinuz-4.13.0-39-generic.efi.signed root=UUID=c0a5062e-6847-44a0-9f4e-cfbb7292b037 ro quiet splash $vt_handoff
initrd /boot/initrd.img-4.13.0-39-generic
}
menuentry 'Ubuntu, with Linux 4.13.0-39-generic (upstart) (on /dev/sdc7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.13.0-39-generic.efi.signed--c0a5062e-6847-44a0-9f4e-cfbb7292b037' {
insmod part_gpt
insmod ext2
set root='hd2,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt7 --hint-efi=hd2,gpt7 --hint-baremetal=ahci2,gpt7 c0a5062e-6847-44a0-9f4e-cfbb7292b037
else
search --no-floppy --fs-uuid --set=root c0a5062e-6847-44a0-9f4e-cfbb7292b037
fi
linux /boot/vmlinuz-4.13.0-39-generic.efi.signed root=UUID=c0a5062e-6847-44a0-9f4e-cfbb7292b037 ro quiet splash $vt_handoff init=/sbin/upstart
initrd /boot/initrd.img-4.13.0-39-generic
}
menuentry 'Ubuntu, with Linux 4.13.0-39-generic (recovery mode) (on /dev/sdc7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.13.0-39-generic.efi.signed-root=UUID=c0a5062e-6847-44a0-9f4e-cfbb7292b037 ro recovery nomodeset-c0a5062e-6847-44a0-9f4e-cfbb7292b037' {
insmod part_gpt
insmod ext2
set root='hd2,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt7 --hint-efi=hd2,gpt7 --hint-baremetal=ahci2,gpt7 c0a5062e-6847-44a0-9f4e-cfbb7292b037
else
search --no-floppy --fs-uuid --set=root c0a5062e-6847-44a0-9f4e-cfbb7292b037
fi
linux /boot/vmlinuz-4.13.0-39-generic.efi.signed root=UUID=c0a5062e-6847-44a0-9f4e-cfbb7292b037 ro recovery nomodeset
initrd /boot/initrd.img-4.13.0-39-generic
}
menuentry 'Ubuntu, with Linux 4.4.0-124-generic (on /dev/sdc7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.4.0-124-generic--c0a5062e-6847-44a0-9f4e-cfbb7292b037' {
insmod part_gpt
insmod ext2
set root='hd2,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt7 --hint-efi=hd2,gpt7 --hint-baremetal=ahci2,gpt7 c0a5062e-6847-44a0-9f4e-cfbb7292b037
else
search --no-floppy --fs-uuid --set=root c0a5062e-6847-44a0-9f4e-cfbb7292b037
fi
linux /boot/vmlinuz-4.4.0-124-generic root=UUID=c0a5062e-6847-44a0-9f4e-cfbb7292b037 ro quiet splash $vt_handoff
initrd /boot/initrd.img-4.4.0-124-generic
}
menuentry 'Ubuntu, with Linux 4.4.0-124-generic (upstart) (on /dev/sdc7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.4.0-124-generic--c0a5062e-6847-44a0-9f4e-cfbb7292b037' {
insmod part_gpt
insmod ext2
set root='hd2,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt7 --hint-efi=hd2,gpt7 --hint-baremetal=ahci2,gpt7 c0a5062e-6847-44a0-9f4e-cfbb7292b037
else
search --no-floppy --fs-uuid --set=root c0a5062e-6847-44a0-9f4e-cfbb7292b037
fi
linux /boot/vmlinuz-4.4.0-124-generic root=UUID=c0a5062e-6847-44a0-9f4e-cfbb7292b037 ro quiet splash $vt_handoff init=/sbin/upstart
initrd /boot/initrd.img-4.4.0-124-generic
}
menuentry 'Ubuntu, with Linux 4.4.0-124-generic (recovery mode) (on /dev/sdc7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-4.4.0-124-generic-root=UUID=c0a5062e-6847-44a0-9f4e-cfbb7292b037 ro recovery nomodeset-c0a5062e-6847-44a0-9f4e-cfbb7292b037' {
insmod part_gpt
insmod ext2
set root='hd2,gpt7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt7 --hint-efi=hd2,gpt7 --hint-baremetal=ahci2,gpt7 c0a5062e-6847-44a0-9f4e-cfbb7292b037
else
search --no-floppy --fs-uuid --set=root c0a5062e-6847-44a0-9f4e-cfbb7292b037
fi
linux /boot/vmlinuz-4.4.0-124-generic root=UUID=c0a5062e-6847-44a0-9f4e-cfbb7292b037 ro recovery nomodeset
initrd /boot/initrd.img-4.4.0-124-generic
}
}


set timeout_style=menu
if [ "${timeout}" = 0 ]; then
set timeout=10
fi
### END /etc/grub.d/30_os-prober ###


### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
fwsetup
}
### 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 ###

oldfred
May 14th, 2018, 04:11 AM
It looks like Arch puts some boot files into the ESP?

This works for me (as long as flash drive is not plugged in and then drive is hd1)


menuentry "Ubuntu 18.04 Bionic (on /dev/sda4)" {
set root=(hd0,gpt4)
linux /vmlinuz root=/dev/sda4 ro quiet splash
initrd /initrd.img
}

Cavsfan
May 14th, 2018, 03:25 PM
It looks like Arch puts some boot files into the ESP?

This works for me (as long as flash drive is not plugged in and then drive is hd1)


menuentry "Ubuntu 18.04 Bionic (on /dev/sda4)" {
set root=(hd0,gpt4)
linux /vmlinuz root=/dev/sda4 ro quiet splash
initrd /initrd.img
}


I guess Arch does. I backed up Xenial and Bionic so here is the folder:

root@cavsfan-Bionic-Beaver:/boot/efi/EFI# ls
Arch_grub bionic Boot Microsoft ubuntu xenial


I'll give that a try.

So, on Ubuntu a simple sudo grub-install /dev/sdc will work? I know it does not work on Arch, It requires the long command:

sudo grub-install --target=x86_64-efi --efi-directory=/boot/EFI/Arch_grub --bootloader-id=Arch_grub

oldfred
May 14th, 2018, 05:18 PM
If you look at this the standard grub-install has the many option parameters.
man grub-install
info grub-install.

I have in my notes many versions of grub-install with different parameters, but most are example of just installing grub to a flash drive, so I can just boot ISO, creating my own grub.cfg to loopmount the ISOs.