LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Tidying up my boot menu (http://www.linuxquestions.org/questions/linux-newbie-8/tidying-up-my-boot-menu-575051/)

Steve W 08-06-2007 06:01 AM

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

jay73 08-06-2007 06:19 AM

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.

Steve W 08-06-2007 07:07 AM

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!

jay73 08-06-2007 07:13 AM

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.

Steve W 08-06-2007 07:34 AM

Thanks again. I'll give it a go when I get home tonight. Cheers.

IndyGunFreak 08-06-2007 08:07 AM

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

jay73 08-06-2007 08:35 AM

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.

Steve W 08-07-2007 03:21 AM

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.

jay73 08-07-2007 03:26 AM

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.

Steve W 08-07-2007 03:41 AM

Ah right. That explains that. Thanks again!

Steve


All times are GMT -5. The time now is 03:52 PM.