LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 05-18-2010, 04:39 AM   #1
Chriscrof
Member
 
Registered: Jul 2008
Location: France and UK
Distribution: 10.10
Posts: 86

Rep: Reputation: 15
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
 
Old 05-18-2010, 06:04 AM   #2
yooy
Senior Member
 
Registered: Dec 2009
Posts: 1,387

Rep: Reputation: 174Reputation: 174
If i understood you well you want to change default boot OS in grub. (windows appears in your grub)

here is how:
http://www.linuxforums.org/forum/mis...b-default.html

else maybe this will help:
http://www.fedoraforum.org/forum/sho...=&threadid=996
 
Old 05-18-2010, 08:09 AM   #3
avee137
Member
 
Registered: Apr 2010
Location: bangalore,india
Distribution: ubuntu 9.10,CentOS 5
Posts: 120

Rep: Reputation: 16
If you have a live cd,you can try this.worked fine for me:
https://help.ubuntu.com/community/Re...tallingWindows
 
Old 05-18-2010, 03:03 PM   #4
Chriscrof
Member
 
Registered: Jul 2008
Location: France and UK
Distribution: 10.10
Posts: 86

Original Poster
Rep: Reputation: 15
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
 
Old 05-18-2010, 04:58 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
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.
 
Old 05-19-2010, 07:53 AM   #6
Chriscrof
Member
 
Registered: Jul 2008
Location: France and UK
Distribution: 10.10
Posts: 86

Original Poster
Rep: Reputation: 15
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.
 
Old 05-19-2010, 08:32 AM   #7
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
If you remove the kernel and other related files from /boot and then refresh the config for grub this issue will be resolved.
 
Old 05-20-2010, 01:48 PM   #8
Chriscrof
Member
 
Registered: Jul 2008
Location: France and UK
Distribution: 10.10
Posts: 86

Original Poster
Rep: Reputation: 15
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
 
Old 05-20-2010, 06:50 PM   #9
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
Correct that all files with the same kernel version numbering should be removed
 
Old 05-20-2010, 08:21 PM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,130

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Better to remove them from Synaptic - this deletes all dependent files and updates. Updates the grub automagically.
 
Old 05-20-2010, 08:35 PM   #11
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
syg00 is correct, my bad didn't look at which distro
 
Old 05-21-2010, 01:41 PM   #12
Chriscrof
Member
 
Registered: Jul 2008
Location: France and UK
Distribution: 10.10
Posts: 86

Original Poster
Rep: Reputation: 15
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!
 
Old 05-21-2010, 02:00 PM   #13
vigi
Member
 
Registered: May 2009
Location: australia
Distribution: slackware
Posts: 187

Rep: Reputation: 30
Another way may be to rename or move the unused kernel files, and run update-grub (so you still have a backup kernel).
 
Old 07-15-2010, 01:14 AM   #14
cr4321
Member
 
Registered: Aug 2009
Posts: 41

Rep: Reputation: 15
Hi Chriscrof and others,

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.

Hope to gain some experience by that!

Best wishes.

cr4321
 
  


Reply



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
GRUB2 - FreeBSD-8.0 does not show up in triple boot menu, dual boot menu it does.. wiliweld *BSD 7 05-03-2010 01:05 PM
LXer: So HERE'S how you get into grub2 if there's no boot menu in Ubuntu Lucid 10.04 LXer Syndicated Linux News 0 03-23-2010 02:20 PM
Creating a Grub2 boot-cd with a (grub.cfg) menu ..my solution ssenuta Linux - General 3 02-04-2010 06:16 PM
Defunct WinXP in Ubuntu boot menu after upgrading from a dual-boot xph Linux - Newbie 4 12-27-2009 10:48 AM
Problems with dual boot, grub2 auto os prober mhbell Ubuntu 2 11-04-2009 10:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:18 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration