dapper grub error (試着修復grub錯誤,轉自ubuntu 的list)

On Sunday 26 March 2006 08:04, Vincent Trouilliez wrote:
> Hi,
>
> I would like/need to re-install Windows on my machine, but it will I
> think make the GRUB menu disappear, so I won't be able to start Ubuntu
> afterward :-/

Correct. Windows always overwrites your bootloader. Fixing it is a
simple matter of re-installing Grub - restoring the MBR on hda and
everything works as it did before

> I have two hard drives, machines boots on hda where there is WindowsXP
> (FAT32 filesystem), and Breezy. The other drive, hdc, has Dapper
> installed on it. GRUB is on hda of course as that's where the machine
> boots, and it uses Dapper's menu.lst.

OK, this is a normal setup

> What I have: Dapper Flight5 install CD, and Breezy CD (live and
> install).
>
> The only idea I can come up with, is to boot on the Dapper Install CD,
> cancel the install so as to get to the installer menu, and select
> "install GRUB".

Mostly correct, except don't use the installer to do it - installers
may or may not do extra steps which aren't appropriate here.

Better to boot from a liveCD, go to a console and use grub-install.
There's one trick - telling grub where it will find it's image files
when it boots (they are normally at /boot/grub after start-up).
Assuming your /boot is on the same partition as / for Dapper, and
that is /dev/hdc1, mount it somewhere, then run grub-install:

mount /dev/hdc1 /mnt
grub-install --root-directory=/mnt /dev/hda

This will install grub to the mbr on hda, and write the correct values
for the location of the images to the mbr as well.

Reboot, all should work. If you want to be pedantic, you can re-run

grub-install /dev/hda

from Dapper to put everything back exactly as it was.

> This way I am hoping it will not overwrite/damage the existing
> installation, and will just re-install GRUB.

The only error you can make is to write grub to the boot sector of a
partition with an ntfs file system. On your setup the ONLY thing you
must NOT try is "grub-install /dev/hda1". Learn from my mistake in
this, not your own :-)

> Would this work ? If not, what would be the next easiest way to
> re-install GRUB ?

Any conceivable method of getting a kernel in memory and able to
execute grub-install will work. A LiveCD is by far the easiest.

> Thanks much in advance for rescuing me ;-)
>
> I think it's such a typical use case, there might as well be an option
> just for it in the main menu when you boot the CD ! ;-)

The actual cure is to get Windows to be other-OS aware and offer an
option to install it's loader or not.

Oh wait, you did say Windows... never mind


--
Alan McKinnon
alan at linuxholdings dot co dot za
+27 82, double three seven, one nine three five

--
ubuntu-users mailing list
[email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章