LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Dual Booting CentOS and Redhat (https://www.linuxquestions.org/questions/linux-software-2/dual-booting-centos-and-redhat-463430/)

wtilton 07-12-2006 03:39 PM

Dual Booting CentOS and Redhat
 
I'm a Linux noob, but have been tasked with installing CentOS on a machine that has an existing Redhat installation. The Redhat installation is install on the master drive, and I'm wanting to install CentOS on the slave drive (two seperate drives).

I loaded up CentOS and went through the installation. Now the GRUB loader thingy only displays CentOS as a boot option. Where'd Redhat go? I'm guessing that CentOS didn't know that Redhat was on there, so it just put it's own entry into the GRUB loader. Any easy way to get that back? I'm not really sure where the other one was loaded, but I'm guessing dev/hda2.

Thanks in advance,

WTilton

blackhole54 07-13-2006 06:43 AM

I am guessing RH is still there and that GRUB just doesn't have it in its configuration file.

I would boot into CentOS and use one of its partitioning tools to see what partitions are on the two disks. If you have fdisk, running
Code:

fdisk -l
as root will list all of the partitions on both disks. Otherwise, see what partioning tools you have using
Code:

man -k partition
Compare this against the partitions that are currently mounted (issue the mount command w/o any parameters). I am guessing you will see one or more partitions on your slave drive (partitions that start with /dev/hdb) mounted and none mounted from your master drive (partitions that start with /dev/hda).

If this is true, create a temporary mount point (say /mnt/temp) if you do not already have one, and see if you can mount any of the partitions from your master drive on it with commands like:
Code:

mount -t auto /dev/hda1 /mnt/temp
These commands need to be run as root. If you can mount any of these, look at their content with
Code:

ls /mnt/temp
This should tell you whether your RH system is still there. If it is, you just need to modify you GRUB configuration file to give you a choice of which to boot.

wtilton 07-13-2006 11:43 AM

Thanks Blackhole. I'll give this stuff a try now. I did try adding an entry to the GRUB loader, but when I tried to boot from it it didn't work. Let me try the stuff you've outlined and I'll get back to you.

wtilton 07-13-2006 12:01 PM

My primary drive looks like the following: ("fdisk -l" worked like a charm)

Device Boot ... System
/dev/hda1 ... Linux
/dev/hda2 ... Linux
/dev/hda3 ... Linux swap

and slave drive:

/dev/hdb1 ... Linux
/dev/hdb2 ... Linux LVM

I did the mount command on 1 and 2 on the primary. Both of them had what I think is the Redhat OS.

hda1 has folders grub, and lost+found, and then files like boot.b, chain.b ... initrd.2.4.20-6.img, kernel.h etc.
hda2 has folders like bin, boot, dev, etc, home, initrd, lib...

I'm going to totally guess and say I need to get grub to point to the hda1 drive to boot from that. It does look like there is a grub folder in the primary disk. Going to now lookup how to modify the GRUB stuff.

Thanks again!

wtilton 07-13-2006 12:22 PM

Woot! Got it working. I went into the mounted directory grub and looked at it's grub.conf and simply copy and pasted the existing entry over. Rebooted, selected RedHat 9, and up she came. Awesome!

for reference my /boot/grub/grub.conf file looks like:

title CentOS (2.6.9-34.EL)
root (hd1,0)
kernel /vmlinuz-2.6.9-34.EL ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.9-34.EL.img
title Red Hat Linux (2.4.20-6)
root (hd0,0)
kernel /vmlinuz-2.4.20-6 ro root=LABEL=/
initrd /initrd-2.4.20-6.img

Thanks again for taking the time to help out. Much appreciated!

Last question...any reason why it started booting from the slave drive's grub.conf instead of the old one that RedHat 9 already had? Should I be concerned that it's booting from the slave?

blackhole54 07-13-2006 10:32 PM

Quote:

Originally Posted by wtilton
Last question...any reason why it started booting from the slave drive's grub.conf instead of the old one that RedHat 9 already had? Should I be concerned that it's booting from the slave?

True confession time. I am glad you got it working on your own because, while I am familiar with LILO, I have never used GRUB!:o So I am somewhat guessing here. When you installed centOS, it put instructions on the MBR (Master Boot Record -- the first 512 bytes of /dev/hda) to run GRUB from /dev/hdb. If this bothers you, I would think you could boot RH, setup its GRUB config file and give the magic instruction (this is where I have no idea what I am talking about:)) to have it set up the MBR to use its version of GRUB. Or ... you can always go with the old adage: if it ain't broke, don't fix it!

wtilton 07-14-2006 11:50 AM

:) No you were pretty much right on. You pointed me in the right direction and I got it done.

Yeah, probably just going to let it stay as it is. It's working so why bother fooling with RH the MBR. Thanks again.


All times are GMT -5. The time now is 12:54 PM.