LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-31-2012, 06:38 PM   #1
newmanium2001
LQ Newbie
 
Registered: Apr 2009
Posts: 14

Rep: Reputation: 0
Editing Default GRUB2 Boot Entry from Windows


So, like many users I'm sure, I still have to dual boot Windows 7 for some must-have applications that aren't available on Linux. I'm running Fedora 16 for my Linux distro and it's recently been changed to GRUB2 (GRUB 1.99 to be exact).

What I used to be able do in my dual boot setup was to edit the grub.conf in the /boot file system that I mounted from Windows. More specifically, I had my /boot file system formatted ext2 so I could mount it in Windows, then edit the default= entry from a Windows RDP session and boot back up into Fedora when I was done with Windows.

Now, with GRUB2, the only way I see to edit the default boot entry is to use grub2-set-default. Obviously, this command isn't available from Windows. I also can't seem to make sense of the grub2.cfg file. I don't see any sort of "default" entry that I would be used to in the old grub.conf. I also know you're not "supposed" to edit that file directly, but I'd be willing to edit it and lose my changes just for that one time I needed to boot back up into Windows.

Any ideas on how I could manually edit a file in the /boot file system in order to change my default menuentry?

Thanks!

Last edited by newmanium2001; 03-31-2012 at 06:38 PM. Reason: Spelling...
 
Old 03-31-2012, 08:11 PM   #2
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,639

Rep: Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727
If all you want to do is to change the default boot entry in Grub2, you just need to edit the /etc/default/grub file. The beginning of that file is shown below:

Quote:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
There are also files in /etc/grub.d where you can make changes. I have Ubuntu 10.10 installed and at the top of the /boot/grub/grub.cf file is this line:

Quote:
set default="0"
That boots the first menuentry so you could count down to whichever entry to put the number you want, counting from zero. My experience with editing grub.cfg is that if I run update-grub after editing it and don't have the changes in one of the other grub files in /etc, the changes disappear.

I'm not really clear on your situation. If you have windows and Fedora, why don't you just boot Fedora and make the changes? Are you not able to boot Fedora?
 
1 members found this post helpful.
Old 04-01-2012, 11:25 AM   #3
newmanium2001
LQ Newbie
 
Registered: Apr 2009
Posts: 14

Original Poster
Rep: Reputation: 0
So to clarify the situation:

If I'm booted to Windows and my default menuentry is Windows, there's no way for me to boot up to Fedora when I'm remote. I would have to be physically present in front of the machine to stop GRUB and boot to Fedora. The other option is to edit some file from my /boot file system to make it boot up to Fedora automatically after I issue the reboot.

The reason it has to be in /boot is because, as far as I know, there's still no way to mount ext4 in Windows. My / file system and everything else is ext4, but /boot is ext2 so I can access it in Windows (I use Ext2Fsd btw).

Given this situation, your suggestion of editing the file in /etc/default is probably off the table.

I did come up with a solution I think. The "set default" line in /boot/grub2/grub.cfg was looking so foreign to me because it was set to this:

set default="${saved_entry}"

Which was because my /etc/default/grub was set to "saved" instead of a # for a menuentry. I can set default to 0 or 2 from Windows to boot back up into Fedora. I guess I was looking for /boot/grub2/grub.cfg the whole time, but that line being set to a var kind of threw me off.

Thanks for the suggestions. Problem solved!
 
  


Reply

Tags
grub 2, windows7


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Help me remove broken Grub2 Windows entry. Lumify Linux - Newbie 3 02-15-2012 05:33 AM
LXer: Windows entry disappeared in Grub2 menu LXer Syndicated Linux News 0 10-19-2011 01:01 AM
[SOLVED] Editing the grub2 boot menu in a dual boot machine Chriscrof Linux - Newbie 13 07-15-2010 01:14 AM
Editing grub.conf to make Windows default in dual boot pssmba Linux - Newbie 4 04-04-2010 05:54 AM
How do I need to format grub entry to boot from grub2 into grub legacy? mitchell7man Linux - Software 6 04-03-2010 03:03 AM


All times are GMT -5. The time now is 05:23 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration