how to change grub list order<SOLVED>

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Dennish2300
Level 3
Level 3
Posts: 159
Joined: Sat Jul 01, 2017 1:41 pm
Location: Hemel Hempstead
Contact:

how to change grub list order<SOLVED>

Post by Dennish2300 »

Thanks to Bleys I achieved the desired result: it does not change the grub menu order, but it does boot automatically from the last option selected.
Using the new LM, you need to edit /etc/default/grub to set GRUB_DEFAULT=saved, and add the line GRUB_SAVEDEFAULT=true, then update-grub.
Before the timeout, select the desired LM, let it boot into the wanted LM, then reboot, and check it boots from the desired LM, which may not be the top one.

Code: Select all

System:    Host: Left1 Kernel: 5.4.0-99-generic x86_64 bits: 64 compiler: gcc v: 7.5.0 
           Desktop: Cinnamon 4.4.8 wm: muffin dm: LightDM Distro: Linux Mint 19.3 Tricia 
           base: Ubuntu 18.04 bionic 
Machine:   Type: Desktop System: Gigabyte product: N/A v: N/A serial: <filter> Chassis: type: 3 
           serial: <filter> 
           Mobo: Gigabyte model: F2A68HM-HD2 v: x.x serial: <filter> UEFI: American Megatrends 
           v: FC date: 12/24/2015 
CPU:       Topology: Quad Core model: AMD A8-7650K Radeon R7 10 Compute Cores 4C+6G bits: 64 
           type: MCP arch: Steamroller rev: 1 L2 cache: 2048 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 26350 
           Speed: 2034 MHz min/max: 1900/3300 MHz Core speeds (MHz): 1: 2357 2: 2335 3: 3293 
           4: 3294 
Graphics:  Device-1: AMD Kaveri [Radeon R7 Graphics] vendor: Gigabyte driver: radeon v: kernel 
           bus ID: 00:01.0 chip ID: 1002:1313 
           Display: x11 server: X.Org 1.20.8 driver: ati,radeon unloaded: fbdev,modesetting,vesa 
           resolution: 1440x900~60Hz 
           OpenGL: renderer: AMD KAVERI (DRM 2.50.0 5.4.0-99-generic LLVM 10.0.0) 
           v: 4.5 Mesa 20.0.8 direct render: Yes 
Audio:     Device-1: AMD Kaveri HDMI/DP Audio vendor: Gigabyte driver: snd_hda_intel v: kernel 
           bus ID: 00:01.1 chip ID: 1002:1308 
           Device-2: AMD FCH Azalia vendor: Gigabyte driver: snd_hda_intel v: kernel 
           bus ID: 00:14.2 chip ID: 1022:780d 
           Device-3: Logitech HD Pro Webcam C920 type: USB driver: snd-usb-audio,uvcvideo 
           bus ID: 2-2:2 chip ID: 046d:082d 
           Sound Server: ALSA v: k5.4.0-99-generic 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Gigabyte 
           driver: r8169 v: kernel port: e000 bus ID: 01:00.0 chip ID: 10ec:8168 
           IF: enp1s0 state: down mac: <filter> 
           IF-ID-1: wlx7c8bca1cb9f1 state: up mac: <filter> 
Drives:    Local Storage: total: 1.02 TiB used: 70.60 GiB (6.8%) 
           ID-1: /dev/sda vendor: Western Digital model: WD10EZEX-75WN4A0 size: 931.51 GiB 
           speed: 6.0 Gb/s serial: <filter> 
           ID-2: /dev/sdb vendor: SanDisk model: SDSSDA120G size: 111.79 GiB speed: 6.0 Gb/s 
           serial: <filter> 
Partition: ID-1: / size: 31.66 GiB used: 14.67 GiB (46.3%) fs: ext4 dev: /dev/sdb1 
           ID-2: /home size: 65.60 GiB used: 55.93 GiB (85.3%) fs: ext4 dev: /dev/sdb2 
USB:       Hub: 1-0:1 info: Full speed (or root) Hub ports: 5 rev: 2.0 chip ID: 1d6b:0002 
           Hub: 2-0:1 info: Full speed (or root) Hub ports: 5 rev: 2.0 chip ID: 1d6b:0002 
           Device-1: 2-2:2 info: Logitech HD Pro Webcam C920 type: Video,Audio 
           driver: snd-usb-audio,uvcvideo rev: 2.0 chip ID: 046d:082d 
           Hub: 3-0:1 info: Full speed (or root) Hub ports: 5 rev: 1.1 chip ID: 1d6b:0001 
           Hub: 4-0:1 info: Full speed (or root) Hub ports: 5 rev: 1.1 chip ID: 1d6b:0001 
           Device-2: 4-3:2 info: N/A type: Mouse,Keyboard driver: hid-generic,usbhid rev: 1.1 
           chip ID: 18f8:0f99 
           Hub: 5-0:1 info: Full speed (or root) Hub ports: 2 rev: 1.1 chip ID: 1d6b:0001 
           Hub: 6-0:1 info: Full speed (or root) Hub ports: 2 rev: 2.0 chip ID: 1d6b:0002 
           Device-3: 6-2:2 info: N/A type: Network driver: rtl8192eu rev: 2.1 chip ID: 2357:0108 
           Hub: 7-0:1 info: Full speed (or root) Hub ports: 2 rev: 3.0 chip ID: 1d6b:0003 
Sensors:   System Temperatures: cpu: 14.0 C mobo: N/A gpu: radeon temp: 14 C 
           Fan Speeds (RPM): N/A 
Repos:     No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
           1: deb http: //packages.linuxmint.com tricia main upstream import backport #id:linuxmint_main
           2: deb http: //archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
           3: deb http: //archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse
           4: deb http: //archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse
           5: deb http: //security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
           6: deb http: //archive.canonical.com/ubuntu/ bionic partner
           No active apt repos in: /etc/apt/sources.list.d/skype-stable.list 
           Active apt repos in: /etc/apt/sources.list.d/teams.list 
           1: deb [arch=amd64] https: //packages.microsoft.com/repos/ms-teams stable main
           No active apt repos in: /etc/apt/sources.list.d/webupd8team-y-ppa-manager-bionic.list 
Info:      Processes: 235 Uptime: 46m Memory: 6.73 GiB used: 3.53 GiB (52.5%) Init: systemd v: 237 
           runlevel: 5 Compilers: gcc: 7.5.0 alt: 7 Client: Unknown python3.6 client inxi: 3.0.32 
I had no success using the grub> prompt so I had to reinstall LM19.3 alongside my LM<19.3 as I did not want to lose my data / setup.
Now the top item in the grub menu is the new LM19.3, so to access my old LM19.3 and its data / setup I have to catch it within 10s and manually select the old LM19.3 which works fine.
I have tried to read up on GRUB and how it generates a new grub file but have failed to find out how to make the old LM19.3 the top entry so it boots from that automatically.
Can someone help me?
Last edited by LockBot on Tue Jun 06, 2023 10:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
stevstav
Level 1
Level 1
Posts: 9
Joined: Wed Nov 30, 2022 8:42 am
Location: Athens Greece

Re: how to change grub list order

Post by stevstav »

In Mint 20 & 21 (now) , I have a program called "Grub Customizer" that does the trick (and some others).
deepakdeshp
Level 20
Level 20
Posts: 12341
Joined: Sun Aug 09, 2015 10:00 am

Re: how to change grub list order

Post by deepakdeshp »

Do not install grub customizer. It marks grub non correctible in case of problems.
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
User avatar
Dennish2300
Level 3
Level 3
Posts: 159
Joined: Sat Jul 01, 2017 1:41 pm
Location: Hemel Hempstead
Contact:

Re: how to change grub list order

Post by Dennish2300 »

deepakdeshp do you have information to help me?
User avatar
Bleys
Level 4
Level 4
Posts: 431
Joined: Wed Apr 20, 2022 4:17 am
Location: Essen, Germany

Re: how to change grub list order

Post by Bleys »

The most elegant solution:

Code: Select all

sudo nano /etc/default/grub
Original:

Code: Select all

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
change to:

Code: Select all

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

Code: Select all

sudo update-grub
From there, grub remembers the last system started and starts from it until another one is selected when starting
Last edited by Bleys on Tue Dec 06, 2022 7:19 pm, edited 1 time in total.
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
User avatar
Dennish2300
Level 3
Level 3
Posts: 159
Joined: Sat Jul 01, 2017 1:41 pm
Location: Hemel Hempstead
Contact:

Re: how to change grub list order

Post by Dennish2300 »

tried that but it made no difference: grub menu still has the new vanilla LM19.3 at the top (which I do not want) so I still have to change it manually to the old LM19.3 within 10s.

Code: Select all

dennis@Left1:~$ sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'
Sourcing file `/etc/default/grub.d/60_mint-theme.cfg'
Generating grub configuration file ...
Found theme: /boot/grub/themes/linuxmint/theme.txt
Found linux image: /boot/vmlinuz-5.4.0-99-generic
Found initrd image: /boot/initrd.img-5.4.0-99-generic
Found linux image: /boot/vmlinuz-5.4.0-97-generic
Found initrd image: /boot/initrd.img-5.4.0-97-generic
Found linux image: /boot/vmlinuz-5.0.0-32-generic
Found initrd image: /boot/initrd.img-5.0.0-32-generic
Found Linux Mint 19.3 Tricia (19.3) on /dev/sdb6
Adding boot menu entry for EFI firmware configuration
done
it is still finding the new LM19.3 on /dev/sdb6: the old LM19.3 is at /dev/sdb1
why is it only finding the new one?
User avatar
Bleys
Level 4
Level 4
Posts: 431
Joined: Wed Apr 20, 2022 4:17 am
Location: Essen, Germany

Re: how to change grub list order

Post by Bleys »

Dennish2300 wrote: Tue Dec 06, 2022 6:31 pm tried that but it made no difference: grub menu still has the new vanilla LM19.3 at the top (which I do not want) so I still have to change it manually to the old LM19.3 within 10s.
i quote myself:
Bleys wrote: Tue Dec 06, 2022 5:29 pm From there, grub remembers the last system started and starts from it until another one is selected when starting
You have to start at least 2 times for the change to take effect.
First start after the change: Selection of the desired system and at the next start will the previously selected system be started automatically.

This works on any system with Grub where I have this set up. If it doesn't work for you, you missed something or did something wrong somewhere along the way.
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
User avatar
Dennish2300
Level 3
Level 3
Posts: 159
Joined: Sat Jul 01, 2017 1:41 pm
Location: Hemel Hempstead
Contact:

Re: how to change grub list order

Post by Dennish2300 »

rebooted 3 times now and still has new vanilla LM19.3 at top of grub menu.
Here is /etc/default/grub

Code: Select all

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
I also tried it with a timeout of zero.
User avatar
Bleys
Level 4
Level 4
Posts: 431
Joined: Wed Apr 20, 2022 4:17 am
Location: Essen, Germany

Re: how to change grub list order

Post by Bleys »

Dennish2300 wrote: Tue Dec 06, 2022 7:26 pm rebooted 3 times now and still has new vanilla LM19.3 at top of grub menu.
The order does not change! The change in /etc/default/grub only ensures that the last started system is automatically selected.
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
User avatar
Dennish2300
Level 3
Level 3
Posts: 159
Joined: Sat Jul 01, 2017 1:41 pm
Location: Hemel Hempstead
Contact:

Re: how to change grub list order

Post by Dennish2300 »

it does not select the last booted system either. It selects the top one, which is the new LM19.3 vanilla flavour.
After grub has read the templates files it goes off to find the kernels then goes off to search for the file system.
Do you know what controls this?
User avatar
Bleys
Level 4
Level 4
Posts: 431
Joined: Wed Apr 20, 2022 4:17 am
Location: Essen, Germany

Re: how to change grub list order

Post by Bleys »

I just see that you must have modified Grub before.
60_mint-theme.cfg is not part of the default configuration. Have a look in there.
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
User avatar
Dennish2300
Level 3
Level 3
Posts: 159
Joined: Sat Jul 01, 2017 1:41 pm
Location: Hemel Hempstead
Contact:

Re: how to change grub list order

Post by Dennish2300 »

I have not created or edited 60_mint-theme.cfg

Code: Select all

#! /bin/sh
set -e

GRUB_FONT="/boot/grub/fonts/UbuntuMono16.pf2"
GRUB_THEME="/boot/grub/themes/linuxmint/theme.txt"
User avatar
Bleys
Level 4
Level 4
Posts: 431
Joined: Wed Apr 20, 2022 4:17 am
Location: Essen, Germany

Re: how to change grub list order

Post by Bleys »

Reboot your old system and make the same changes there with a final

Code: Select all

sudo update-grub
If you did this first in the old system then do it again in the new system.
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
User avatar
Dennish2300
Level 3
Level 3
Posts: 159
Joined: Sat Jul 01, 2017 1:41 pm
Location: Hemel Hempstead
Contact:

Re: how to change grub list order

Post by Dennish2300 »

OK, I was making the changes in the old system, as this was the only one with internet access.
I have edited /etc/default/grub on the new system, and I think it is working.
Going to bed, so will check in the morning.
Thanks.
Locked

Return to “Installation & Boot”