Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-21-2013, 10:26 AM   #1
Registered: Jan 2013
Location: New Jersey
Distribution: CentOS, Arch
Posts: 179

Rep: Reputation: Disabled
editing grub menu

I am currently sitting watching my laptop do a win 7 sp1 and this is brutal, but when it restarts I have to manually choose win 7. And I actually missed it twice. I didn't think it was gonna restart at 30% configured. I need to set win 7 as default so I never have to do this again

Anyway, as long as I cut and paste menuentry and all the correct braces and such I should be able to switch it without error, right?

I'm in fedora 18. It says in grub.cfg "do not edit this file" , is that just a warning to scare or should I edit the list file instead?
Old 09-21-2013, 11:43 AM   #2
LQ Addict
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Try this
Old 09-21-2013, 11:51 AM   #3
Senior Member
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,283

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
No. You need to boot into Fedora and edit /etc/default/grub.

There will be a line there that says "GRUB_DEFAULT=0" (your particular default may or may not be "0", but probably so). A default of "0" means to boot the first menu entry. If you want to boot, for example, the 3rd menu entry by default, change the line to "GRUB_DEFAULT=2" I do not know which menu entry your Windows 7 would be, but you can determine that on your own and edit the grub file as needed.

While you're at it editing that file, you can also look for an entry "GRUB_TIMEOUT=5". Again, I have no idea what your default timeout may be set at. But you can change this number to the number of seconds you want grub to wait on the menu choice screen before continuing on to boot the default OS.

YOU'RE NOT DONE YET. After you edit the above file, you must run "update-grub". This will take the changes you made to /etc/default/grub and roll them into that grub.cfg file that you were warned not to manually edit.

Now you can reboot.

Last edited by haertig; 09-21-2013 at 11:52 AM.
Old 09-21-2013, 12:09 PM   #4
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,030
Blog Entries: 1

Rep: Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852
You can update the file. Just be aware that it will get updated and your changes overwritten. Various distros have various persistent ways to modify the grub.cfg. In debian a lot of variables are set in /etc/default/grub, but there's always a chance that file will get updated too. The GRUB_DEFAULT variable is supposed to be what's used to set the default. According to grub-set-default, it can be a number, or either of the two text strings that might be with that menu entry.

for me from: /boot/grub/grub.cfg
menuentry 'Debian GNU/Linux, with Linux 3.10-3-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.10-3-amd64-advanced-12345678-1234-1234-1234-0123456789abcdef' {
so in: /etc/default/grub
#GRUB_DEFAULT='Debian GNU/Linux, with Linux 3.10-3-amd64'
According to the script GRUB_DEFAULT is supposed to be user defined. But the /etc/default/grub does not "check" for a predefined GRUB_DEFAULT, so that always overrides it on my system. If you update the /etc/default/grub file, you need to run update-grub to update the /boot/grub/grub.cfg file. And future updates that don't update /etc/default/grub should grab that change. YMMV
Old 09-21-2013, 09:47 PM   #5
Registered: Dec 2007
Location: Alabama USA
Distribution: Slackware current
Posts: 303

Rep: Reputation: 53
Is there not a package similar to this one for Ubuntu for your distro? It makes it super easy to
change anything you like.

Grub Customizer


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
Editing GRUB/menu.lst to multi-boot with separate hard drives Birdman48 Linux - Hardware 3 03-13-2012 09:12 PM
[SOLVED] GRUB 2 Menu Editing, something is not right here feeblebrain Debian 20 08-18-2011 11:47 PM
editing menu.lst in puppy grub tigertim71 Puppy 13 08-17-2009 06:01 PM
Problem editing /boot/grub/menu.lst baldur2630 Linux - Server 10 10-03-2008 12:12 PM
Editing /boot/grub menu.lst OpenSUSE 10.2 ceeleelewis Linux - Newbie 7 03-16-2007 09:05 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:49 PM.

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