2010年1月16日 星期六

grub rescue after re-partition by Windows

Situation:
I install Ubuntu9.10 (with grub loader) in /dev/sda10.
(My MBR bootloader is spfdisk)
Someday, I boot the system to Windows (/dev/sda2) and re-partition /dev/sda3 to NTFS.
After rebooting to Ubuntu9.10, a problem comes: some Windows program has changed the disk MBR and my Ubuntu9.10 is no more in /dev/sda10. It's in /dev/sda9 in the new MBR.

So when boot to /dev/sda9, grub can't find linux in /dev/sda10.
It is in /dev/sda9 now !



--------- in grub rescure, manually boot to /dev/sda9 -------

grub rescue>

set prefix=(hd0,9)/boot/grub

insmod (hd0,9)/boot/grub/linux.mod

----- now you can use [tab] auto-completion ---

set root=(hd0,9) linux /boot/vmlinuz26 root=/dev/sda9 initrd /boot/kernel26.img boot

----- this will boot to Ubuntu 9.10 ------

sudo update-grub
sudo grub-install /dev/sda9

(this will update your grub settings, esp. your boot menu,
so that you can boot normally into Ubuntu9.10 next time)


Reference:

沒有留言:

張貼留言