Force Grub to Reboots into the specified OS

Well these days multi-booting is common. GNU GRUB is a multiboot boot-loader software package from the GNU project. I have three operating system installed at work:
* Debian Linux

* FreeBSD 6.0

* Windows XP

As per my requirements, I keep rebooting into different oses. Recently I discovered grub-reboot command. As name suggest it reboots into the specified OS entry in Grub configuration file (menu.lst or grub.conf).

Syntax:
grub-reboot entry [options to grub]

Where,

  • entry: Is the entry number in menu.lst / grub.conf file.

For example, if you wish to reboot in FreeBSD then you can type command (3 is entry for FreeBSD):
# grub-reboot 3
This is also useful to force remote computer to reboot in specific OS over ssh session.

Read the man page of grub and grub-reboot for more information.


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 4 comments so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
4 comments… add one
  • Joackim Jan 8, 2008 @ 12:26

    I have installed fedora 6 on my computer. I would like to Install windows Xp so that i will be dual booting. I am, however unable to boot from Windows disks. i have tried to remove the partitions with Gparted and SystemrescueCD but it will still not boot Windows. what should I do?

  • anthropo Jan 13, 2008 @ 10:29

    hello, it would be helpfull if you add the information that you must

    1) change the traditionnal ‘default 0’ by ‘default saved’
    2) force, in the entry you want to choose, savedefault 0 in order to re-initialise the number which is saved

    example :

    ### END DEBIAN AUTOMAGIC KERNELS LIST

    # Windows 98 Boot avec Ghost
    title Norton Ghost – Sauvegardes

    root (hd0,0)
    chainloader +1
    savedefault 0
    boot

    thanks a lot for this post

  • Ama Aug 26, 2010 @ 14:44

    Thanks….Please help me I installed linux mint 9 inside windows xp successfully. And restarted now a black screen comes with GRUB< …..What to do I am new to LINUX….?

  • miss jd Nov 28, 2011 @ 18:21

    please help me, im constantly getting this error caused by a virus which is 0xc000014c and i am unable to boot my pc no matter what option i choose. then i stumbled upon using grub dos prompt by constantly pressing escape button. the last time that this happened i got a 0xc0000248c error i think and i found a set of codes from the net which i inputted in the grub command line. luckily i was able to boot my laptop back then.. but now, i cant seem to find the codes and i am really helpless and tired. it has been 2 days since this happened. sadly, i don’t have the windows 7 installation disk. so if anyone could give me the grub commands to boot my window, it would really be appreciated and it would be a great help for me.. pleasee help meee

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum