Sun 18 Jan 2004 07:29:47 PM UTC, comment #2:
I'm developing a Hungarian Linux distro called UHU-Linux.
Here we're trying to satisfy the needs of as many users as
possible.
The installer asks whether to install GRUB into MBR or not.
Some users like to have GRUB there, some prefer using Smart
Boot Manager or a boot-floppy or something else. In the mean
time we've found that it's much better if we install grub
into the /boot partition under all circumstances, without
even asking the user. This is a big help in case something
goes wrong and they have to use a boot floppy or an SBM to
load their Linux. Actually the auto-generated boot-floppy
also contains an entry "boot the UHU-Linux partition". So
it's kind of a rescue solution for those who have grub in
mbr. (Many of our users are beginners, we cannot expect them
to remember which partition they installed Linux into, and
they don't know how to use the command line interface of
grub. That's why we try to help them as much as possible.)
(Btw we do already have a trivial patch for this problem,
stage2 is renamed to stage2.hd0 or stage2.hd0,5 etc., so
this particular bugreport is not about "please help me",
it's about "please fix it mainstream so that it works for
other people as well".)
|
Mon 12 Jan 2004 07:32:40 PM UTC, original submission:
Suppose you want to install GRUB to more different places,
e.g. both to your partition and to MBR. So you type e.g.:
grub-install "(hd0,5)"
grub-install "(hd0)"
But this is incorrect. The first command copies stage2 to
/boot/grub and hardwires its position to the stage1 of
(hd0,5). Then the second command copies stage2 again to
/boot/grub, overwriting the previous version. The new
version might go to a different part of the disk (actually
more other commands might be executed between the two
commands above, even months or years may elapse between
these two commands, including kernel and GRUB updates...).
So a grub-install "(hd0)" can easily break the boot loader
of (hd0,5), and similarly a grub-install "(hd0,5)" can
easily break grub in (hd0).
Suggested workaround: the grub-install script should encode
the name of the partition in stage2 filename, e.g. create
files named /boot/grub/stage2.hd0 and stage2.hd0,5. (Care
should be taken, of course, to choose filename that are
compatible with all types of file systems).
I hope that nowadays no-one cares about storing a 100k file
in two or three instances instead of one. In case you try to
find a solution where stage2 is only stored once, you'll
always risk that installing/upgrading the boot loader of one
device (partition or mbr) will completely break it for
another device.
|