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