GRUB: Reboot to a specific OS

I have installed Linux parallel to Windows since I still need Windows for image and video editing. Because Linux is my main system, I’ve set the timeout of GRUB to one second so I don’t waste a lot of time but can still change the OS to boot if I am quick enough. But when I reboot from Linux to switch to Windows, I always miss this one second :-). So instead I run the following script, placed under /usr/local/bin:

#!/bin/bash
grub-reboot 2 #The entry's number to start
reboot

To make this work, you have to set the default entry to “saved”:

GRUB 1: In /boot/grub/menu.lst , set default to saved.

GRUB 2: In /etc/default/grub , set GRUB_DEFAULT=save

2 thoughts on “GRUB: Reboot to a specific OS

  1. Die interessantere Frage wäre doch jetzt, wie kann man das genau einmal tun? Also das nach dem Windows-Boot das nächste Mal wieder Linux kommt. (Die Frage quält mich scho länger…)

    1. Ich hoffe, ich habe jetzt keinen Schritt vergessen, aber genau das sollte es eigentlich tun. Bei mir (mit GRUB 2) funktioniert es auch wie gewünscht. Klappt es bei dir nicht?

Leave a Reply to Philipp Hasper Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.