Ubuntu and many other Linux distributions use the GRUB2 boot loader. If GRUB2 breaks—for example, if you install Windows after installing Ubuntu, or overwrite your MBR—you won’t be able to boot into Ubuntu.

You can easily restore GRUB2 from a Ubuntu live CD or USB drive. This process is different from restoring the legacy GRUB boot loader on older Linux distributions.

This process should work on all versions of Ubuntu. It’s been tested on Ubuntu 16.04 and Ubuntu 14.04.

 
 

The Graphical Method: Boot Repair

RELATED ARTICLE

aaarticlea/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wAARCABQAHgDASIAAhEBAxEB/8QAHQAAAgIDAQEBAAAAAAAAAAAAAwQAAgUGCAEHCf/EAD0QAAIBAwIEBAMFBgMJAAAAAAECAwAEEQUhBhIxQQcTUWEiMnEUQoGhwSOEkbHC0RUXMyRVZYKDhbO00v/EABwBAAIDAQEBAQAAAAAAAAAAAAECAAMEBQYHCP/EAC8RAAIBAgIHBwQDAAAAAAAAAAABAgMRBBIFExQhUVKhIjFDU2GB0RUWI5FCkrH/2gAMAwEAAhEDEQA/AM813ZRH9pME2ByQe/SmBd2iqrF25WxjCNvlgo2xnqRWQl0yya4cvbwynm+YoCTjoc0Y2Nu787wRs3Ly5KjPLnOPpneunc5pjpL6whlMctykbgsOVtieUZP5U/CiyxrIhyrDIPsaINMsi5c2sJdiSx5Bkk7GmobdIoliiRURQAqqMAUjZYhYQ7VYQ7U35dWWOkuMKeSTUaD0p4J7VOT1FRMAgYMjpXnkAdqyJjz2ppbCExIxn5WfGF5epJPv7VYmAwRh326VUwnfNZa4tRGcBww5iOmDtjt+NXl08qpKPzYQNsPU4xRuCxgmgz2obw49/pWwyaSwDEzxDBYAZOTy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dJo2kP/qaXYtn1t1P6UtJw1w64PPoOlP8AWzjP6U31nSC8Umoov+Jw5/mlxFgZJ/CaT+9QeKevDsx/67/3rtqTg7hJ88/C2iN9bCI/00rLwLwS+7cI6Cf+3xf/ADRWndILxOiJs1HlOLj4qaz96Fz+8NUrseTw74CYnPBugH9wj/tUo/cGkfM6L4JstHlP/9k=" alt="" />

How to Boot Your Computer From a Disc or USB Drive

 

Boot Repair is a graphical tool that can repair GRUB2 with a single click. This is the ideal solution to boot problems for most users.

If you have the media you installed Ubuntu from, insert it into your computer, restart, and boot from the removable drive. If you don’t, download a Ubuntu live CD and burn it to a disc or create a bootable USB flash drive.

When Ubuntu boots, click “Try Ubuntu” to get a usable desktop environment.

Ensure you have an Internet connection before continuing. You may need to choose a Wi-Fi network and enter its passphrase.

Open a Terminal window from the Dash and run the following commands to install and launch Boot Repair:

sudo apt-add-repository ppa:yannubuntu/boot-repair

sudo apt-get update

sudo apt-get install -y boot-repair

boot-repair

The Boot Repair window will automatically scan your system after you run the boot-repair command. After it scans your system, click the “Recommended repair” button to repair GRUB2 with a single click.

You can choose to use the advanced options here, but Ubuntu’s wiki recommends you not use the advanced options unless you know what you’re doing. The recommended repair option can fix most problems automatically, and you could mess up your system even more by selecting the wrong advanced options.

Boot Repair will begin working. It may ask you to open a Terminal and copy/paste a few commands into it.

 

Just follow the instructions that appear on your screen. Perform the instructions Boot Repair wants you to and click “Forward” to continue through the wizard. The tool will walk you through everything you need to do.

Restart your computer after the Boot Repair tool finishes applying its changes. Ubuntu should boot up normally.

The Terminal Method

If you’d rather get your hands dirty, you can do this yourself from a terminal. You’ll need to boot from a live CD or USB drive, as in the graphical method above. Ensure the version of Ubuntu on the CD is the same as the version of Ubuntu installed on your computer. For example, if you have Ubuntu 14.04 installed, ensure you use a Ubuntu 14.04 live CD.

Open a terminal after booting into the live environment. Identify the partition Ubuntu is installed on using one of the following commands:

sudo fdisk -l

sudo blkid

Here’s the output of both commands. In the fdisk -l command, the Ubuntu partition is identified by the word Linux in the System column. In the blkid command, the partition is identified by its ext4 file system.

If you have multiple Linux ext4 partitions, you can get an idea of which is which by viewing the size of the partitions and their order on the disk here.

Run the following commands to mount the Ubuntu partition at  /mnt/ubuntu, replacing/dev/sdX# with the device name of your Ubuntu partition from the above commands:

sudo mkdir /mnt/ubuntu

sudo mount /dev/sdX# /mnt/ubuntu

In the screenshot above, our Ubuntu partition is /dev/sda1. This means the first partition on the first hard disk device.

Important: If you have a separate boot partition, skip the above command and mount the boot partition at /mnt/ubuntu/boot instead. If you don’t know whether you have a separate boot partition, you probably don’t.

Run the following command to reinstall grub from the live CD, replacing /dev/sdX with the device name of the hard disk above. Omit the number. For example, if you used/dev/sda1 above, use /dev/sda here.

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

Restart your computer and Ubuntu should boot properly.

How to Repair GRUB2 When Ubuntu Won’t Boot的更多相关文章

  1. ubuntu下提示/boot空间不足,解决办法

    在安装 ubuntu的时候 , 给/boot文件目录分配空间的时候,是100M,/boot可以单独分成一个区,也可以不单独分,在/(根目录)下也会自动为其创建一个boot目录.顺便提一下,linux分 ...

  2. Ubuntu提示卷boot仅剩0字节的硬盘空间,解决办法

    查看当前安装的linux内核版本号 dpkg --get-selections |grep linux-image 查看当前使用的内核版本号 uname -a 卸载不需要的内核 sudo apt-ge ...

  3. 安装ubuntu时将boot目录单独挂载的意义

    只有一个意义那就是当你的情况是:单个硬盘里面安装多个系统. 如果不是这样,就别动它.

  4. Ubuntu升级出现/boot空间不足解决

    经常升级Linux内核,导致更新时警告/boot分区空间不足.这是以为多次升级内核后,导致内核版本太多,清理一下没用的内核文件就行了.命令如下: zht@zht-Ubuntu:~$ dpkg -l ' ...

  5. ubuntu更新提示/boot空间不足

    1. 查看当前使用的内核版本 uname -a 2.在终端下察看已经安装的旧的内核: ctrl+alt+t——>进入终端——>输入命令: dpkg --get-selections|gre ...

  6. Ubuntu升级出现/boot空间不足解决(转)

    经常升级Linux内核,导致更新时警告/boot分区空间不足.这是以为多次升级内核后,导致内核版本太多,清理一下没用的内核文件就行了.命令如下: zht@zht-Ubuntu:~$ dpkg -l ' ...

  7. ubuntu修改grub2

    转自修改系统启动项 grub2配置的方法 ubuntu 在早期的Ubuntu中,使用Grub作为系统的启动引导程序,想修改系统启动项非常简单,只要用gedit打开系统菜单设定文件( sudo gedi ...

  8. 修改系统启动项 grub2配置的方法 ubuntu[转]

    在 早期的Ubuntu中,使用Grub作为系统的启动引导程序,想修改系统启动项非常简单,只要用gedit打开系统菜单设定文件( sudo gedit /boot/grub/menu.lst ),修改该 ...

  9. 使用 boot-repair 对 Windows + Ubuntu 双系统引导修复

    问题描述:     由于在windows上进行更新/重装/修改了引导设置以后,windows会“自私”地重写引导,导致Ubuntu系统引导消失而无法选择Ubuntu启动.

随机推荐

  1. 【BZOJ2281】[SDOI2011]黑白棋(博弈论,动态规划)

    [BZOJ2281][SDOI2011]黑白棋(博弈论,动态规划) 题面 BZOJ 洛谷 题解 先看懂这题目在干什么. 首先BZOJ上面的题面没有图,换到洛谷看题就有图了. 不难发现都相邻的两个异色棋 ...

  2. 洛谷P4843 清理雪道

    题意:给你DAG,求最小路径边覆盖.路径可重. 解:首先可以想到边转点,发现有n²条边,果断超时. 有源汇有上下界最小流. 建图:每条边都建立一条边,流量限制为[1, 1]. 源点向每个点连边,因为都 ...

  3. 【洛谷P3469】BLO

    题目大意:给定 N 个点,M 条边的联通无向图,求出对于每个点来说,将与这个点相连的所有边都去掉后,会少多少个联通的点对 (x,y). 题解:连通性问题从 DFS 树的角度进行考虑.对于 DFS 树当 ...

  4. 【CF1076D】Edge Deletion 最短路+贪心

    题目大意:给定 N 个点 M 条边的无向简单联通图,留下最多 K 条边,求剩下的点里面从 1 号顶点到其余各点最短路大小等于原先最短路大小的点最多怎么构造. 题解:我们可以在第一次跑 dij 时直接采 ...

  5. 洛谷 P1880 [NOI1995] 石子合并(区间DP)

    传送门 https://www.cnblogs.com/violet-acmer/p/9852294.html 题解: 这道题是石子合并问题稍微升级版 这道题和经典石子合并问题的不同在于,经典的石子合 ...

  6. Educational Codeforces Round 42 (Rated for Div. 2) E. Byteland, Berland and Disputed Cities

    http://codeforces.com/contest/962/problem/E E. Byteland, Berland and Disputed Cities time limit per ...

  7. Java 多线程间通信

    JDK 1.5 以后, 将同步和锁封装成了对象, 并将操作锁的隐式方法定义到了该对象中, 将隐式动作变成了显示动作. Lock 接口 Lock 接口, 位于 java.util.concurrent. ...

  8. C# WinForm文章收集

    DataGridView 使用方法集锦 https://blog.csdn.net/zhaoyu_m69/article/details/70307934 关于DataGridView的一些操作(很全 ...

  9. 学习windows编程 day3 之窗口绘画一:点线绘制

    #include <windows.h> #include <math.h> LRESULT CALLBACK WndProc(HWND hwnd, UINT message, ...

  10. 谈谈你对MVC的理解

    MVC 模式 MVC 模式代表 Model-View-Controller(模型-视图-控制器) 模式.这种模式用于应用程序的分层开发. Model(模型) - 模型代表一个存取数据的对象或 JAVA ...