RedHat (Grub?) booting to wrong disk

RedHat (Grub?) booting to wrong disk

Post by Dale Trage » Tue, 04 Mar 2003 23:18:08



I had an IDE hard drive with an existing Linux installation on it (RedHat
7.2). I unplugged it and connected a new drive as primary master which I
installed RH 8.0 to. Once that installation was finished, I connected the
old drive as secondary master (hdc). My goal was to choose and copy old
files from the previous installation to the new disk.

When I booted the system, grub listed the 8.0 installation's kernel and
started to boot with it, but somewhere in the process, right after the
grub splash screen was displayed, the machine suddenly switched to booting
off the old drive. I got all kinds of errors about swap being missing (it
had been on partition 5 but it was on 9 on the new drive) and other
issues. I changed the old drive's jumpers and moved it to secondary slave
(hdd), but the same thing happens.

My sense is that this has something to do with the LABEL scheme, since the
LABEL names are the only things the drives share, but I can't figure out
how to get around it. I specified the / partition of the new drive in the
grub.conf file (boot=/dev/hda2, and later in the kernel stanza I changed
root=LABEL=/ to root=/dev/hda2 ), but all this did was create different
errors (many stating /var couldn't be found, or that filesystems were
read-only).

What can I do to correct/get around this? It seems like a bug to me, and I
wonder if it's specific to grub.

- DDT  

 
 
 

RedHat (Grub?) booting to wrong disk

Post by Timothy Murph » Wed, 05 Mar 2003 08:16:12



> I had an IDE hard drive with an existing Linux installation on it (RedHat
> 7.2). I unplugged it and connected a new drive as primary master which I
> installed RH 8.0 to. Once that installation was finished, I connected the
> old drive as secondary master (hdc). My goal was to choose and copy old
> files from the previous installation to the new disk.

> When I booted the system, grub listed the 8.0 installation's kernel and
> started to boot with it, but somewhere in the process, right after the
> grub splash screen was displayed, the machine suddenly switched to booting
> off the old drive. I got all kinds of errors about swap being missing (it
> had been on partition 5 but it was on 9 on the new drive) and other
> issues. I changed the old drive's jumpers and moved it to secondary slave
> (hdd), but the same thing happens.

> My sense is that this has something to do with the LABEL scheme, since the
> LABEL names are the only things the drives share, but I can't figure out
> how to get around it. I specified the / partition of the new drive in the
> grub.conf file (boot=/dev/hda2, and later in the kernel stanza I changed
> root=LABEL=/ to root=/dev/hda2 ), but all this did was create different
> errors (many stating /var couldn't be found, or that filesystems were
> read-only).

> What can I do to correct/get around this? It seems like a bug to me, and I
> wonder if it's specific to grub.

You could try "grub-install --recheck /dev/hda"
(assuming that is where grub is installed).

Alternatively, the labels may have got confused, as you say.
You can replace them in /etc/fstab and grub.conf
by the actual devices, eg /dev/hda5 instead of LABEL-/

Or you can find how your disks are labelled by eg "e2label /dev/hda2".

--
Timothy Murphy  

tel: +353-86-233 6090
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

 
 
 

RedHat (Grub?) booting to wrong disk

Post by Paul W. Frield » Wed, 05 Mar 2003 08:45:10



> I had an IDE hard drive with an existing Linux installation on it (RedHat
> 7.2). I unplugged it and connected a new drive as primary master which I
> installed RH 8.0 to. Once that installation was finished, I connected the
> old drive as secondary master (hdc). My goal was to choose and copy old
> files from the previous installation to the new disk.

> When I booted the system, grub listed the 8.0 installation's kernel and
> started to boot with it, but somewhere in the process, right after the
> grub splash screen was displayed, the machine suddenly switched to
> booting off the old drive. I got all kinds of errors about swap being
> missing (it had been on partition 5 but it was on 9 on the new drive) and
> other issues. I changed the old drive's jumpers and moved it to secondary
> slave (hdd), but the same thing happens.

> My sense is that this has something to do with the LABEL scheme, since
> the LABEL names are the only things the drives share, but I can't figure
> out how to get around it. I specified the / partition of the new drive in
> the grub.conf file (boot=/dev/hda2, and later in the kernel stanza I
> changed root=LABEL=/ to root=/dev/hda2 ), but all this did was create
> different errors (many stating /var couldn't be found, or that
> filesystems were read-only).

> What can I do to correct/get around this? It seems like a bug to me, and
> I wonder if it's specific to grub.

It's not specific to GRUB, and not a bug per se, but rather caused by your
not knowing how the volume label feature works. Not a problem; simply do
*one* of the following:

1. Boot from your 8.0 install CD in rescue mode, *do not* mount your Linux
system, then remove the volume labels from the offending partitions on
/dev/hdc using the e2label program like so:

   e2label /dev/hdc1 ""              # removes label

2. Boot from your 8.0 install CD in rescue mode, *do not* mount your Linux
system, and then mount manually your root (/) partition only, on
/mnt/sysimage. Then do:

   cd /mnt/sysimage
   vi /etc/fstab
                (Now change all LABEL= to /dev/hdaN entries.
                Use "e2label /dev/hdaN" if you need help
                remembering which is which.)

Your grub.conf should be OK from what you did before; all the errors are
caused by the conflicts coming from your /etc/fstab file. Good luck and
have fun.

--

Paul W. Frields, RHCE/RHCX    (remove "foo" from e-mail to reply)

 
 
 

1. Grub is booting from the wrong disk!?

I don't understand this so maybe someone can help me to.

The scenario -> had two boxes ("box a" & "box b"), both were running
RedHat 8. The processor in "box b" died (old pentium 2), so I decided to
remove the hard drive from "box b" and install it in "box a" for extra
storage. No biggie, right? Throw in the drive, set it up in the bios,
boot linux, run fdisk & then make the file system. Been there done that
a hundred times.

So here's the deal.  I set up the new drive as secondary master in the
bios, and the bios is set to boot from the primary master which it does.
Boot the machine up, & get the grub splash screen. I know that grub is
being loaded from the boot sector of the primary hard drive because I
have a custom grub background image on "box a" and I'm seeing that when
I boot - plus, I had a different kernel installed on "box a" than "box
b" and it is properly listed in the grub menu. Anyways by all
appearances my box is booting from the primary master (hda), which is
what I want.  Linux starts to boot and I see my hard drives listed -
primary master is identified as hda, primary slave is identified as hdb,
and the new drive, secondary master, is identified as hdc.  Okay, sounds
good.

Here's the tricky part. Linux gets to the point of displaying the
"Welcome to RedHat Linux, press "I" for interactive start up" & then it
suddenly seems to be booting the version of RedHat 8 that was installed
on hdc! The hostname is set to the old hostname of "box b" and it starts
choking because the hardware is different.  If I shut down the machine &
remove power from that new drive, boot up again, the box boots normally.

So I'm like wtf is this?  Why would it suddenly attempt to boot the OS
from that other hard drive?  I know how to fix it (or I hope it fixes
it), I'll just boot up with a boot disk & fdisk that new drive. I'm
really curious as to why this would happen in the first place, tho -
it's something I've never seen before.

My grub.conf looks like this:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/hda3
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,0)/grub/custom.xpm.gz
title stock-kernel
         root (hd0,0)
         kernel /vmlinuz-2.4.18-14 ro root=LABEL=/
         initrd /initrd-2.4.18-14.img

The drives, as identified by linux, are set up like this:

hda -> primary master
hdb -> primary slave
hdc -> secondary master

All drive jumpers are set to cable select.

What's going on here?!?

2. Altering tty setups forever

3. HowDo I: Boot from Redhat GRUB to Mandrake GRUB

4. ALPHA-Linux

5. Newbie novice installed Grub on Redhat 7.3 with separate /boot partition, dual boot Windows XP

6. #pragmas for C/C++ compiler

7. Grub Hard Disk Error on Win2k/Redhat 8.0

8. crontab output

9. redhat 8.0 install - grub - large disks

10. Red Hat 7.3 boot After Installation; GRUB Hard Disk Error Message

11. Can't boot Nevada 18 Cd Disk 1 and Solaris Grub question

12. Booting WinXP from a second hard disk using grub

13. Grub on 2nd disk, /boot partition