LinuxQuestions.org
Visit Jeremy's Blog.
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 08-06-2007, 06:01 AM   #1
Steve W
Member
 
Registered: Mar 2007
Distribution: Ubuntu 12.04, Mint 12 LXDE
Posts: 431

Rep: Reputation: 36
Tidying up my boot menu


My first act as a new Linux user was to buy a "Starting Linux" book, which contained an install CD for Ubuntu. I installed this, but it crashed halfway through. I re-installed, but on my boot menu I was then left with the correct installation of Ubuntu, plus an entry for the one that aborted, plus my old Windows XP. Hmm. Now I have upgraded to the latest Ubuntu "Feisty Fawn", I have an increasing boot menu, with three Ubuntu distros and Windows XP! Each Ubuntu entry has three items, for normal boot, safe boot and memory checker thing.

Can I tidy this up just by editing grub/menu.lst as root? I have viewed this file, but not changed anything. Is it as easy as deleting the unwanted sections and just saving it off, or do I need to do anything else?

Also, if I wanted to take my old Ubuntu version off my computer, is there an "Uninstall option", or do I just reformat the partition it is on to free up the space?

Steve Wylie
Canterbury, Kent
United Kingdom
 
Old 08-06-2007, 06:19 AM   #2
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
A simple format will do but you need to make sure that your current GRUb belongs to your newer Ubuntu, not to the older one (you'd end up with a broken GRUB otherwise). And yes, you can simply remove the entries from menu.lst.
 
Old 08-06-2007, 07:07 AM   #3
Steve W
Member
 
Registered: Mar 2007
Distribution: Ubuntu 12.04, Mint 12 LXDE
Posts: 431

Original Poster
Rep: Reputation: 36
Thanks for that. Removing the old version itself should be a piece of cake if I can just reformat its partition and that's that. The one I want to remove is installed on hdb1, but my new one is on hda2.

But how can I tell which GRUB is being used in the booting process? Do I assume the menu.lst I am editing is the one in the "new version" partition?

This is exactly the reason that I am being very careful. One wrong move here and I won't be able to boot up my PC with anything!
 
Old 08-06-2007, 07:13 AM   #4
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Well, you do seem to be using the GRUB from you newer install. The older one would't automatically add an entry for the newer OS. But if you want to play sure, you can carry out a little experiment. Just open menu.lst on your newer install and put in a random string, such as
title An Experiment
If you boot up again and you see that line listed in GRUB, you can be perfectly sure that it really is the one from your latest install. Of course, that specific line hasn't any other use so get rid of it again while you're doing your cleaning up.

Last edited by jay73; 08-06-2007 at 07:36 AM.
 
Old 08-06-2007, 07:34 AM   #5
Steve W
Member
 
Registered: Mar 2007
Distribution: Ubuntu 12.04, Mint 12 LXDE
Posts: 431

Original Poster
Rep: Reputation: 36
Thanks again. I'll give it a go when I get home tonight. Cheers.
 
Old 08-06-2007, 08:07 AM   #6
IndyGunFreak
Senior Member
 
Registered: Aug 2003
Location: Indpls
Distribution: Desktop- Debian Lenny, Laptops- Ubuntu 8.10, Debian Lenny UMPC- Ubuntu 8.10
Posts: 1,297

Rep: Reputation: 55
I personally would never "REMOVE" entries from Grub. I just don't think its good practice. If there's ever a problem with a new kernel, unless you're far more advanced than I am, trying to remember how to manually re-enter the info to boot your old kernel, would be a nightmare. Instead, simply comment them out with the # sign. Put a # sign in front of "Title" and it will no longer appear in your grub list when you boot. In the event of a kernel related problem, boot to recovery mode, and simply use nano to edit your grub list, and remove the pound sign.

I've never had to do the above, but as I've installed and broken several Linux OS's, the above makes sense to me.

YMMV

IGF
 
Old 08-06-2007, 08:35 AM   #7
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Oh, I wouldn't worry about that. I keep adding and removing stuff to my GRUB and nothing bad has happened so far. Of course, you need to be careful. Don't remove any entries you still need; and if you think you accidentally touched one of your keepers, just close the editor without saving anything and start over. But it's true that the use of commenting is more failsafe - only it gets pretty messy when you reach kernel number ten or so.
 
Old 08-07-2007, 03:21 AM   #8
Steve W
Member
 
Registered: Mar 2007
Distribution: Ubuntu 12.04, Mint 12 LXDE
Posts: 431

Original Poster
Rep: Reputation: 36
Jay73: in the event, I did take IndyGunFreak's suggestion and commented out the Title line of each unwanted entry rather than deleting it. Good job too, to an extent, because once I'd done it and only had Ubuntu as the first boot item (followed by its two 'safe' modes), plus Windows XP, when I tried to boot into Windows XP my PC refused saying "Partition does not exist". I got Windows back by removing the # sign in the Title of the (unwanted) item just after the Windows entry in menu.lst. I'm wondering if it did this because of the last line in the Windows bit, that says "Chainloader +1". If I commented out this last line, would that fix the problem and allow Windows to boot without needing to have an entry below it, or would that cause untold problems and not allow anything to boot?

Please advise. Thanks for all your help so far.
 
Old 08-07-2007, 03:26 AM   #9
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
No, the point is you should have commented ALL of it, not only the title but the vmlinuz and initrd lines as well. Think about it. A hash in front of a line means "skip this line". So GRUB skips the line but it still reads in the following lines. Why? Because the "title" line tells GRUB where a new entry starts and it doesn't find it anymore because it was commented. Consequence: it not only reads the windows boot entry but also the remaining bits of the following entry. Just try it, comment all of the lines of the Linux entry following windows and it should work.

Note: don't touch the chainloader.

Last edited by jay73; 08-07-2007 at 03:28 AM.
 
Old 08-07-2007, 03:41 AM   #10
Steve W
Member
 
Registered: Mar 2007
Distribution: Ubuntu 12.04, Mint 12 LXDE
Posts: 431

Original Poster
Rep: Reputation: 36
Ah right. That explains that. Thanks again!

Steve
 
  


Reply

Tags
grub, menulst, old, partition, remove, uninstall, version


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
How to set the default boot operating system at the boot menu Niceman2005 Linux - General 2 04-12-2006 09:46 PM
Fresh Install Of Distr From Network - Boot Menu, Need to pull up a menu of OS dist to SupermanInNY Linux - Distributions 0 01-22-2006 11:48 AM
Dual Boot : Making Windows First Option in boot menu Maxwell Rain Linux - Software 3 11-27-2004 03:00 PM
About boot menu on a dual boot sys Gethyn Linux - Newbie 4 10-15-2004 11:30 AM
Grub boot loader menu shows two linux boot options pramos Linux - Newbie 3 09-12-2004 11:40 PM


All times are GMT -5. The time now is 11:05 AM.

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