Logo 
Search:

Unix / Linux / Ubuntu Forum

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds

Editing Grub2 in a dual boot system with more than one Ubuntu

  Date: Jan 11    Category: Unix / Linux / Ubuntu    Views: 593
  

In the process of reconfiguring my setup, and I've rigged one machine to
have (the regrettably still necessary) Windows, and Maverick, Kubuntu
(Maverick) and Natty all bootable.

I'd like to edit the grub menu because it's not entirely clear which is
which, and there's stuff I never use anyway. Now I'm wondering whether
it makes a difference which installation I use to change the menu.
Anybody know?

(Editing it seems a rather more involved process than it used to be.
I've already screwed up once and only recovered by reinstalling one of
the OSs. I have a suspicion that my habit of using dpkg get-selections
and set-selections options to restore all my apps may have interfered
with grub - it prompted me for a Y/N to do with grub, which I didn't
understand at the time and can't remember now).

Share: 

 

16 Answers Found

 
Answer #1    Answered On: Jan 11    

Give this tutrial a gander. It's pretty comprehensive and I've referenced it
on several installs, mainly to change the default boot system and countdown
time.

http://ubuntuforums.org/showthread.php?t=1195275

What's funny (side note here) is that I couldn't find this searching
directly on the Ubuntu Forums website but it came up as the #1 Google
search.

 
Answer #2    Answered On: Jan 11    

Yes, it makes a difference, depending on how you do it. There are two
versions of grub, legacy (old) and grub2. Grub legacy lends itself well
to using a text editor. Grub2 can also be editted with a text editor,
but it is more complicated because you are not encouraged to do it this
way, and it is not permanent. An update to the kernel for exam ple will
re-write the grub.conf file and it will not include your manual
editting. So if you are just text editting then it does not make much
difference.

However, if you using grub2 and are doing it properly then it does make
a difference as it will generate a new grub.conf and it will be very
different from just a text edit. It will be re-built and be completely
different depending on the distribution. For starters the default
distribution will change and depending on the distribution it will do
things differently. For example Fedora seems to ignore anything but
Fedora. Mandriva and a few others only include that distribution and
then allow you to manually add separte grub entries. Finally some
distributions will use grub legacy while others will use grub2 and even
lilo. I have found so distributions are very accurate and others are
very poor, and even mess up drive order and names.

Ubuntu is about complete and well rounded compared to many
distributions. It detects all operating systems and makes an entry that
actually works. I would use it and depending on your setup, I would
favour generating a new grub.conf from scratch over just text editting,
unless you ahve good reasons for not doing it this way, for example
removing references to kernels that you don't plan on using. It would be
better to actually remove the kernel though using grub and then it will
change grub automatically.

I wonder why you would choose to have two instances of Maverick, one for
Ubuntu and one for Kubuntu instead of running them from the same grub
entry and changing it a login which is the way that I do it. I just boot
Ubuntu and change to KDE, LXDE, XFCE or GNOME from the session menu.
They all run from the same partition. I would only have separate grub
entries if I was using a different version, let's say one was Maverick
and the other Lucid. Just curious. :)

(I know that you are not using other distributions, but some people are,
so I included my thoughts on those.)

 
Answer #3    Answered On: Jan 11    

Point taken about others using other distros, Roy. My own main concern
was whether the various different Ubuntus would make a difference. Since
presumably the /etc and /boot folders are in completely different
partitions for the different installations?

I've just managed to do most of what I wanted, using a gui front-end
called grub-customizer
(ubuntuforums.org/showthread.php)
and running from the Natty installation (which was the latest one I'd
installed).

As for Kubuntu: I had thought that it was more than just the desktop
environment that varies between them, and I wanted the "full" Kubuntu
experience (since you're so enthusiastic about it :-) If as you imply
it's essentially just KDE then I could free up another 20G - at the cost
of doing another complete wipedown (when I've tried to adjust partition
sizes before I was unable to join up the freed spaces).

A related question (but should we start a new thread?): when I tried to
install Kubuntu to use my separate /home partition (and I believe you've
said since then that you shouldn't do that) it wouldn't start - got as
far as the login screen but then won't accept the login. However my
Natty installation has picked up all my /home docs and settings - I
think I inadvertently set it to mount /home though I had intended not
to. It looks like separate installations of Ubuntu versions /can/ use
the same /home, whereas different distros, even when it's just Kubuntu
vs Ubuntu, can't. Is that right? (Obviously if I just switch between KDE
and GNOME that wouldn't be a problem.)

Oh! (Lightbulb!) - That's why my attempt to try Fedora didn't get very
far. Maybe that would be a better way to use the freed 20GB.

 
Answer #4    Answered On: Jan 11    

Before the desktop environment is loaded. it is the same, including package
management, etc. What is different is kdm vs gdm, but when you install both
it asks you which one to use. I have gone both ways and don't honestly
prefer one over the other. If you use XFCE as well then go with gdm. Having
more than one desktop on the same system is advantageous. If there is a
problem with one then you can just load the other, fix it and log out. I
also like the change. I am GNOME at the moment, but have been in KDE for the
past couple of weeks. I like GNOME,but prefer KDE. Sometimes in GNOME I will
use Dolphin as I prefer it for file management, but occasionally I will use
Nautilus in KDE because it works differently and I want a feature.

The big differences between Ubuntu and Kubuntu are they way they are
developed. Kubuntu is developed on the Canonical base, but the project has
less interference. Most of the developers are from KDE and not Canonical. It
is the opposite with Ubuntu which is Canonical's flagship and there is now
much strain due to Canonical stepping away from GNOME. The strain has been
around for some time and the move to Unity ices it. They use to same kernel,
installer (Ubiquity), modules, headers, graphics drivers and plymouth. Then
either gdm or kdm is loaded and you get X. Then you can choose any installed
desktop environment. fromt he session manager

I have run just Kubuntu and just Ubuntu, and had them both together and
cannot tell the difference. So if you have the time, install KDE in your
Ubuntu or vice versa, then import your files and settings. Then you can
delete the partition and free up the space. No matter how big your drives
you can always use the space and you simplify the boot process and gain the
advantage of having an alternate desktop without rebooting.

 
Answer #5    Answered On: Jan 11    

You just open the Terminal via Applications/Accessories and type in

sudo gedit /boot/grub/menu.lst

Do Not alter anything in between the # # marks

The entires can be deleted or entered and instructions are there between
those

 
Answer #6    Answered On: Jan 11    

Just tried the below, nothing there to edit. I am using 10.04
dual boot system. It is my understanding that menu.lst went
away in grub2. Replaced by grub.cfg which is reproduced upon
change.

 
Answer #7    Answered On: Jan 11    

but that's no longer the case.

Grub 2, which has taken over from Grub in the last two or three releases (can't
remember exactly when) is more sophisticated, and hence rather more complicated.
There is no longer a /boot/grub/menu.lst. It's replaced by grub.conf*, but that
isn't intended to be edited, and will be overwritten by the system at the next
install. Instead there are a set of executable text files, one for each
installed OS, and a few others too. These can be edited, and then you run
update-grub* to implement the changes.

There are one or two front-ends to simplify the process. Startup-manager* only
really works with the original Grub, but Grub-customizer (in the repository
referenced by ppa:danielrichter2007/grub-customizer ) has handled Grub2 for me
fairly well (colours haven't worked but I've set the default and removed the
clutter).

* I'm working from memory and can't guarantee I remembered the names right

Actually, whether Grub or Grub2, I don't think anyone's completely answered my
question, which is: does it matter in a multi-ubuntu multi-boot set-up, which
installation you use to edit Grub. I think from my own experience that it
probably doesn't, although I don't really understand why.

 
Answer #8    Answered On: Jan 11    

I do not mean before update I mean at
anytime and I know it was Grub 1/ Grub 2 and you can edit the Grub the
way I said but as I pointed out in the later message it is different in
later versions

Go here to read it up.

https://help.ubuntu.com/community/Grub2

 
Answer #9    Answered On: Jan 11    

You are both right. You CAN edit grub.conf manually, but it is not the best
method because if you update the kernel it will overwrite your manual
editting so it is wasted effort. A better method is to have Ubuntu
update-grub. If your purpose is to remove older kernels then you should use
apt/Synaptic to do that first. After doing this it will automatically edit
grub. If you want to change a settings such as the time the that grub is
displayed or change the default OS then there are utilities for that. If you
are old school then you can edit grub.conf, so long as you know that your
changes can be undone and you may have to repeat your work.

The trend in Ubuntu is to move away from old school and dumb things down.
For people with the skills they can always work around this using the
commandline and tried and true methods. As Steve pointed out grub2 is quite
a bit more complex. It supposedly loads faster and that is the name of the
game when many distros spend inordinate time and effort to shave a second
off boot time and sites such as Phoronix compare distro boots head to head.
Editting grub manually is not something people should do unless they have
the skills. One mis-type and you can be in for a big headache. That is why
it is recommended to leave it up to the system to manage it. However, for
those who like to live on the edge there is nothing to stop you.

The forums are full of horror stories of things that can go wrong. People
need to know the consequences of their actions if they make a mistake. So it
should be done with caution. When you edit grub manually if all goes well
then you are ahead of the curve. When things go wrong you may have to use
the Live CD to undo the damage. Experienced users are not put off by this,
but newbies are.

 
Answer #10    Answered On: Jan 11    

The purpose of editing grub for me is to cut down the entries on duel
boot computers.

Of course you do it with caution like anything you do on a computer but
I also edit the boot sequence on MS computers.

 
Answer #11    Answered On: Jan 11    

I have heard that I can remove unused versions of Ubuntu with Synaptic
Package Manager. I can't seem to find a way to do this, anyone done it
and can give me a guide. Then after the removal do I have to do an update-
grub command. I am using 10.04 and have gone through several updates
which have put in a lot new kernels.

 
Answer #12    Answered On: Jan 11    

Yes, you search (not quick search) in Synaptic for kernel. (You can also do
by looking in Status, Installed and quick seach for linux). Then scroll down
to the L section for linux, look for linux-image and then the linux-image
files with the same version number. The linux kernels that are installed
have green boxes. You can remove old kernels by right clicking and choose
Mark for Removal. Then Apply.

You can also do this safely using Ailurus which is like Ubuntu Tweak. Once
installed it has a section called Clean up and one of the things it does is
remove old kernels. This is easier and the utility has lots of bonuses.

Ailurus is available from Getdeb or from here:
https://launchpad.net/ailurus
http://code.google.com/p/ailurus/

 
Answer #13    Answered On: Jan 11    

I did the big search
opposed to the quick search for the Linux kernels. I am running on "Linux
2.6.32-26 generic", and have the same as listed in the splash screen during
boot, for (recovery mode). Then during the search all the way down to
"Linux 2.6.32-21 generic". My thoughts are that I should keep one or two
previous generics and remove the rest.
I did that, now only have the -25 and -26 listed in the search. I then
do the
update-grub and reboot. My splash screen during boot still shows all the
other
Linux generics as being available. I have not and don't want to try
bringing up
one of the older ones, but just trying to clean up the boot list. I
probably won't
have an issue but someone else might.
Just curious.

 
Answer #14    Answered On: Jan 11    

Check that you got both the linux-image and the header files. You should not
have to update-grub if the kernel modules are removed fully. It is part of
the removal process. If you open the terminal in the removing packages
window it will show you the complete process. I always have it open so I can
see what goes on behind the scenes, but by default it is hidden.

Failing this you can go with Ian's tried and true method. But that is only
cosmetic if the kernel packages are still on your computer. I am not sure
what else to say. I just removed two of my older kernels and it worked
fine.

 
Answer #15    Answered On: Jan 11    

I will check further, I do want and need to
play
with the Synaptic Manager more to really learn it.
I can live with what I have but I do want to learn how to remove items using
that tool if I can.

 
Answer #16    Answered On: Jan 11    

It about a clean boot and not a complicated on.

 




Tagged: