Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
03-01-2006, 08:34 AM
|
#1
|
Member
Registered: Oct 2005
Location: London
Distribution: elive e17
Posts: 152
Rep:
|
How do I install GRUB without having to install a new distro?
I have 3 distros on my HD and each time I have to reinstall one of them I have re-install Grub to the MBR.
I want to install another disto and to leave Grub on the MBR as it is.
Is there some way of modifying the MBR without having to do a whole re-install each time?
I know I can edit
/boot/grub/menu.lst file
but if I install a disto and tell it NOT to install grub I find that I can not boot into the new distro.
|
|
|
03-01-2006, 08:39 AM
|
#2
|
LQ Newbie
Registered: Feb 2006
Posts: 3
Rep:
|
With my Grub i can live edit the list of items so i can specify a new item with its partition where to boot. This should be a solution to not reinstall, but it is very manual.
|
|
|
03-01-2006, 08:55 AM
|
#3
|
Member
Registered: Dec 2005
Location: Edmonton
Distribution: BLFS, Gentoo
Posts: 353
Rep:
|
Quote:
but if I install a disto and tell it NOT to install grub I find that I can not boot into the new distro.
|
To the contrary, you can choose not install grub while (re)installing a (new) distro and simply edit the file menu.lst to include for the new installtion.
Supposing you've 4 distros - distro1, distro2, distro3 and distro4 with distro1 having installed GRUB to the MBR, edit the menu.lst file and include the lines for the other 3 distros and you should be able to boot them up. It is vital that you specify the correct partition, kernel name and initrd image for the all the other 3 distros.
|
|
|
03-01-2006, 12:50 PM
|
#4
|
Member
Registered: Oct 2005
Location: London
Distribution: elive e17
Posts: 152
Original Poster
Rep:
|
"It is vital that you specify the correct partition, kernel name and initrd image for the all the other 3 distros."
This is where I noramlly get stuck. I know the drives etc but the kernel name and initrd image I can never find, even if I boot up into one of the other distros.
I have 3 distros at the moment and they all work fine, I want to install another but if I bugger up grub then I have to go back and re-install one of the other 3 to fix grub.
Perhaps I should ask, how can I see the file names of the new distro so that I can modify grub appropriatly?
|
|
|
03-04-2006, 01:37 AM
|
#5
|
Member
Registered: Dec 2005
Location: Edmonton
Distribution: BLFS, Gentoo
Posts: 353
Rep:
|
You've said you're able to boot into each of the 3 distros. Boot into each of the distros and do the following.
Look for the file /boot/grub/menu.lst or /boot/grub/grub.conf If you find one, open it using your favorite editor and look for the first entry which normally would be for the distro you'be booted in. Note down the entries like kernel, initrd etc. Repeat the procedure for the distros as well. Now, you have the entries for all the distros you've installed. Now boot into the distro which you installed last as it is this distro that'd last put GRUB in MBR. Edit the menu.lst or grub.cof whichever is installed and add the entries for the distros you've just noted or copied. Now you should be set to go. Whenever you boot, GRUB lists the titles of all the entries in menu.lst and all you'll have to do would be select the title for the distro you'd wanna boot into and GRUB will do just that.
Another method to achieve the same and which, will also help you in case you want to install another distro as you've already said you'd want - Boot into each of the distros and change to the /boot directory. Do a "ls -l" and you'll see the kernels and initrds installed. Normally a kernel file would start with "vmlinuz" viz. vmlinuz-2.6.13-15-default in SuSE 10.0 and initrd file would start with "initrd" viz. initrd-2.6.13-15-default.img in SuSE 10.0. An easy way to find out which kernel and initrd are default would be to check the symlinks vmlinuz and initrd. These two symlinks should point at the default kernel and initrd respectively. Note down the full name of kernel and initrd. Read on...
Now, you've the names of the kernels and initrds of all the distros. Edit the menu.lst of the distro which you last installed and which has last installed GRUB on MBR and add the lines for the other distros. An example :
title SuSE Linux 10.0
root (hd0,1)
kernel /vmlinuz-2.6.13-15-defailt root=/dev/hda3 splash=silent
initrd /initrd-2.6.13-15-default.img
boot
Note that the keywords title, kernel and initrd should all be lowercase and the kernel/initrd image names are case sensitive too. Replace /dev/hda3 with the drive and partition where the root partition of the corresponding distro is. Replace (hd0,1) with the drive and partition number where the boot partition of the corresponding distro.
If you install another distro choose not to insall GRUB and the repeat the procedure above i.e. note down the kernel name and initrd name and add an entry to the default GRUB menu.lst file. Of-course you can choose to install GRUB and then you'll have to edit the menu.lst of the newly installed system and add the entries for the the other distro. Either way it'd work.
The goal is to tell GRUB where the boot partition is and the names of both kernel and/or initrd image and specify the kernel parameters on the kernel line (root=/dev/??? would be the most important though) and finally ask GRUB to boot into it. The boot and root partitions could be on any disk and any partition, GRUB will be able to boot into it.
Hope this helps you. Shout back if it didn't.
|
|
|
03-04-2006, 02:30 AM
|
#6
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,336
|
On the contrary - when you install each new distro, you certainly *do* want to install a bootloader. Just make sure it is installed to a partition rather than the MBR.
That way the menu.lst (or lilo.conf) get created, and you can simply copy/paste this info as above. Too hard to figure out otherwise, unless you know what you're doing.
|
|
|
03-04-2006, 04:27 AM
|
#7
|
Member
Registered: Oct 2005
Location: London
Distribution: elive e17
Posts: 152
Original Poster
Rep:
|
thanks for that people. I have manged to fix grub and get it to do what I want it to do.
my thanks again.
|
|
|
All times are GMT -5. The time now is 06:11 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|