2

I have to Linux dist installed on two separate HDDs, currently I' m working from home so sometimes need to switch OS back and forth. I tried all these steps from this link:

Set “older” kernel as default grub entry

but nothing works for me.

Each time Debian 9 Stretch being loaded. How can I switch to Ubuntu OS ?

Here is my setup

enter image description here

Here is the disk configuration. I need to boot OS from /dev/sdb1.

enter image description here

1 Answers1

1

Thanks to @rtaft and @mook765 for helping. I'm not very experiencing in grub internals, and actually I don't have much desire to read tons of documentation.

In my case I have to HDD:

  • /dev/sda - Debian
  • /dev/sdb - Ubuntu.

Both of these have their own copy of /boot/grub/grub.cfg. Let's say I login to Debian now, it means all commands like sudo grub-update sudo grub-set-default x

etc. will affect grub.cfg of Debian dist currently running.

Taking into account, that I don't know order of executing of these two versions of grub.cfg. I decided to change line with set default="Desired OS", in my case set default="Debian GNU/Linux 9 (stretch) (on /dev/sda3)"

for BOTH these grub.cfg.

Summary:

  1. I changed /boot/grub/grub.cfg manually and set desired default.
  2. I mount second HDD (/dev/sdb -> ~/mnt_devsdb).
  3. I changed ~/mnt_devsdb/boot/grub/grub.cfg manually and set desired default(the same as for p.1).
  4. reboot and .... voila! it works!

To boot Ubuntu I need to repeat all these steps and set proper default again.