Re: Grub hangs - two hard drives and a CD
From: Enrique Perez-Terron (enrio_at_online.no)
Date: 11/28/05
- Next message: Enrique Perez-Terron: "Re: why 6 ttys in /etc/inittab?"
- Previous message: Jean-David Beyer: "Re: why 6 ttys in /etc/inittab?"
- In reply to: jerryshenk: "Re: Grub hangs - two hard drives and a CD"
- Next in thread: jerryshenk: "Re: Grub hangs - two hard drives and a CD"
- Reply: jerryshenk: "Re: Grub hangs - two hard drives and a CD"
- Reply: imotgm: "Re: Grub hangs - two hard drives and a CD"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 28 Nov 2005 15:26:23 +0100
On Mon, 28 Nov 2005 05:05:12 +0100, jerryshenk <jerryshenk@gmail.com> wrote:
> But it boots fine if I have the 300 gig drive as the primary on the
> secondary controller....I think that would make it /dev/hdc wouldn't
> it? I'll have to get a cable that I can use to put the 300 gig drive
> on the primary controller so that it would be /dev/hdb.....perhaps that
> would work. I'll have to mess with this tomorow. Thanks for the
> idea....at least it's something to try.
Before I answer, please do quote some parts of the earlier messages in the
thread. Since you are using Google, don't just click "reply', look near the
top of each message, there is a link "show options". Click it and a header
appears with another "reply" link, that is the good one. It will
automatically quote the message you are replying to. Your job is now
to *delete* any parts of the quote that is irrelevant or excessive.
-----------------
Can we suppose that you are well aware of the need to set a jumper
or switch on the drive to make it "master" or "slave"?
There is also often a selection "cable select", but that requires, if
I recall correctly, a cable that supports it. Are you sure you are
doing this right? I don't know if there is any way that the Linux
kernel (on the knoppix) can access a drive despite incorrrect
cabling/jumpering, (with an error rate different from 100%)
while the Bios may be failing to do the same.
In most computers, the Bios tries to boot off different devices.
There is a setting to determine what devices, and in what order.
My computer only has a setting "hard drive" among "CDROM" and others,
but that says nothing about which drive. In practice, it always
boots off the primary master. I always have a primary master intalled.
Perhaps it would try hdb, hdc, hdd in turn if hda were not present.
Some say that the Bios only will try hda and hdb. I have seen a
friend had a Bios where he could set it to boot off "c:" or "d:",
so there are a few variations here.
I have never seen any good explanation of how the Bios determines
if it was able to boot off a device, or has to go on to the next
item on the list. I suppose that the Bios merely detects if the
device is present, and if the controller circuitry reports an
error transferring a sector's worth of data to memory. If the
transfer went OK, I assume the Bios assumes success. Then the Bios
executes the code in that sector. If that code hangs, the Bios does
not get a second chance.
That leads to my question: How do you make your Bios use the 300G
and not the 40G? Does your Bios have a setting for *what* disk to
use?
My main point here is really that you should try to follow the chain
of events, to see where it goes wrong. For this you may need to
know more than you have, but with all I have said, perhaps you can
provide here some more specifics about your Bios and your procedures,
and others here can add some "theory" or background knowledge.
If you can find out what disk the bios is accessing, and how/if
you can control that, we need to know: What is in the first sector
of that device? If it is a grub "stage1" sector, then it contains
a code to determine where to go next. That code is patched into the
sector when you set up Grub. If, when you do the setup, you point
Grub to (hd2,0), because Grub's "stage2" is in hdc1, it will not
find stage2 after the same drive has been recabled/jumpered to become
hdd (or hd3, in grub parlance). I guess you see the problem now.
Does your machine sport a floppy drive? If yes, prepare a
Grub floppy. Just use the knoppix or the rescue cd, and say
cat stage1 stage2 > /dev/fd0
when you have found these files on the CD. (Grub's info page says
use "dd", do that if I am wrong. I think "dd" is the tool to use if
you need to write at some offset into a device, but if the data
is contiguous from the start, I think the command above is OK.)
Then boot off the floppy. You will get a Grub prompt on the
screen, and you will be able to explore your disks as Grub sees
them when looking through the Bios. This is different from
using grub while running linux, because then grub sees the disks
through the linux kernel device drivers.
To explore the situation, take note of a file that is unique
for each disk. Or prepare for the experiment, by creating a file
on the 300G disk, called "This-is-the-300G". Then at the grub
prompt say
Grub> find This-is-the-300G
You will probably get a response "(hd3,0)/This-is-the-300G", and
then you know Grub sees the disk as (hd3).
The natural thing to look for is of course "/grub/stage2" (if you
have a separate /boot partition), or "/boot/grub/stage2" (if not).
Note that when doing this, there is no Linux running, and therefore no
mounting of devices on directories. If you have a separate /boot
partition, there is one partition containing /boot as an empty directory,
and another partition containing /grub as a nonempty directory.
Once you have determined this, you can do the setup. At the grub prompt,
still no linux running:
Grub> root (hd3,0) # the partition having "stage2"
Grub> setup (hd0) # the disk your Bios will access first.
Presto.
Oh, not quite. Now you probably have the wrong data in grub.conf
(or are you using "menu.lst"? Whichever.) Grub will try to boot
according to the config file in the partition containing the stage2.
When it fails to find the file specified in the "kernel" line,
it will give you the prompt, and you will be able to fix the situation.
(This works because now stage2 is loaded. When you tried earlier,
grub just hung because it could not load stage2.)
At the prompt,
Grub> root (hd3,0) # the partition containing the kernel
Grub> cat /grub/grub.conf # or menu.lst. Just to see the file names.
Grub> kernel /grub/vmlinuz-2.6.12-FC4.1362 root=/dev/hdd2 ro
# Notice the root= kernel option speaks
# linuxese, and names the "/" device.
Grub> initrd /grub/initrd-2.6.12-FC4.1362.img
# Use your actual file name, of course!
Grub> boot
When Linux comes up, you can go and edit your /boot/grub/whichever
config file to reflect the procedure that worked.
If you don't have a floppy drive, do this:
Create a file /boot/grub/device.map, containing lines like
(hd0) /dev/hda
(hd3) /dev/hdc
In this file you tell Grub how the devices will show up when seen through
the Bios *at the time of the next boot*. The fist column is the future
bios device expressed in Grubese, the second column is how to access that
device right now, under linux, expresed in Linuxese.
Then run
# grub-install /dev/hda
The device you specify is the one to receive the grub stage1 in sector
zero. Remember to fix grub.conf too, before you reboot.
-Enrique
- Next message: Enrique Perez-Terron: "Re: why 6 ttys in /etc/inittab?"
- Previous message: Jean-David Beyer: "Re: why 6 ttys in /etc/inittab?"
- In reply to: jerryshenk: "Re: Grub hangs - two hard drives and a CD"
- Next in thread: jerryshenk: "Re: Grub hangs - two hard drives and a CD"
- Reply: jerryshenk: "Re: Grub hangs - two hard drives and a CD"
- Reply: imotgm: "Re: Grub hangs - two hard drives and a CD"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|