无法恢复Ubuntu 9.10的grub

我有一个硬盘驱动器与Windows的一些分区(NTFS)和1分区的Linux和1分区的Linux交换。 最近,我试了诺顿分区魔术师临8.05(随着Hiren启动光盘)。 它build议我一些与ExtendedX相关的东西。 我select[修复],然后繁荣,重启后,我的grub被损坏(什么是魔术!!!)。

当我使用Ubuntu Live CD启动时,这是我电脑上的fdisk -l的结果:

 Disk /dev/sda: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x4ffe4ffd Device Boot Start End Blocks Id System /dev/sda1 * 1 2615 21004956 7 HPFS/NTFS /dev/sda2 2616 14593 96213285 f W95 Ext'd (LBA) /dev/sda5 2616 4619 16097098+ 7 HPFS/NTFS /dev/sda6 4620 11459 54942268+ 7 HPFS/NTFS /dev/sda7 11460 11982 4200966 7 HPFS/NTFS /dev/sda8 11983 14344 18972733+ 83 Linux /dev/sda9 14345 14593 2000061 82 Linux swap / Solaris 

我find并按照这里的文章: http : //gadgetmix.com/index/how-to-restrore-grub-bootloader-in-ubuntu-9-10-standard-and-netbook-remix/

但在我的电脑上,当我尝试grub-install --root-directory=/mnt /dev/sda8 (这是我的ubuntu主分区)时,terminal返回错误:

 root@ubuntu:~# grub-install --root-directory=/mnt /dev/sda8 grub-probe: error: Cannot find a GRUB drive for /dev/sda8. Check your device.map. Auto-detection of a filesystem module failed. Please specify the module with the option `--modules' explicitly. 

那是什么错误? 我该如何解决这个问题? 谢谢。

尝试这个:

 chroot /mnt bash mount -a update-grub grub-install /dev/sda8 # <- are you sure about this? (see below) unmount -a exit 

关于将grub安装到特定的分区

如果你这样做,你的引导加载程序需要知道该分区有一些有趣的事情。 微软的bootloader是通过编辑c:\boot.iniconfiguration的。 首先将引导加载程序复制到文件中:

 dd if=/dev/sda8 of=grub.bin bs=512 count=1 

然后将grub.bin保存到c:\grub.bin然后在c:\boot.ini如下内容:

 c:\grub.bin="Linux (GRUB)" 

如果你不明白这一点,不要打扰。 阅读下一节。

关于将grub安装到主引导logging

Grub 更好的引导装载程序。 把它放在主引导logging中,可以用来启动Windows,而不是其他的方式。

在继续之前,在运行update-grub之后检查一下你的grubconfiguration文件,以确保它“知道”Windows:

 cat /boot/grub/grub.cfg # used for grub2 users cat /boot/grub/menu.lst # used for grub1 users 

无论您使用什么,查找指示Windows的线条和您的(hd0,0)设备。 当你感到满意时,就像以前一样,然后:

 grub-install /dev/sda # <- note this installs to the "master boot record" 

当你重启时,Grub将会启动,你可以selectWindows。 如果你有在boot.ini文件中引导Linux / Grub的条目,你可以立即删除它们。

这种方法唯一的缺点是,Microsoft Windows 可能会删除grub作为系统更新的一部分,或者一般无能。 使用ubuntu磁盘,只需重新运行update-grubgrub-install可能比处理grub.bin更容易

作为技巧统计,改变

 grub-install --root-directory=/mnt /dev/sda8 

 grub-install --root-directory=/mnt /dev/sda