LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Grub 1.99 and multi-booting Ubuntu 11.04 32 bit and Ubuntu 11.04 64bit (https://www.linuxquestions.org/questions/linux-newbie-8/grub-1-99-and-multi-booting-ubuntu-11-04-32-bit-and-ubuntu-11-04-64bit-889009/)

simw 06-29-2011 11:20 AM

Grub 1.99 and multi-booting Ubuntu 11.04 32 bit and Ubuntu 11.04 64bit
 
Hi

I had a 100GB hard drive with (originanlly) Windows XP and Ubuntu 10.10 64 bit. I tried to upgrade Ubuntu to 11.04 and it started going wrong. After failing to figure out the problem (to do with the ATI graphics card drivers I think) it stopped loading at all from grub - I think this may have been a grub problem rather than an Ubuntu problem though. Anyway, I decided to "fix" the problem by loading 11.04 from a CD (from linux user magazine). This worked fine but didn't want to overwrite my old distro, so I now have two versions of Ubuntu side by side with a new grub that was installed automatically from the live CD from linux user as part of the Ubuntu 11.04 install process.

Naturally Grub has recognised my pre-existing Ubuntu 64 OS and is offering to boot into it for me. Now that I have this set-up I would quite like to keep it so I can try and spot differences between the 32 and 64 bit versions. I am just wondering what will happen if I boot into the 64 bit OS. With the old 64 bit OS I messed around a little with Grub configurations and will want to do so again but I would rather start from a clean sheet with the new OS. In particular I don't want the grub settings to be changed each time I boot into the other OS, and I don't want to have to keep both grub configs mirroring each other. If I boot into the old OS I am afraid that it will try and amend the grub itself, or install a new grub to overwrite the current one or something. Do I perhaps need to disable grub-update in one of the OS's and if so is there some way of doing this? Any suggestions gratefully received. Please let me know if you would like me to post some info (e.g. partition stuff etc.).

Thanks
Sim

andrewthomas 06-29-2011 11:50 AM

What you can do is boot into the install that you do not want to control the grub on the MBR and open up synaptic and search for grub-pc.

With the drop-down menu you can select to reconfigure.

After verifying what partition this is,then choose to install grub to the PARTITION (PBR.)

Grub will complain and say that this is a bad idea and that it must use blocklists, but just say yes.

EDDY1 06-29-2011 12:30 PM

If either of your linux installations is bootable, you can run
Quote:

update-grub
and it should find the other os
If it fails to find the other os, you can mount the other partions and run "update-grub" again and it will detect then.
From what I read you have Winsxp ubuntu32 & ubuntu64 are these on 1 hard drive? If they are you should post output of "fdisk -l", so someone can let you know if your partitions are right.

bigrigdriver 06-29-2011 12:32 PM

Welcome to LQ.

Quote:

With the old 64 bit OS I messed around a little with Grub configurations and will want to do so again but I would rather start from a clean sheet with the new OS. In particular I don't want the grub settings to be changed each time I boot into the other OS, and I don't want to have to keep both grub configs mirroring each other. If I boot into the old OS I am afraid that it will try and amend the grub itself, or install a new grub to overwrite the current one or something. Do I perhaps need to disable grub-update in one of the OS's and if so is there some way of doing this? Any suggestions gratefully received. Please let me know if you would like me to post some info (e.g. partition stuff etc.).
When you install a distro, at some point during the installation you have the option of installing the first stage of grub either to the MBR (Master Boot Record) of the hard drive, or to the root partition of the distro. If you accept the default, each distro you install after that first one will install grub to the MBR The end result is that the last distro installed is the one that has it's first stage of grub (with pointer to the /boot directory and the Linux kernel) in the MBR.

Now, when you run grub-update on each distro, it will overwrite the MBR and change the pointer to the rest of grub from one distro to another. It will get very confusing quickly.

Solution: select one distro to be the Master, and the other distro as slaves (or think of it as one distro as a server and the others as clients). Install grub from the Master distro to the MBR (grub-install /dev/hd0 or some such command). The first stage of grub will point to the partition that contains the /boot directory of the Master distro. All other distros you install after the Master, be careful during installation to specify installin grub to the root partition instead of to the MBR. For all distros installed already (other than the Master), re-install grub to the root partition (something like grub-install /dev/hd0,1, grub-install /dev/hd0,2, etc depending on the partition number the distro is in).

With grub re-configured that way, when you run grub-update on each distro, the Master still has the MBR and the others will only update their grub in the root partitions and not affect the MBR.

simw 06-29-2011 03:23 PM

Dear Bigrigdriver - thanks for the welcome and thanks for the brilliant advice - you have gleaned exactly what I would like to do! Now I just need to try and boot into the old OS and then get the re-install of grub performed successfully on the right partition. I'll give it a go (though perhaps not tonight) and will post back with how I get on.

p.s. thanks also to andrewthomas who I think is saying the same thing (with a handy gui tool for doing it) - but I didn't understand his suggestion properly until I had read Bigdriver's :-)

andrewthomas 06-29-2011 03:33 PM

Quote:

Originally Posted by simw (Post 4399502)
Dear Bigrigdriver - thanks for the welcome and thanks for the brilliant advice - you have gleaned exactly what I would like to do! Now I just need to try and boot into the old OS and then get the re-install of grub performed successfully on the right partition. I'll give it a go (though perhaps not tonight) and will post back with how I get on.

p.s. thanks also to andrewthomas who I think is saying the same thing (with a handy gui tool for doing it) - but I didn't understand his suggestion properly until I had read Bigdriver's :-)

Yeah, I guess I was a bit light on the details.

It is probably not a good idea to just blindly following advice that is not properly explained.

EDDY1 06-29-2011 04:25 PM

Quote:

In particular I don't want the grub settings to be changed each time I boot into the other OS, and I don't want to have to keep both grub configs mirroring each other. If I boot into the old OS I am afraid that it will try and amend the grub itself, or install a new grub to overwrite the current one or something
Grub doesn't make changes everytime you boot into different os, You can change which os is in control by issuing command "update-grub" from the linux-os that you want in control provided it has grub installed also.

simw 07-01-2011 05:18 AM

Hi Eddy1

Thanks for this. Understood. I booted successfully into the 64 bit OS and no changes were made to the grub. I think though that if I allowed the system to do any auto-updating that involved the kernel being updated it would automatically do a grub-update. So my plan is still to attempt to install grub associated with the 64 bit OS on the partition where the OS itself is located. I haven't attempted that yet. I am assuming that I don't need to download grub again since I already have it (though synaptic package manager doesn't seem to suggest that it is for some reason - what would actually happen if I did download say grub-pc - would it automatically uninstall the version that came automatically with the distro?) - I just need to install it again on the specified partition. My only hesitation now is that I want to be exactly sure that I specify the right partition. Could someone maybe let me know the easiest way to confirm the name of the partition that a particular OS is loaded onto?

Thanks again for everyone's help.

andrewthomas 07-01-2011 08:14 AM

Quote:

Originally Posted by simw (Post 4401221)
I am assuming that I don't need to download grub again since I already have it (though synaptic package manager doesn't seem to suggest that it is for some reason - what would actually happen if I did download say grub-pc - would it automatically uninstall the version that came automatically with the distro?)

It will not reconfigure, just reinstall
Quote:

Originally Posted by simw (Post 4401221)
- I just need to install it again on the specified partition. My only hesitation now is that I want to be exactly sure that I specify the right partition. Could someone maybe let me know the easiest way to confirm the name of the partition that a particular OS is loaded onto?

Thanks again for everyone's help.

The output of
Code:

cat /etc/fstab
or if that uses UUID's then
Code:

df -h
or
Code:

ls -al /dev/root
Then to install grub2 to the / partition.

You want to open Synaptic, then type grub-pc in the search box.

When it is in the list, click on the line containing the entry to select it and go to the package drop-down menu and choose to reconfigure.

The second screen should show you the GRUB install devices.

Just check the partition where your / is and choose to go on.

Larry Webb 07-01-2011 09:33 AM

It has been a while but you can choose where you want the boot loader "grub". When you get to where it tells you how much disc space is required then I believe the next window will give you three options.

Select the 'Manuel' button and then it will open to all your partitions. All you do there is click on the partition you want then click the button 'change'

I always format mine and select the ext4 file system

Then in the bottom select what you want. ( I make two partitions (/) (/home).
after that window it will open a window that at the bottom you will see boot loader. That is where you can select the partition to install.

EDDY1 07-01-2011 10:40 AM

Quote:

Thanks for this. Understood. I booted successfully into the 64 bit OS and no changes were made to the grub. I think though that if I allowed the system to do any auto-updating that involved the kernel being updated it would automatically do a grub-update. So my plan is still to attempt to install grub associated with the 64 bit OS on the partition where the OS itself is located. I haven't attempted that yet. I am assuming that I don't need to download grub again since I already have it (though synaptic package manager doesn't seem to suggest that it is for some reason - what would actually happen if I did download say grub-pc - would it automatically uninstall the version that came automatically with the distro?) - I just need to install it again on the specified partition. My only hesitation now is that I want to be exactly sure that I specify the right partition. Could someone maybe let me know the easiest way to confirm the name of the partition that a particular OS is loaded onto?
My point is that as long as you have grub, even if it updates, you boot the os which you want to be in control and do a simple "update-grub" and it has control again.


All times are GMT -5. The time now is 11:43 PM.