Fedora- How to change the boot order in Grub2 to Windows 7

Short version:

su -

grub2-set-default "Windows 7 (loader) (on /dev/sda1)"

grub2-mkconfig -o /boot/grub2/grub.cfg

Long version:
First check to see the menuentry for Windows 7

sudo cat /boot/grub2/grub.cfg |grep Windows

It should say something similar to:

menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {

Then set Windows to default with:

sudo grub2-set-default "Windows 7 (loader) (on /dev/sda1)"

(Note, if your menuentry is different, then change the previous code to match.)
Now, you can verify that you’ve changed the default to windows with:

sudo grub2-editenv list

Now make the changes to the grub.cfg with:

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

And there you go, Windows is the default OS booted at startup.

To set linux as default:

su -
cat /boot/grub2/grub.cfg |grep Fedora
grub2-set-default "Fedora Linux, with Linux 3.1.0-5.fc16.i686"
grub2-editenv list
grub2-mkconfig -o /boot/grub2/grub.cfg

As you can see, the commands are the exact same as they are for windows, except changed to target Fedora instead.

Thanks for this tip. Link

Advertisements

2 responses to “Fedora- How to change the boot order in Grub2 to Windows 7

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s