zoukankan      html  css  js  c++  java
  • Ubuntu+Win7双系统grub的修复问题

      最近,在grub引导的Ubuntu+Win7双系统上作业,用的是Ubuntu14.04.2。进行系统更新,更新到一般卡住了,恰好此时在进行grub相关文件的更新,我把机器重启后进入了grub rescue模式,如下:

      error: file '/boot/grub/i386-pc/normal.mod' not found.

      Entering rescue mode...

      grub rescue>

      经过网络一番查找和自身验证,我汇总了三种解决方法。

      1.制作Ubuntu的U盘启动工具,选择U盘启动机器,进入Try Ubuntu,安装boot-repair工具,用该工具回复损坏的grub.

        a.在命令行下安装boot-repair,首先链接源地址:$sudo add-apt-repository ppa:yannubuntu/boot-repair 

                             $sudo apt-get update

                             $sudo apt-get install boot-repair

        b.安装成功后可以在dash中或终端里启动boot-repair,开始修复系统。

        c.系统修复可能需要几分钟,后关机拔掉U盘,再启动。即可看到熟悉的grub引导界面了。

      2.直接在grub rescue模式下选择normal模式启动,然后再修改更新grub。这种方法的关键点有三个,一是选择好grub所在的分区目录,二是找到root所在的分区,三是要有normal.mod文件。该模式下命令有限,常用的有ls set insmod,通过这三个命令,来找到上述文件目录项后设置root和prefix,再选择normal启动模式。

        a.grub rescue>set //该命令会列出boot目录所在的分区,grub目录所在的分区;

        b.grub rescue>ls  //列出所有分区,样式如(hd0,msdosX);

        c.grub rescue>ls (hd0,msdosX)/  //依次列出每个分区下的目录,找出root在那个分区下,这里我们假设grub在(hd0,msdos6)/boot/grub,root在(hd0,msdos5)分区上;

        d.grub rescue>set root=(hd0,msdos5)

             grub rescue>set prefix=(hd0,msdos6)/boot/grub

           grub rescue>insmod /boot/grub/normal.mod  //若没有normal.mod这个文件,请选择第一种或第三种方法。

        e.grub rescue>normal  //显示grub菜单

        f.通过显示的菜单进入系统后,在命令行对系统进行更新修复。

          $sudo update-grub

          $sudo grub-install /dev/sda  //sda为硬盘号,不是分区号(sda1,sda2等等)

          $sudo shutdown -r now  //重新启动机器

        ps:可以在grub.cfg中修改grub菜单。

      3.若第一和第二中方法无效,那么只能放弃所有从来再来,用做好的启动工具重新做个Ubuntu系统,在更新修复grub -_*!。

     

    wsksec@gmail.com Pressing on Toward the Goal
  • 相关阅读:
    Redis 配置为 Service 系统服务
    java.lang.IllegalStateException: The platform metadata area could not be written
    SpringCloud Gateway做熔断降级+限流
    Mac mysql修改my.cnf不起作用排查
    MailHealthIndicator javax.mail.MessagingException: Could not connect to SMTP host: smtp.qiye.aliyun.com, port: 25, response: -1
    Spring Cloud Gateway跨域配置
    一、Rancher单机搭建
    SpringCloud快速搭建微服务
    在Mac下为GUI程序设定环境变量
    Spring cache 使用说明
  • 原文地址:https://www.cnblogs.com/shuk-notes/p/4655979.html
Copyright © 2011-2022 走看看