LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Questions re: MBR and Grub configuration (https://www.linuxquestions.org/questions/linux-software-2/questions-re-mbr-and-grub-configuration-453743/)

shellshock 06-11-2006 01:02 PM

Questions re: MBR and Grub configuration
 
Hi everyone. I'm still kind of new at this, so please bear with me.

I have a few questions regarding the MBR and Grub.

On my AMD64, I have a few different distros right now, all variants of Ubuntu. I've got a a 64-bit Dapper, a 32-bit Breezy, and a 64-bit Xubuntu.

It seems that everytime I install a new distro to try it out, the MBR changes location. I say this because I have at the moment three different /boot/grub/menu.lst files -- one for each distro -- but the one that matches the boot menu that I see when powering up is the newest one (the menu.lst for Xubuntu).

Question 1a: Beyond what I just described, is there a way to determine where the MBR is located at any given time? Does its location have anything to do with /boot/grub/default?

Question 1b: Is it possible to move the MBR? I would like to have it back on the 64-bit Dapper partition, since that's my main system.

As for menu.lst, this seems to be something that is generated upon installation. However, if I add or remove a distro after installation -- on a different partition of course -- the original menu.lst doesn't reflect these changes.

Question 2: Is there a way I can update menu.lst whenever I want to reflect the current state of my HD as a whole? (Besides doing it manually -- I'd be afraid to mess it up!)

Thanks for reading.

Gethyn 06-11-2006 02:50 PM

The MBR is always on the boot sector (right at the beginning) of the first disk, although on many motherboards you can specify in the BIOS to boot from other drives. Hopefully that answers your first question.

I think what you are actually asking about is the /boot folder. Everytime you install a version of Linux, it will ask you if you want to reinstall grub. When grub is installed, it is told where to look for its configuration files, which will be wherever the latest installation has its /boot folder. In order to use the configuration of your 64-bit Dapper installation, you need to reinstall grub from inside 64-bit Dapper. Be careful though! You could also try using symlinks to point the configuration files from your other Linux installs to point to the configuration you want to use. I don't know whether grub will like this though. Maybe this sheds a little light on your second question.

Installing a new version of Linux is not going to update the grub configurations of existing Linux setups. My advice would be to create a /boot partition and put your configuration in there. However, I don't think there is a really elegant answer to this situation, you just need to pick a distro and stick with it! Incidentally, you do realise that if you have 64-bit Dapper, you can just install xfce in it, without needing a separate install of xubuntu? You should be able to choose which desktop environment to use when you log in.

shellshock 06-11-2006 03:31 PM

Thanks for replying.

I did notice when I partitioned this HD with the SUSE 9.3 installer last fall that 15 Megs were not accounted for. I suppose this is where the MBR resides?

As for reinstalling grub within Dapper, is that something I do from within a regular terminal, or from within the grub shell?

Quote:

My advice would be to create a /boot partition and put your configuration in there.
Okay, but if I've got more than one distro, don't I have more than one /boot partition too? I'm sorry if I'm just not getting it....

Quote:

Incidentally, you do realise that if you have 64-bit Dapper, you can just install xfce in it, without needing a separate install of xubuntu? You should be able to choose which desktop environment to use when you log in.
On Breezy I tried that with Gnome and KDE, but it seemed messy somehow, although I don't recall exactly what the problem was (maybe it was icons from one desktop showing on the other?). So this time I thought I would just do a separate install, since I have more than enough space and my drive is partitioned into ten pieces.

Gethyn 06-13-2006 07:33 AM

The missing 15MB is not due to the MBR, which is somewhere in the region of 512B (i.e. very small). I don't know what the cause is, but it's not uncommon to be left with small bits of unpartioned space.

To reinstall grub, you need to be inside Linux. You want to be careful doing this though, I advise reading up on it. The command you probably want is 'grub-install hd0' but please read up on it before trying it!

I would still advise having one install with two window managers, instead of two separate installs. If it doesn't work and you run into problems like last time, you can always uninstall one of the window managers. Up to you of course though.

As for the /boot partition... Every distro will have a /boot folder. On most distros, by default, this boot folder is stored inside the / (root) partition. However, you can leave the /boot folder empty and mount a separate partition on the /boot folder, in much the same way as you can with /home or any other directory.

There are two separate issues here really. First is that when you install/re-install grub, it will store information about the location of /boot for the distro that just installed grub. Second is that the /boot folder (or partition) for any given install of Linux will contain settings that are independent of the settings stored in other versions of Linux that exist on the same computer. While most Linux installers are now smart enough to pick up other Linux installations on your computer and create a menu.lst or grub.conf accordingly, I'm not aware of any that are smart enough to detect when those other installations change.

To make a long story short, you are making things much more complicated for yourself than you need to. While running 3 different versions of Ubuntu at once might be helpful while you're learning how things work, it is unnecessary and overcomplicated in the long run. I think you should resign yourself to updating the menu.lst by hand in the short term, and in the long term picking one of the installs and sticking with it.

jtshaw 06-13-2006 01:51 PM

Moved: This thread is more suitable in Linux - Software and has been moved accordingly to help your thread/question get the exposure it deserves.

shellshock 06-17-2006 06:12 PM

Okay Gethyn, thanks for your detailed reply.


All times are GMT -5. The time now is 10:05 PM.