On 2011-01-03 23:36, oldcpu wrote:
> I’m a bit surprised your PC boots with both /sda1 and /sdc1 marked as
> active partitions. I assume there is generic boot code put on /sda1
> which in turn points to /sdb1 for grub to load and boot.
Er… no. The generic boot code only finds the first marked partition in
the same disk (or the first disk, perhaps, but that would be a bug, IMO)).
This code is about 400 bytes (512 minus partition table size), it can’t do
much.
So, if there is generic code in the MBR of sda, and sda is the first BIOS
disk, that will load the boot sector of sda1 - which being and NTFS
partition, it only can boot itself, ie, windows.
However, if that MBR contains the first stage of grub, it is not possible
to know what it boots (it is hardcoded on install), and partition marking
is irrelevant.
Except:
> I suspect that is what the grub.conf file does with this line:
>
> Code:
> --------------------
> linux-xwf6:/etc # cat grub.conf
> setup --stage2=/boot/grub/stage2 --force-lba (hd0) (hd1,1)
> quit
>
> --------------------
>
> ie my guess is that the “hd1,1” indicates grub is on your second hard
> drive in the second partition on that drive (ie on sdb2).

Mine is that grub first stage is in the MBR of first bios disk and loads
grub (second stage) in second partition of second bios disk.
In “File: grub.info, Node: setup”, it says:
– Command: setup --force-lba']
–stage2=os_stage2_file’]
`–prefix=dir’] install_device [image_device]
Set up the installation of GRUB automatically. This command uses
the more flexible command install' (*note install::) in the backend and installs GRUB into the device INSTALL_DEVICE. If IMAGE_DEVICE is specified, then find the GRUB images (*note Images::) in the device IMAGE_DEVICE, otherwise use the current "root device", which can be set by the command
root’. If
INSTALL_DEVICE is a hard disk, then embed a Stage 1.5 in the disk
if possible.
install_device is hd0, and image_device is hd1,1
What I’m not sure is where is the stage 1.5 and 2. It could be in the first
track after the MBR of the first bios disk, or just after the boot sector
of hd1,1, before the partition data starts, there is some reserved space
there. Grub documentation is not very clear, and I think it depends on each
case. That code has to be loaded before grub can read the menu.lst file (or
any file).
>
> For example if I look at my PC with one hard drive and it boots from
> /sda2 I have:
>
> Code:
> --------------------
>
> setup --stage2=/boot/grub/stage2 --force-lba (hd0,1) (hd0,1)
> quit
>
> --------------------
>
> and my guess is in my case this indicates that grub is on the 1st hard
> drive, second partition on my PC (which is INDEED the case). Of course
> we are counting starting from ‘0’ here (and not starting from “1”).
Correct.
>
> I believe that when you update the kernel, neither
> /boot/grub/device.map, nor /etc/grub.conf should IMHO change.
Correct.
> Now looking at your /boot/grub/menu.lst file:
…
> When you update, you should expect all to remain the same EXCEPT that
> instead of vmlinuz-2.6.34-12 you will have vmlinuz-2.6.34.7-0.5 and
> instead of initrd-2.6.34-12 you should have initrd-2.6.34.7-0.5
> (assuming your kernel is being updated to the 2.6.34.7-0.5 kernel). And
> the menu.lst title lines will change too.
Yes, a new entry should appear, and an old entry removed (if multiversion
is not active). A full entry: tittle, root, kernel, initrd… perhaps the
“default” parameter changes.
> I think either than the /boot/grub/menu.lst, no other config file
> should change. But I will definitely defer to the experts on this - as I
> am NOT an expert in this subject matter.
I’m not that expert, I have big holes in my understanding, but I concur.
Which is what the first post said (yours): make a backup of menu.lst and
make sure to edit it before rebooting. I always do that.
It is also possible that initrd has wrong modules inserted, but in that
case the kernel would complain of missing modules, or not being able to
read ext3, or some such thing.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)