平时总是弄得grub出错进不来系统,给我来个grub-rescue,我用livecd的Ubuntu进入系统后,重新安装grub到mbr,方法如下:

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

其中的boot目录就是挂载的boot分区,如果没有boot分区,那就是根目录

下面是安装文档的原文:

3.1 Installing GRUB using grub-install

For information on where GRUB should be installed on PC BIOS platforms,see BIOS installation.

In order to install GRUB under a UNIX-like OS (suchas gnu), invoke the programgrub-install (seeInvoking grub-install) as the superuser (root).

The usage is basically very simple. You only need to specify oneargument to the program, namely, where to install the boot loader. Theargument has to be either a device file (like ‘/dev/hda’). For example, under Linux the following will install GRUB into the MBRof the first IDE disk:

     # grub-install /dev/hda

Likewise, under GNU/Hurd, this has the same effect:

     # grub-install /dev/hd0

But all the above examples assume that GRUB should put images underthe /boot directory. If you want GRUB to put images under a directoryother than/boot, you need to specify the option--boot-directory. The typical usage is that you create a GRUBboot floppy with a filesystem. Here is an example:

     # mke2fs /dev/fd0
# mount -t ext2 /dev/fd0 /mnt
# mkdir /mnt/boot
# grub-install --boot-directory=/mnt/boot /dev/fd0
# umount /mnt

Some BIOSes have a bug of exposing the first partition of a USB drive as afloppy instead of exposing the USB drive as a hard disk (they call it“USB-FDD” boot). In such cases, you need to install like this:

     # losetup /dev/loop0 /dev/sdb1
# mount /dev/loop0 /mnt/usb
# grub-install --boot-directory=/mnt/usb/bugbios --force --allow-floppy /dev/loop0

This install doesn't conflict with standard install as long as they are inseparate directories.

Note that grub-install is actually just a shell script and thereal task is done bygrub-mkimage andgrub-setup. Therefore, you may run those commands directly to install GRUB, withoutusinggrub-install. Don't do that, however, unless you are veryfamiliar with the internals of GRUB. Installing a boot loader on a runningOS may be extremely dangerous.

Installing GRUB using grub-install相关推荐

  1. 开机黑屏且显示the GNU GRUB version grub>命令行解决办法

    开机黑屏且显示the GNU GRUB version grub>命令行解决办法 开机黑屏且显示the GNU GRUB version 2.02~beta2-36ubuntu2 minimal ...

  2. 格式化linux grub,linux grub 引导启动过程详解

    机器加电启动后,BIOS开始检测系统参数,如内存的大小,日期和时间,磁盘 设备以及这些磁盘设备用来引导的顺序,通常情况下,BIOS都是被配置成首先检查 软驱或者光驱(或两者都检查),然后再尝试从硬盘引 ...

  3. 服务器开机修改grub,修改 grub

    修改 grub 内容精选 换一换 @[TOC](联想 Yoga 14s 2021 (Intel) 安装 ubuntu) 新设备最容易遇到驱动问题.Yoga 14s 2021 安装ubuntu就遇到了屏 ...

  4. 双linux grub rescue,Grub Rescue修复方法

    症状: 开机显示:GRUB loading error:unknow filesystem grub rescue> 原因: 已经发现下面几种操作会导致这种问题: 1,想删除ubuntu,于是直 ...

  5. linux grub 下载,GRUB 2.04发布下载,附新功能介绍

    GRUB 2.04版本发布了,它是在GRUB 2.02/2.00的基础上更新的,GRUB 2.02是目前使用得最多的多重启动管理器,全称为GRand Unified Bootloader,使用它可以引 ...

  6. linux grub 串口,grub重定向到串口 - Emmoblin Blog

    将GRUB输出重定向到串口(Edit /boot/grub/grub.conf) serial --unit=0 --speed=115200 --word=8 --parity=no --stop= ...

  7. 卸载linux grub rescue,Grub Rescue 修复方法

    症状: 开机显示:GRUB loading error:unknow filesystem grub rescue> 原因: 由于操作者不知道grub2分为两部分,一部分(一般情况下)写在了mb ...

  8. linux gnu grub,GNU GRUB命令的使用方法与GNU GRUB详细介绍

    先使用ls命令,找到Ubuntu的安装在哪个分区: grub>ls 会罗列所有的磁盘分区信息,比方说: (hd0,1),(hd0,5),(hd0,3),(hd0,2) 然后依次调用如下命令: X ...

  9. 【Grub】Grub引导的安装配置

    Grub引导是安装Linux经常需要的东西,有时无法进入linux系统了,也没有安装镜像,那么也可以用Grub来进入系统,修复grub2引导.   Grub安装步骤 一.下载必备软件 软件主要有2个: ...

  10. ubuntu 16.04(Windows 10双系统+grub引导)无法进入tt1~tt6(NVIDIA驱动安装相关-黑屏,login loop,分辨率)...

    目录 前言回顾 最终解决: 0.关闭x服务 1.禁用nouveau 2.加入 3.更新 4.查找匹配驱动 5.选择推荐版本 6.等待安装后重启,nvidia-smi查看是否安装成功,或者lsmod | ...

最新文章

  1. 计算机基本水平测试内容,浙江师范大学计算机基础水平测试大纲(2018级新生使用)...
  2. *** FATAL ERROR: too many grib files .. 1st=F:\data\预测数据 2nd=- ***
  3. 修改Apache的默认站点目录的方法,需要的朋友可以参考下
  4. 数据同步的解决方案Canal
  5. ansible 容器部署_如何使用Ansible Container管理Linux容器
  6. Android开发学习之路-带文字的图片分享
  7. MDK5如何生成bin文件
  8. 程序猿的中秋节——浪漫至死不渝!!
  9. 如何实现一个安全的Web登陆
  10. html+css简单的实现360搜索引擎首页面
  11. 手机软件自动化测试探索
  12. 色相 色调_如何使用色相调光器开关控制飞利浦色相灯
  13. mac 命名 报错 请尝试使用字符较少,或不含标点符号的名称。
  14. 网易云课堂---布尔教育《8小时学会html》 笔记
  15. 射线法判断点是否在多边形内-JAVA
  16. PHP加密函数与解密函数详解
  17. 成功解决:由于找不到 MSVCP100D.dll, 无法继续执行代码。重新安装可能会解决此问题。
  18. 总裁演说思维应用:坚持用讲故事五步训练法,练好口才并不难!
  19. 浅谈设计模式 | 先有鸡还是先有蛋?先有代码后有设计模式还是先有设计模式再写代码?
  20. 关于文件夹和快捷方式

热门文章

  1. 实验三在git上操作遇到的一些问题
  2. 【2016-2017】陪伴是最长情的告白
  3. 三星n8000Android,三星 N8000 刷机详细图文教程
  4. 【雅思听力做题方法,题型概述,练习方法总述】
  5. 7-10 接话茬 (25 分)
  6. 实现局部放大图片功能
  7. Struts2 OGNL标签
  8. 安阳工学院c语言期末考试题库,安阳工学院期末C语言答案.doc
  9. 长安大学计算机研究生报录比,2020年长安大学考研报录比
  10. centos6.x redis-cluster集群离线安装