desktop-virtualization-community-VDI-UDS-EnterpriseJOIN OUR


Setup Grub to remember your last booted OS

Posted by UDS Enterprise Team |

You absolutely have rebooted from Linux to load Windows several times. Those that dual-boot their system have done this quite a lot. Dual-booting relies heavily on the Grub bootloader and its entries; this gets worse when you realize that Windows has to restart a lot as it updates. Actually, there’s a way to set Grub to remember where you last left off! This means when you load Windows (or any operating system), and it restarts, it’ll load it again!


Before any configurations changes are made, try to back up all Grub configurations for emergency cases. Assuming you are currently running Linux in your machine, start off by opening a terminal and making a backup directory.

mkdir -p ~/grub-backup

Start copying configuration files from “/etc/default/grub” and “/etc/grub.d”

cp /etc/default/grub ~/grub-backup cp -a /etc/grub.d ~/grub-backup

Here’s how to set the Grub bootloader so it will remember the last booted item by the following command:

sudo nano /etc/default/grub

Change GRUB_DEFAULT=0 to GRUB_DEFAULT=saved Then, paste this below the GRUB_DEFAULT line:


There are other ways to tweak Grub such as changing timeout time, hiding Grub unless the user presses Shift key. All these tweaks can be easily done through editing the file "/etc/default/grub".

Source: Make tech easier



You must authenticate to review this post