0

I have Ubuntu 16.04, Ubuntu 18.04, and Windows 10 installed on my machine. I want to update the order of entries in the grub menu so that the default (first) entry is Ubutnu 18.04. The solutions available online suggest manually changing the default to a specific entry, with a specific kernel version. However, after kernel update, won't I need to again change the order to put the latest version on top?

I notice I have this kind of "generic" entry (the first entry, called "Ubuntu") which always loads the last kernel version available of Ubuntu 16.04. How can I have an entry with the same behavior for Ubuntu 18.04 and move it to the top? Also, could someone explain how this entry works? I couldn't find anything online about it.

P.S: I tried changing the order and saving with Grub-customizer, but it didn't actually change it! Also, it seems to be inconsistent, because in the first entry named "Ubuntu", when I click edit, I find that it has this part "linux /boot/vmlinuz-4.18.0-25-generic". So, it seems to be referring to Ubuntu 18.04 kernel, but when I open the same entry from boot menu, it opens Ubuntu 16.04 instead.

Thank you.

7
  • 2
    Your system has one active MBR (per drive, bios will control which drive is used), so you must use grub-customizer or make changes on the system that owns the MBR. If it's 16.04, changes made in 18.04 will be unused and vice-versa. Changes made to /boot/grub/grub.cfg will be overwritten on next update-grub (including kernel updates), but changes made to /etc/default/grub will not be lost (ie. that's where to make changes, but you need to run update-grub to see the changes copied to your grub.cfg file). – guiverc Jul 23 '19 at 11:14
  • can you show grep -i "menuentry '" /boot/grub/grub.cfg|sed -r "s|--class .*$||g"|nl -v 0 – nobody Jul 23 '19 at 12:13
  • @guiverc Thank you, that explains why grub-customizer had no effect. I will try again from 16.04 and tell you the result. But I still would like to have that generic Ubuntu entry for 18.04 :) – Karim Sonbol Jul 23 '19 at 12:29
  • @nobody here is the output: paste.ubuntu.com/p/kfSzF2YFyj – Karim Sonbol Jul 23 '19 at 12:31
  • you are right something ist messed up. All ubuntu entries point to /dev/sda7 fdisk -l 2>/dev/null | egrep "Disk /|/dev/" | sed "s#^/dev/#Part /dev/#" | awk '{print $2}' | sed 's/://' | xargs -n1 -IX sudo sh -c "hexdump -v -s 0x80 -n 2 -e '2/1 \"%x\" \"\\n\"' X | xargs -n1 -IY sh -c \"case \"Y\" in '48b4') echo X: GRUB 2 v1.96 ;; 'aa75' | '5272') echo X: GRUB Legacy ;; '7c3c') echo X: GRUB 2 v1.97 oder v1.98 ;; '020') echo X: GRUB 2 v1.99 ;; *) echo X: Kein GRUB Y ;; esac\"" – nobody Jul 23 '19 at 12:59
1

The distribution you booted from when sudo update-grub was last run becomes option 1. Ubuntu on the grub main menu.

When 18.04 isn't the first option, boot into it and run sudo update-grub then it becomes the first option.

Note: If a system update installs a new kernel then update-grub is run as part of the process automatically.

0

I was able to solve this based on @guiverc comment:

Your system has one active MBR (per drive, bios will control which drive is used), so you must use grub-customizer or make changes on the system that owns the MBR. If it's 16.04, changes made in 18.04 will be unused and vice-versa. Changes made to /boot/grub/grub.cfg will be overwritten on next update-grub (including kernel updates), but changes made to /etc/default/grub will not be lost (ie. that's where to make changes, but you need to run update-grub to see the changes copied to your grub.cfg file).

So, using Grub-customizer from Ubuntu 16.04, since it is the system that owns the MBR on my drive, I was able to re-order the entries, and the generic entry "Ubuntu" for Ubuntu 18.04 was already available in the entry list, so I didn't need to choose a specific kernel version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.