Linux - NewbieThis 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!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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
Code:
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
Code:
GRUB_DEFAULT=3
#GRUB_DEFAULT='Debian GNU/Linux, with Linux 3.10-3-amd64'
#GRUB_DEFAULT='gnulinux-3.10-3-amd64-advanced-12345678-1234-1234-1234-0123456789abcdef'
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.