Configuring GRUB bootloader to boot to the same Operating System as last time

You have two different operating systems installed on one computer, how do you decide which one loads up when you start your machine up? Well the bit of software that controls this is called a bootloader, it pops up on screen asking which O/S to start.

grub_bootloader

If both operating systems are part of the Microsoft Windows family then you will be using Microsoft’s bootloader but if at least one O/S is a Linux distribution it is almost inevitable you will be using the Linux GRUB bootloader system.

This is the case on my own laptop running both Mint Linux and Windows. The problem I had was I used it in Windows mode more often than Linux but unless you are quick to tell it otherwise GRUB times out and loads the default, first listed, O/S, which is invariably Linux.

Changing the GRUB default

I considered reconfiguring GRUB to default to loading Windows but then I came across a way of making the GRUB bootloader default to opening the operating system that was last used. So if I had been using Linux the next time I booted up it would start Linux unless I intervened and told it otherwise, and it would boot to Windows if I had been using Windows.

This seemed the obvious solution and it worked like a dream.

Step by step instructions

If you too are running a recent version GRUB bootloader and want to change to booting to the last operating system used this is how it is done.

 1)  Navigate your way to the file /etc/default/grub
 
Now as you are a Linux user I am probably teaching my granny to suck eggs by explaining that, but here is how I did it.Click on Computer : click File System : Click etc : click default : find file called grub
 2)  Open the grub file in a text editor as system administrator.
 
Right click your mouse on grub, select “Open as administrator” and enter you administrator password if prompted.
 3  Create a back up copy of the grub file just in case anything goes wrong.
 
Go to File and select Save As. Type a suitable back up name such as grub-bak and save the file.
 4  Find the line in your grub file that says GRUB_DEFAULT=0, change it to read GRUB_DEFAULT=saved
 5  Below the line you have just changed create a new line which reads GRUB_SAVEDEFAULT=true
6 Save your modified grub file.
 7  Now find and open the Terminal program on your computer.
8  Run sudo update-grub
 
To do this just type sudo update-grub at the command prompt and press return. Enter your administrator password when asked.
9 That’s it!

Leave a Reply