mbr 似乎无法修复

mbr 似乎无法修复

我的系统(1 个硬盘,2 个分区 - 1=Windows,2=Ubuntu)无法再启动,但是昨天当我从 Ubuntu 关闭它时,没有任何问题。

我最后一次尝试从实时 Ubuntu-usb 系统启动修复(使用建议的修复)。

那就是粘贴箱各种日志。

看起来它运行得很完美,因为我得到了选择 Windows 和 Ubuntu 的屏幕,但是在我进入之后,出现了一个错误页面。

像这样:

启动 Windows 时出错,根源可能是过去的硬件或软件更改”

对我来说,它看起来像典型的缺陷 mbr 消息,但启动修复无法正常工作。

有人知道一个技巧,也许是一个魔术吗?

更新:现在情况变得越来越奇怪了。

我试图重现我在过去几分钟所做的事情。错误并非不可能。

我在我的 live-distro 上安装了 grub2 并执行了此命令。

sudo grub-install --boot-directory=/mnt/boot/ /dev/sda

我不确定最后一个参数是否是/dev/sda或 _/dev/sda_1,因为sda1是硬盘上的第一个分区,但当我执行它时,出现了错误。所以我尝试星展银行并且成功了。嗯,看起来成功了。

然后我重启并进入 grub 恢复行。我知道的唯一可能的命令是 ls,它显示了类似以下内容的内容:

(hd0) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1)

当我尝试时ls hd0,它显示未知文件系统ls hd0,msdos1-3表明错误的文件名

因此我再次从 USB 驱动器启动了 Ubuntu,我只是想确保我的分区仍然正常并输入sudo blkid

结果如下:

/dev/sda1: LABEL="PENDRIVE" UUID="1A0C-1658" TYPE="vfat"
/dev/sdb1: LABEL="OS" UUID="9A34A62D34A60C77" TYPE="ntfs"
/dev/sdb2: LABEL="data" UUID="8A9AAA5C9AAA4513" TYPE="ntfs"

所以我的 USB 驱动器现在星展银行代替安全数据库我的硬盘分区是安全数据库代替星展银行

也许我太累了,看到了鬼,但我做错了什么?

答案1

是的,它看起来确实像典型的 MBR 错误消息。我最终遇到了类似的情况,尽管我能够从 liveCD 重新安装 grub,然后顺利启动到 Ubuntu。(我不知道您的启动修复程序是否会重新安装 grub;如果没有,我将在下面发布说明。我不能承担他们的功劳,但我不知道我从哪里得到它们了。)我再也无法让 Windows 再次运行,最后我不得不删除它;我希望您的情况会好转。但是,一旦我可以启动到 Ubuntu,至少我能够访问我的 Windows 分区并在删除分区之前从中删除所有有价值的东西。


这是恢复损坏系统的 GRUB 2 文件的一种快速简便的方法。终端用于输入命令,用户必须知道已安装系统的设备名称/分区(sda1、sdb5 等)。从 LiveCD 找到并安装问题分区。然后将文件从 LiveCD 库复制到正确的位置和 MBR。与以下方法相比,它需要的步骤最少,命令行条目也更少。例如,如果 Windows 在 sda1 上,Ubuntu 在 sda5 上,并且 Windows 已覆盖 MBR,则 grub 安装的目标将是 /dev/sda5,并且 sda 引导扇区中的 MBR 将为 grub 重写。

此操作将写入 MBR 并将模块和 core.img 恢复到 /boot/grub。它不会替换或恢复 grub.cfg 或修复损坏的文件。

Boot the LiveCD Desktop.

Open a terminal by selecting Applications, Accessories, Terminal from the menu bar.

Determine the partition with the Ubuntu installation. The fdisk option "-l" is a lowercase "L".

    sudo fdisk -l

    If the user isn't sure of the partition, look for one of the appropriate size or formatting.

    Running sudo blkid may provide more information to help locate the proper partition, especially if the partitions are labeled. The device/drive is designated by sdX, with X being the device designation. sda is the first device, sdb is the second, etc. For most users the MBR will be installed to sda, the first drive on their system. The partition is designated by the Y. The first partition is 1, the second is 2. Note the devices and partitions are counted differently. 
Mount the partition containing the Ubuntu installation.

sudo mount /dev/sdXY /mnt

Example: sudo mount /dev/sda1 Note: If the user has a separate /boot partition, this must be mounted to /mnt/boot Note: If the user has a separate /home partition, this must be mounted to /mnt/home. Encrypted home partitions should work.

Run the grub-install command as described below. This will reinstall the GRUB 2 files on the mounted partition to the proper location and to the MBR of the designated device.

sudo grub-install --root-directory=/mnt /dev/sdX

Example: sudo grub-install --root-directory=/mnt /dev/sda 

在 Ubuntu 11.04 Natty Narwhal 中引入的 Grub 1.99 中,提供了一个新的开关,可以更清楚地定义 grub 文件夹的位置。上面的命令仍可用于 Grub 1.99,但开发人员更喜欢以下命令。命令中的目标目录是将安装 grub 文件夹的命令。默认情况下,如果没有开关,位置是 /boot/grub。在这些说明中,由于 Ubuntu 分区安装在 /mnt 上,因此目标将是 /mnt/boot/grub。

sudo grub-install --boot-directory=/mnt/boot /dev/sdX

Example: sudo grub-install --boot-directory=/mnt/boot/ /dev/sda

Reboot

Refresh the GRUB 2 menu with sudo update-grub

相关内容