LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 05-19-2017, 10:28 AM   #1
IamIdan
LQ Newbie
 
Registered: May 2017
Posts: 4

Rep: Reputation: Disabled
How to change boot order?


Hello everyone!
I'm super new to fedora and Linux in general, and I want to know how to change the boot order when I open the computer, so Instead of this list:
  • Fedora 25
  • Fedora 25 (Safe mode)
  • Windows 10
It will be
  • Windows 10
  • Fedora 25
  • Fedora 25 (Safe mode)

I have read a lot of topics but non of them worked (I even tried to install grub customizer but it is asking for my password and then don't do anything, now I don't know how to uninstall this since I couldn't found it in the Software app so I installed it via the terminal)
Thanks in addition to everyone who might help me!
 
Old 05-19-2017, 10:57 AM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
mmm edit /boot/grub/grub.cfg after you made a copy, then switch it around placing windows on top and never run update-grub again, and make sure you have a means to get into your linux system just in case you ooppss all over it, that way you can copy back over the one you modded to get back in.

Last edited by BW-userx; 05-19-2017 at 11:00 AM.
 
Old 05-19-2017, 11:07 AM   #3
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by IamIdan View Post
I want to know how to change the boot order when I open the computer, so Instead of this list:
  • Fedora 25
  • Fedora 25 (Safe mode)
  • Windows 10
It will be
  • Windows 10
  • Fedora 25
  • Fedora 25 (Safe mode)
Welcome to linuxquestions. Another way to do what you want is to edit /boot/grub/grub.cfg. Change the line:

set default="0"

to:

set default="2"

You would have to redo this change every time you run grub-config

---------------------------
Steve Stites
 
Old 05-19-2017, 11:26 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
both advice given ignore the fact that grub has a dedicated configuration file:
/etc/default/grub
you can edit the GRUB_DEFAULT variable, so that your system will highlight the n-th line of the menu, and boot from it automatically after the timeout.
it will NOT change the appearance of the menu.
please read https://help.ubuntu.com/community/Gr...iguring_GRUB_2
 
Old 05-19-2017, 11:30 AM   #5
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
Quote:
Originally Posted by BW-userx View Post
mmm edit /boot/grub/grub.cfg after you made a copy, then switch it around placing windows on top and never run update-grub again, and make sure you have a means to get into your linux system just in case you ooppss all over it, that way you can copy back over the one you modded to get back in.
No, please. I do not have fedora 25 here, but I seriously doubt that it has old grub on it, would bet on grub 2. And in grub 2 you do not edit /boot/grub/grub.cfg directly. What you do edit when you want to customize grub is /etc/default/grub and files in /etc/grub.d/. As for how to customize order, there is one nice trick that you could do. In your /etc/default/grub change GRUB_DEFAULT parameter to be like this:

GRUB_DEFAULT=saved

With that, grub will always automatically load your previous choice. So, on next boot, choose that M$ ( if you really must ) and it will be your first choice for grub after that. If you really want just to set it that M$ is always first, do something like this:

GRUB_DEFAULT=2

That will set M$ to load first, if it is entry number 3 on your grub boot screen. You can also choose it like this:

GRUB_DEFAULT="Windows 10"

If that is label of your M$ entry. You can check in your /boot/grub2/grub.cfg file how it is exactly labeled. Also, when you change grub settings, do not forget to run:

grub2-mkconfig --output=/boot/grub2/grub.cfg

Of course, all that editing and command to refresh your grub.cfg must be done with root privileges, either as root, or with sudo command. Hope that this helps you
 
2 members found this post helpful.
Old 05-19-2017, 11:49 AM   #6
IamIdan
LQ Newbie
 
Registered: May 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dejank View Post
No, please. I do not have fedora 25 here, but I seriously doubt that it has old grub on it, would bet on grub 2. And in grub 2 you do not edit /boot/grub/grub.cfg directly. What you do edit when you want to customize grub is /etc/default/grub and files in /etc/grub.d/. As for how to customize order, there is one nice trick that you could do. In your /etc/default/grub change GRUB_DEFAULT parameter to be like this:

GRUB_DEFAULT=saved

With that, grub will always automatically load your previous choice. So, on next boot, choose that M$ ( if you really must ) and it will be your first choice for grub after that. If you really want just to set it that M$ is always first, do something like this:

GRUB_DEFAULT=2

That will set M$ to load first, if it is entry number 3 on your grub boot screen. You can also choose it like this:

GRUB_DEFAULT="Windows 10"

If that is label of your M$ entry. You can check in your /boot/grub2/grub.cfg file how it is exactly labeled. Also, when you change grub settings, do not forget to run:

grub2-mkconfig --output=/boot/grub2/grub.cfg

Of course, all that editing and command to refresh your grub.cfg must be done with root privileges, either as root, or with sudo command. Hope that this helps you
Thank You! I have looked for an answer like that for hours but couldn't found one!
I still have 2 minors problems:
1. I can't edit the grub file (It opens in read-only mode)
2. I don't have the grub.cfg file in /boot/grub2 Can't also find it elsewhere.
I must set Windows 10 as my priority because I have an Win10 update (a big one, which preventing me from using it), and I'm too lazy to sit here next to the computer and wait for every time it is want to restart so it will continue (most do some work for school, learning c# which I can't run on Linux).
 
Old 05-19-2017, 12:32 PM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by IamIdan View Post
1. I can't edit the grub file (It opens in read-only mode)
you need to gain superuser privileges. this is usually done by prepending the command with "sudo" and entering your user password.

Quote:
2. I don't have the grub.cfg file in /boot/grub2 Can't also find it elsewhere.
please re-read the previous 2 posts.
you need to edit /etc/default/grub
after editing it succesfully, you need to run "sudo update-grub" to apply changes.

Last edited by ondoho; 05-19-2017 at 12:33 PM.
 
Old 05-19-2017, 12:37 PM   #8
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
1. Type here commands you use to edit grub file. I suspect that you do not open it with root privs. And you can not edit it without root privs. If you use some editor like gedit, you will probably need gksu.

2.https://fedoraproject.org/wiki/GRUB_2 As said, do not have Fedora here, but from what I know, you should have file /boot/grub2/grub.cfg Open up your terminal and type:

cat /boot/grub2/grub.cfg

If it is not there, type:

cat /boot/grub/grub.cfg

There should be some wall of text, but you can scroll it in your terminal. Anyway, you do not really need to look at it, if you choose option to set up default grub entry with number. Which is explained in my previous post.
 
Old 05-19-2017, 12:39 PM   #9
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
you need to gain superuser privileges. this is usually done by prepending the command with "sudo" and entering your user password.


please re-read the previous 2 posts.
you need to edit /etc/default/grub
after editing it succesfully, you need to run "sudo update-grub" to apply changes.
No, no update-grub on Fedora, it is Debian based tool. On Fedora it should be:

grub2-mkconfig -o /boot/grub2/grub.cfg
 
Old 05-19-2017, 02:20 PM   #10
IamIdan
LQ Newbie
 
Registered: May 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
you need to gain superuser privileges. this is usually done by prepending the command with "sudo" and entering your user password.


please re-read the previous 2 posts.
you need to edit /etc/default/grub
after editing it succesfully, you need to run "sudo update-grub" to apply changes.
Quote:
Originally Posted by dejank View Post
No, no update-grub on Fedora, it is Debian based tool. On Fedora it should be:

grub2-mkconfig -o /boot/grub2/grub.cfg
As said in the description, I'm a super beginner to Linux. After a bit of reading, I managed to change the file (with root access using the su code and opening the file using gedit). I tried to both set GRUB_DEFAULT to 3 (I have 2 fedora version, fedora safe mode and windows) and to set it to 'Windows Boot Manager (on /dev/sda2)'.
I tried in both changes to save it with grub2-mkconfig -o /boot/grub2/grub.cfg as dejank suggested, and with grub2-mkconfig --output=/boot/grub2/grub.cfg as ondoho suggested (still in root mode), but none worked.
Do you have any reason why?
Thanks for both of you in advance!
 
Old 05-19-2017, 02:47 PM   #11
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
Oh, wait, do you perhaps have UEFI install? I guess that could be reason. In case of UEFI install, it is located differently. Try looking for grub.cfg file here:

/boot/efi/EFI/fedora/grub.cfg

In which case you should run, again with root privs:

grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
 
Old 05-20-2017, 01:23 AM   #12
IamIdan
LQ Newbie
 
Registered: May 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dejank View Post
Oh, wait, do you perhaps have UEFI install? I guess that could be reason. In case of UEFI install, it is located differently. Try looking for grub.cfg file here:

/boot/efi/EFI/fedora/grub.cfg

In which case you should run, again with root privs:

grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
Thank you! it is working
 
Old 05-20-2017, 01:57 AM   #13
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
Kinda late to the party, but grub2-set-default script makes it rather easy to change the default boot in fedora 25.
 
3 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How To Change Boot Order/Set Default Boot OS In Ubuntu 14.10/15.04 / Linux Mint Or Other Deriv LXer Syndicated Linux News 0 08-30-2015 04:31 PM
change boot order kottana.swarnakumar Linux - Newbie 2 04-14-2009 06:26 AM
Have to change boot order in BIOS to boot ubuntu/winxp Minn3h Linux - Software 7 04-01-2006 05:17 PM
how to change boot order Boomba Linux - Newbie 2 01-23-2004 07:33 AM
Change boot order? panicboy Linux - Software 6 01-21-2004 05:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 12:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration