[SOLVED] Editing the grub2 boot menu in a dual boot machine
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.
Editing the grub2 boot menu in a dual boot machine
I would be grateful if someone would help with this:
I have a dual boot machine that is running Windows XP and Ubuntu 10.04. It was previously Win XP/Ubuntu 9.10, but for various reasons I did a 'clean' install of Ubuntu 10.04 and having done so I ended up with a machine that was unbootable unless I "jumped through a lot of hoops".
I used the Windows 'fixmbr' facility and am now able to boot it either into Windows or Ubuntu. However, I want the boot menu to default to Windows like it did before, instead of to Ubuntu because someone else uses the machine.
The literature says that grub.cfg cannot be edited but that it can be modified by the addition of a file called /etc/grub.d/40_custom into which one can copy parts of 'menu.lst'
What exactly must I put into this file to make the boot menu default to Windows? I am beginning to think it might be easier to install Ubuntu 9.04, edit menu.lst and then upgrade to 10.04. I have another machine which is also dual boot and which I upgraded to 10.04 and didn't have any problems at all afterwards.
I should mention that Ubuntu and Windows are on separate hard drives
Thanks, yooy. I followed the link but I haven't got the files to edit that are mentioned in that answer. I think the link must be referring to grub 1 but I have grub2.
I am still digesting the item in your link, avee137. Thanks for your trouble. I will let you know what happens
Use the "grub2" link in that article. Takes you to a very good overview. Describes exactly what you need - don't forget the update-grub afterwards.
Looks like a GUI is available for these sort of updates now - haven't looked at it.
Hi, if anyone is interested, I set the default OS to Windows by editing /etc/default/grub and changing 0 to 6 in the line "Grub default" and then using the command 'update-grub'. However, I now have another problem - a situation rather than a problem. Update manager has installed a new version of the Linux kernel so that I now have both the previous kernel and the latest one showing in the boot menu. While it is not a problem in itself I would like to remove the entries relating to the previous kernel so the the boot menu does not get longer and longer with every new release of the kernel. Anyone know how to do this? It is grub2 that I have so it is not a question of editing menu.lst as there isn't a menu.lst and deleting the unwanted lines.
Thanks for the information, grail. I have just one more question: in my /boot folder there are two sets of four files. One set ends in -2.6.32-21-generic and the other ends in -2.6.32-22-generic. The four files in each set are abi- config- system.map- and vmlinuz-. Should I delete all four files in the set ending with 2.6.32-21?
This is probably a very naive question but grub2 seems to have very steep learning curve especially when one is not a programmer
Hi, thank you all for your help it was greatly appreciated. Everything is now resolved so with help like that it won't be long before I'll be able to wipe Windows from my hard disc!
I have a similar problem which I am living with - due to lack of programming skills. The above exchanges give a reasonably good idea, but there are gaps which I am not able to understand.
It would be a extremely helpful if you can give a step by stem approach on this - from problem to resolution.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.