The officially official Devuan Forum!

You are not logged in.

#1 2017-01-28 17:02:52

pedropt
Member
Registered: 2017-01-27
Posts: 11  

How to set Grub default startup in dual boot for Windows

This case happens all the time with everyone that have windows OS installed on their computer , but then install a linux OS and grub by default sets the linux OS by default start up .
To change the default boot order in Grub all that must be done are these steps :

This is my default grub order , and as you can see , Devuan Linux will start if i do not select my windows OS .
On this next image i added a few text to teach you how to interpret the default boot .
Entry 0 (witch is on grub.cfg file) is devuan , but as you can see , i have my windows XP on entry 6 .
grubdefault.jpg

So , all you have to do is edit in your devuan linux the file grub.cfg , and that you can you any text editor in devuan , i will use nano editor .

nano /etc/default/grub

grub.png

As you can see in last image , i changed the line that was :
GRUB_DEFAULT=0  -> GRUB_DEFAULT=6  , because in my case , my windows XP was on entry 6 .
If my xp was ex: entry 4 , then then instead using 6 i would use 4 .

Save the changes in your grub file  .

Open your terminal and write the command "update-grub" to apply the changes
grub2.png

Here it is how it looks after the changes were made :
grub_changed.jpg

and this is my windows XP starting up :

windows_startup.jpg

Last edited by pedropt (2017-01-30 23:39:02)

Offline

#2 2017-01-30 22:24:01

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,486  

Re: How to set Grub default startup in dual boot for Windows

Instead of editing grub.cfg, you should edit /etc/default/grub and change the first item:

GRUB_DEFAULT=6

and then you must run update-grub to apply any changes you made. Then grub.cfg will be automatically edited the way you want.

BTW, entries 7 and 8 get you some geek points, and you get extra points if those things really boot. (Now I can't get that brick wall out of my head.)

Offline

#3 2017-01-30 23:21:36

pedropt
Member
Registered: 2017-01-27
Posts: 11  

Re: How to set Grub default startup in dual boot for Windows

correct wink , changing .

entrys 7 and 8 exist here because i had in the past windows installed in those partitions that gave me some problem , and i had data on those partitions that i did not wanted to format , so i installed new windows in a different drive and deleted the windows folder on that problematic OS , but i never remember to remove the boot files ntldr and msdos.sys and etc ...
Well , i did not had here much time to deal with that issue , and after all is not disturbing me at all , grub detected those drives and created the links to boot , but in reality those options do not boot , ehehehehe .
I will deal with that when i get some time here "if i remember it".
Thanks for the info on grub .

Last edited by pedropt (2017-01-30 23:30:37)

Offline

#4 2017-02-02 08:11:20

thrasymachus
Member
Registered: 2017-01-28
Posts: 1  

Re: How to set Grub default startup in dual boot for Windows

your initial instructions were to edit a file (grub.cfg) that says, right at the top, "DO NOT EDIT THIS FILE"
posting bad info about grub is really a dangerous thing to do

Offline

#5 2017-02-02 10:48:42

pedropt
Member
Registered: 2017-01-27
Posts: 11  

Re: How to set Grub default startup in dual boot for Windows

your initial instructions were to edit a file (grub.cfg) that says, right at the top, "DO NOT EDIT THIS FILE"
posting bad info about grub is really a dangerous thing to do

It is only "dangerous" if you edit something outside the values i said in topic .
And there is not dangerous thing editing the grub.cfg file like i told before , because my first edit would make a temporary boot order sequence until command "update-grub" is applied on terminal by user or by any software automatically .
Example :
Imagine that you edited the file grub.cfg , and grub is now booting automatically to windows , but you go to linux and you install your graphic card proprietary drivers from a nvidia or ati file  .
What would happen , is after the new graphic driver is installed , the nvidia or ati tool will do the command "update-initramfs -u" and "update-grub" , to insert the driver in the boot of the linux .
After that happen , your boot order will return automatically to the default order , witch is linux first .
Now , by changing /etc/default/grub file , that will not happen , because grub will pick the default configuration from this initial file , witch was setup up to keep windows as a primary OS boot target .

Note
IF you edit like i told , then there is no problem at all .
But if you start to change things by yourself without any knowledge , then that is dangerous.
And by the way , every file of linux is dangerous wink

VERY IMPORTANT!!!
I created this topic mostly for those people that do not know what is linux , but have listen about it on the web , want to try it ,  but are mad because everytime they start the computer it goes directly to linux and they wanted to go to windows to play his favorite game and to those people that have only one computer in home , and the father and mother barely knows windows because they only go to facebook , while the son loves linux , but everytime the father and mother starts the computer they get pissed because it goes directly to linux and they don`t know how to use it . So , after the son edit the file , next time his father and mother starts up the computer , it will go directly to their favorite OS , witch by the way is the most vulnerable OS on the internet and where anyone with a bit of knowledge can hack to it using linux and grab personal data from those persons that use it wink

*Edited

Last edited by pedropt (2017-02-02 17:09:50)

Offline

#6 2017-02-02 15:21:57

golinux
Administrator
Registered: 2016-11-25
Posts: 3,318  

Re: How to set Grub default startup in dual boot for Windows

@pedropt . . . Could you please use quote instead of code tags when appropriate as in above post.  Thanks.

Offline

Board footer