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

  • You are probably going from this grub into grub on the other disk which then sends you back to this OS. What is the disk configuration look like? I wonder if you can change this grub to point to /dev/sdb2 instead of /dev/sdb1. – rtaft Jul 14 at 17:38
  • @rtaft I' ve just posted disk config in the topic. – StNickolay Jul 14 at 17:43
  • Can you mount /dev/sdb1 and view /boot/grub/grub.cfg to see if it is pointing back to sda? – rtaft Jul 14 at 17:53
  • How can I examine /boot/grub/grub.cfg to figure out where is it pointing to ? – StNickolay Jul 14 at 18:30
  • Remotely? First mount it, sudo mkdir /media/ubuntu and sudo mount /dev/sdb1 /media/ubuntu, Then view /media/ubuntu/boot/grub/grub.cfg and look at the line set default to see what it says, I think that's the setting to look at. – rtaft Jul 14 at 19:36

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.


  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.

| improve this answer | |

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.