Announcement

Collapse
No announcement yet.

Option to default to previous choice?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [GRUB] Option to default to previous choice?

    I'm in the process of setting up a dual-boot system, and for the first time in ages will be putting both systems on the same hard drive. And it occurred to me that I probably want it to automatically change the default boot option to whatever I chose last time, so I can tell it to restart (e.g. after an update), leave the room, and come back to see that it's rebooted into the same OS I was in before. So basically, if I pick "Windows 10" one time, and later reboot, the boot menu should still be there, but Windows 10 should already be selected and boot if the countdown ends.

    I found this in my searches, but when I tried following the instructions myself, and restarted, it just skipped over the menu entirely and went right into Kubuntu. I'm not sure if I did something wrong, or if the guide was incorrect, or what. For what it's worth, I did not actually have the Windows install present at the time, but I feel like that shouldn't make a difference because GRUB has always featured more boot options than just the two.

    #2
    If your Kubuntu uses btrfs, grub doesn't support writing to it, and the choice doesn't get saved.

    Regards, John Little
    Regards, John Little

    Comment


      #3
      Well, it must have saved something or else the menu wouldn't have disappeared.

      Comment


        #4
        Originally posted by Steve the Pocket View Post
        Well, it must have saved something or else the menu wouldn't have disappeared.
        Agreed, but that doesn't mean it didn't work.

        It sounds like maybe GRUB is using a zero timeout since you made this change. You might want to try going back into default/grub and change the timeouts to non-zero;


        GRUB_HIDDEN_TIMEOUT=7
        GRUB_HIDDEN_TIMEOUT_QUIET=false
        GRUB_TIMEOUT=10

        Please Read Me

        Comment


          #5
          Welp, I think I found the problem. GRUB_TIMEOUT_STYLE was still set to "hidden". I think I understand what happened here: When I installed Kubuntu the first time, it noticed that I had Windows on a secondary drive and edited /boot/grub/grub.cfg directly to enable the menu and probably also to add Windows to the list of boot options. And this was an acceptable approach provided that no one ever wanted to mess with GRUB's boot options again. But /etc/default/grub was left unaltered.

          Anyway, I've changed GRUB_TIMEOUT_STYLE to "menu"; hopefully this will do the trick. In future, though, letting the installer mess with /boot/grub/grub.cfg directly is probably bad practice, both on principle (update-grub exists for a reason) and because it can lead to situations like this.

          Comment


            #6
            Good catch finding that, but you assumptions are somewhat incorrect.

            update-grub will find windows installs if os_prober is enabled and add them to grub.cfg. The installer doesn't do that - it just calls update-grub.

            Nothing should alter /etc/defaults/grub except for you, unless the package itself was updated and the set values were altered by the developer. In that case you would get a query to keep your options or allow the changes to occur (or just view the diff).

            Please Read Me

            Comment

            Working...
            X