Re: Fedora Core 2/Windows XP dual boot: selecting Linux doesn't work
- From: "Enrique Perez-Terron" <enrio@xxxxxxxxx>
- Date: Thu, 15 Dec 2005 04:35:08 +0100
On Wed, 14 Dec 2005 23:12:03 +0100, <g.devries@xxxxxxxxxx> wrote:
Peter T. Breuer wrote:
g.devries@xxxxxxxxxx wrote:
> This Maxtor 6L080M0 is an SCSI Disk Device, under Sata RAID Controller.
Eh? What? Is it scsi or isn't it? SATA is serial-ATA, which is not
scsi!
This is what I saw in the device manager under XP. I must confess I
don't know what exactly SATA and SCSI are.
I'm going to work on the supposition that that is IDE, not scsi, and
that the "raid" is some software raid which doesn't exist at the
moment (only one disk anyway). So that is your hde?
Apparently. I have, as you suggested, made a FAT partition on that
disk, which I could successfully access from Linux (mount /dev/hde5
/foo, and then at /foo I could see all the files on that partition).
Anyway, it'll be hd0, for the little I know of grub's weird
numbering system.
OK, hd0 it is.
No - it was incredibly unclear, like all the grub documentation. Rumor
has that it is written originally in dutch by a blind monkey.
Well, in that case it should be easy for me to read. I'm Dutch (but not
a blind monkey).
> The other hard disk is a Maxtor 92040U6, at the secondary IDE Channel.
That is your hdc? I suppose that would be hd1 to grub.
That makes sense.
> In grub.conf, I changed every occurrence of "hd0" to "hd1" and vice
> versa. But if the mapping is still wrong in device.map, that won't be
I don't know what "device.map" is. I've never heard of it. Oh - it's
some grub thing. yes, now THERE you can see what the mapping is! DON'T
CHANGE IT.
Oh, yes sir! It has to change.
From
http://www.gnu.org/software/grub/manual/html_node/Device-map.html#Device-map:
"If the device map file exists, the grub shell reads it to map BIOS
drives to OS devices. This file consists of lines like this:
device file
The reason why the grub shell gives you the device map file is that it
cannot guess the map between BIOS drives and OS devices correctly in
some environments. For example, if you exchange the boot sequence
between IDE and SCSI in your BIOS, it gets the order wrong.
Thus, edit the file if the grub shell makes a mistake."
Exactly. Grub was tripped up because it could not know about the
bios boot setting. It guessed correctly the order that the bios
would have numbered the disks, in the absense of a boot setup.
> If I change device.map to
> (hd0) /dev/hde
> (hd1) /dev/hdc
DON'T. Why, in heavens name, why?
Because from your earlier post, I deduced that hd0 should be hde, and
not hdc, as it said in that file. And the grub docs say that you have
to edit the file if grub makes a mistake in guessing the mapping.
Well, anyway, I suppose this changes things to match the probable
facts. But you will have to tell grub to use that mapping file. Why
bother?
From the info I quoted, I seemed to understand that grub always reads
that file if it exists.
> and then change grub.conf to
> title Fedora Core (2.6.5-1.358)
> root(hd1,0)
This points at grub's boot code area on hdc1. I've forgotten
where you said everything was. This should be pointing at the /boot
partition. Does it?
The /boot partition is at hdc1. But as things are now, hd1 is not hdc,
but hde.
There are *two* grubs. One runs under Linux, and is used to setup
a boot record, and one runs under the bios during the boot.
The grub.conf file is read by the latter, so it needs (hd1,0) to
access the first partition. The "root" directive in grub.conf
is used to specify the partition that will hold the files named
in the "kernel" and "initrd" commands.
> kernel /vmlinuz-2.6.5-1.358 ro root=LABEL=/
PLEASE DO NOT USE LABELS! Be specifc. Say "root=/dev/hdc2" (or
whatever).
oh, it's not that bad... But actually, I too prefer that people
use specific devices, so I don't have to ask them to use some
commands to list the labels of all partitions in order to figure
out what is going on. Yes, /dev/hdc2 must be right, according
to what you said earlier.
> initrd /initrd-2.6.5-1.358.img
And please do not use ramdisks. Why? Oh why. Is your kernel so
crippled?
I installed it from the Fedora Core 2 CDs. Would you care to explain
how I can avoid the .img?
Hehe. In a year or two perhaps you will say: Oh, today I feel
like making my own kernel with just the right stuff in it.
Then you can make a kernel that doesn't need an init-ramdisk
to hold the modules required to access an ext3 file system
(or whatever it is that Fedora leaves out of the kernel...)
But for now, I suggest you just let this initrd command sit
where it sits. Among other things, it mounts a /dev ramfs
for you. Peter surely prefers to have /dev in a regular disk
directory, not, Peter? Hm, thinking about it, I would not
be too surprised if it actually could work to drop the initrd...
> will that be enough? Will these settings be used the next time I try to
> boot?
No. You have done nothing to make it so! Install grub on a boot record,
copy that boot record to windows, and point windows boot.ini at the
copy.
I have grub installed at /root/grub (/root being the first partition of
hdc), and done
dd if=/dev/hdc1 of=linux.boot bs=512 count=1
Then I copied linux.boot to C:\ and added
C:\linux.boot="Linux"
to boot.ini.
The question is, after changing grub.conf, do I need to reinstall grub,
or will a reinstall remove all my changes?
No.
But your *original* setup of grub got hosed because the devices.map
file was wrong. Once the devices.map is right, just run the command
grub-install /dev/hdc1
This is a shell script that will run the *former* "grub" (remember the
two grubs, right?) - the one that runs under Linux, and is used to
setup the boot sector. It figures out most messy details, very
conveniently, except that it does not know how to reboot and hit
the F2 or F10 or whatever it is on your computer, to enter the
Bios setup and check the boot device order.
Then boot back into XP and run, what was it, BootPart? get that
boot sector from the start of /dev/hdc1 (how is it called in
that BootPart program?) into the file you specified in boot.ini.
C:\Linux.bin, was it?
-Enrique
Oh, yes, tell us if it works, I recently heard of this technique,
with the boot sector copied to a file and specified in boot.ini,
but I have not tried it myself. Mm, just in case, do not confuse
the sector at the start of /dev/hdc and the sector at the start
of /dev/hdc1. Both places can hold a Grub boot sector, you
specify which in "grub-install /dev/hdc1". I just don't know
how clever the BootPart is. :)
.