Ask Your Question
2

Switch between Windows 10 and Fedora 23 before reboot.

asked 2016-03-03 21:01:24 -0600

Svelah_Kaldra gravatar image

updated 2016-03-04 11:42:42 -0600

I was wondering if there was any way to reboot directly to Fedora or Windows and bypass the boot-loader. So rather than just rebooting and selecting what OS to boot I could select the OS I want before rebooting (defaulting to the same OS preferably) and have it skip the boot-loader. Anyone know of a way to do this or is it not really possible?

Edit I have done what Aeyoun suggested I've yet to test it but I believe that will work for defaulting to reboot to the same OS.

I have also attempted to make a script from what Isatenstein sugest but can't get it to work. I'm getting the error "line 16: syntax error: unexpected end of file" Here is the code:

#!/bin/sh
keyPress="n"
until [ $keyPress = "w" ] || [ $keyPress = "f" ]
do
    echo "To boot windows press w ; to boot fedora press f"
    keyPress=$(read -n  1 -s);
    if [ "$keyPress" = "w" ]
    then
        grub-set-default "Windows Boot Manager (on /dev/sda2)"
    fi
    if [ "$keyPress" = "f" ]
    then
        grub-set-default "Fedora (4.2.3-300.fc23.x86_64) 23 (Workstation Edition)"
    fi
done
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2016-03-04 08:46:20 -0600

Aeyoun gravatar image

Grub can be configured to remember the last choice you made and use that choice the next time you boot. So you could run Windows Update or Fedora Update and have it restart two–ten times as needed while it installs updates without having to sit there and wait to make the right choice in grub. You only need to interact with grub when you want to change what system you boot into.

Add these two lines to the bottom of /etc/default/grub:

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true

Then rebuild your grub configuration, but the exact instructions differ for legacy BIOS and EFI systems.

edit flag offensive delete link more
1

answered 2016-03-04 07:19:57 -0600

lsatenstein gravatar image

READ the Man pages for grub2-set-default.

With grub2-set-default you can choose the default operating system or version that will be rebooted.

Run that command before you reboot, or put it into a script file.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2016-03-03 21:01:24 -0600

Seen: 284 times

Last updated: Mar 04 '16