You are not logged in.

#1 2009-06-09 03:25:45

dvh
Member
Registered: 2007-10-06
Posts: 41

changing installation and help with grub

Grub install question. I tried to look through the very extensive grub postings here, and I have googled for grub install help, but everything I find seems to assume that I already have some grub familiarity. My search did not produce the help that I need. My apologies if this has been answered before. Here is my question… I have been dual booting using grub (first XP and gentoo, now two linux distros, gentoo and arch) for a long time, but I have been stumbling through the install each time, and I have been able to get things working more-or-less by trial and error. I do not have a good understanding of grub, nor just what its commands actually do.

My current setup has a distinct boot partition, followed by two separate partitions, one for each distro. The boot partition holds the kernels for my 64-bit arch install. The /boot/grub/menu.lst in this partition has the entries for booting my arch install, and a pointer to another menu.lst which points to my gentoo install. The gentoo partition holds its own kernels in a /boot directory. This was the one way I found that I could maintain two separate "menu.lst" files, one for arch and one for gentoo. I don't think it is particularly clean, because the gentoo boot depends on the arch boot, and I have had instances where the grub "stage 1" (whatever that is) got out of sync with "stage 2" which I had to correct by manually reinstalling grub to one or the other location…I can't remember which. But it works, so I am not inclined to mess with it…

My hard drive is starting to make whining noises, so I fear that it will soon fail, so I am preparing to move both distros to a new drive, and I am looking for a better way to accomplish this dual boot. I stumbled across a message board which had this suggestion:

…my solution to this has been to have a boot partition with just grub on it, that boots all other OSs. All other OSs are chainloaded, like this:

title Any linux distro 
root (hd0,2) 
chainloader +1 

The advantage of this is that you let the distro set up its own boot method, but only on its own partition.

I think this would be clean, and I would like to accomplish it. I understand completely how to partition and create the necessary filesystems on a new drive. I will create a dedicated boot partition, and two "distro" partitions. But what I do not know is the proper method to get grub installed appropriately for all of this. I believe I need to install grub 3 times…once for the boot partition and once for each of the distro partitions. Assuming that I booted using a live CD, and I have the new drive partitioned, and I have my old distro partitions copied to this new drive, what is the appropriate sequence of Grub commands necessary to make this happen? Will this sequence work?

#>grub 
grub> root (hd0,0) 
grub> setup (hd0) 
grub> root (hd0,1) 
grub> setup (hd0,1) 
grub> root (hd0,2) 
grub> setup (hd0,2)

Do I need the "root" commands? I'm not sure what these actually do. Also, are the setup commands correct? Will these overwrite any of the /boot content that already exists in either of the distro partitions?

Lastly, as I discussed, my arch distro currently uses a separate /boot partition to hold kernels and such. Is there something in the grub install that needs to be adjusted to change to my desired configuration?

Sorry for the length of this, but grub confuses me greatly.

-dvh

Offline

#2 2009-06-18 03:00:11

darthaxul
Member
Registered: 2008-09-24
Posts: 156

Re: changing installation and help with grub

if the hd is failing slap in the live cd and just copy the partitions to the new hd, then run grub-install /dev/<bootpartition>
then configure the singular menu.lst to list all your os's
there only needs to be one /boot/grub/ folder on your entire computer, unless you need other grub versions, or your want a different boot menu color screen for ur distros.

Offline

#3 2009-06-18 14:27:02

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: changing installation and help with grub

You can do it this way (nice and clean, I like the idea), but the GRUB on the MBR *must* be able to find its own menu.lst (you can't install configuration files to the boot sector).  That means you need to have a partition on which GRUB can find its configuration.  If you're determined to have the MBR independent of all the OSes on the drive, you can do this by putting a partition at the front of the disk a few megabytes in size for the GRUB configuration.  Then you _may_ be able to install GRUB by running

grub> root (hd0,0) # partition for MBR configuration
grub> setup (hd0)

at a grub prompt.

(The 'root' command tells GRUB where to install configuration files and images, and tells the image that will actually be written to the bootloader where to look for its data.)

Slightly easier is to choose one OS to be your primary, install its boot loader to the MBR, and chain-load the others via the menu.lst in your primary OS.  Either way your next step is to install GRUB to the root partitions of your respective OSes, which can be done all at once, but I would suggest running 'grub-install $my_root_partition' from each OS in turn... of course, that's hardly an option if you can't boot it in the first place.

DISCLAIMER:  I make no guarantee for any advice contained in this post, nor will I claim responsibility for what will happen if you follow it.  Back up your data first and be prepared for your system to be temporarily unbootable.  Seek advice from other people and look both ways before you cross the street wink

Offline

#4 2009-07-21 03:04:07

dvh
Member
Registered: 2007-10-06
Posts: 41

Re: changing installation and help with grub

Thanks for the advice.  I have succeeded in making this work using a single boot partition, which only contains grub, which in turn points to the two partitions with distinct distros.  clean, but now I have three instances of grub to maintain.  Well, on to replacing the suspect drive.

-dvh

Offline

Board footer

Powered by FluxBB