ubuntu 16.04无法locate boot-repair的解决方法

2023-05-16

  1. ubuntu16.04.07加windows10后无法启动ubunu的问题
  2. 解决boot-repair的安装方法同样适用于ubuntu18.04 ubuntu20.01等系统不能启动的问题。
  3. 对boot-repair修复的原理进行分析

文章目录

    • 问题描述
      • 问题1
      • 问题2
    • 解决方法
    • boot-repair修复原理

问题描述

问题1

在首先安装windows10后,再次安装ubuntu能够正常启动两个系统。但在安装ubuntu16.04后再重新安装windows10(未动ubuntu分区)后无法启动ubuntu。

原因是windows安装过程中比较霸道,自行将ubuntu的引导破坏,需要重新安装/修复ubuntu的引导

问题2

在安装boot-repair时出现找不到包,无法定位到boot-repair包的问题

ubuntu@ubuntu:/etc/apt/sources.list.d$ sudo apt-get install boot-repair
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package boot-repair

解决方法

参考文https://blog.csdn.net/Q_upup/article/details/103705100?spm=1001.2014.3001.5502进行ubuntu修复。进入ubuntu启动盘后,联网按照如下安装

sudo add-apt-repository ppa:yannubuntu/boot-repair #回车确认添加
sudo apt-get update
sudo apt-get install boot-repair
boot-repair

点击recommanded repair等待修复即可。
如果出现E: Unable to locate package boot-repair的问题,修改一下ppa的源即可
进入目录修改文件

cd /etc/apt/sources.list.d/
sudo gedit yannubuntu-ubuntu-boot-repair-xenial.list 

修改文件内容为如下(把xenial改成bionic,即更换一个ubuntu的发行版本号从16.04的xenial到18.04的bionic,推测可能是作者更新时遗漏或者什么问题, 可在网站http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu中看见各发行版本下内容其实是存在的)

deb http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu bionic main
# deb-src http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu bionic main

再次更新安装即可

sudo apt-get update
sudo apt-get install boot-repair
boot-repair

运行后点击recommand repair即可

boot-repair修复原理

对boot-repair的修复日志进行查看,可以知道其修复过程大致为以下几步

  1. 删除windows休眠文件(针对设置未快捷启动的windows)>
  2. Reinstall the grub-efi-amd64,
  3. 删除旧引导

以下为修复日志

boot-repair-4ppa130 [20211110_0629]

============================= Boot Repair Summary ==============================

mount -t ntfs-3g -o remove_hiberfile /dev/nvme0n1p3 /mnt/boot-sav/nvme0n1p3

Error code 14
mount -r /dev/nvme0n1p3 /mnt/boot-sav/nvme0n1p3

mount -t ntfs-3g -o remove_hiberfile /dev/nvme0n1p4 /mnt/boot-sav/nvme0n1p4

Error code 14
mount -r /dev/nvme0n1p4 /mnt/boot-sav/nvme0n1p4

mount -t ntfs-3g -o remove_hiberfile /dev/nvme0n1p5 /mnt/boot-sav/nvme0n1p5

Error code 14
mount -r /dev/nvme0n1p5 /mnt/boot-sav/nvme0n1p5

mount -t ntfs-3g -o remove_hiberfile /dev/nvme0n1p3 /mnt/boot-sav/nvme0n1p3

Error code 14
mount -r /dev/nvme0n1p3 /mnt/boot-sav/nvme0n1p3

Windows is hibernated, refused to mount.
Failed to mount ‘/dev/nvme0n1p3’: Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the ‘ro’ mount option.
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount ‘/dev/nvme0n1p3’: Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the ‘ro’ mount option.
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount ‘/dev/nvme0n1p4’: Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the ‘ro’ mount option.
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount ‘/dev/nvme0n1p4’: Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the ‘ro’ mount option.
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount ‘/dev/nvme0n1p5’: Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the ‘ro’ mount option.
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount ‘/dev/nvme0n1p5’: Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the ‘ro’ mount option.

=================== /boot detected. Please check the options.

Recommended repair: ____________________________________________________________

The default repair of the Boot-Repair utility will reinstall the grub-efi-amd64-signed of
nvme0n1p8,
using the following options: nvme0n1p7/boot, nvme0n1p1/boot/efi,
Additional repair will be performed: unhide-bootmenu-10s win-legacy-basic-fix use-standard-efi-file

/boot added in nvme0n1p8/fstab
/boot/efi added in nvme0n1p8/fstab
Quantity of real Windows: 1
Mount nvme0n1p7 on /mnt/boot-sav/nvme0n1p8/boot
Mount nvme0n1p1 on /mnt/boot-sav/nvme0n1p8/boot/efi
No nvme0n1p8/boot/efi/efi/ ubuntu/mint folder

=============== Reinstall the grub-efi-amd64-signed of nvme0n1p8 ===============

grub-install --version
grub-install (GRUB) 2.02~beta2-36ubuntu3.27

efibootmgr -v from chroot before grub install
BootCurrent: 0014
Timeout: 0 seconds
BootOrder: 0001,0000,0016,0012,0013,0015,0014,0017
Boot0000* Windows Boot Manager HD(1,GPT,67360052-65b2-4fbd-8481-9eb139e75380,0x800,0x32000)/File(EFIMicrosoftBootbootmgfw.efi)WINDOWS…x…B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}…d……
Boot0001* ubuntu HD(2,GPT,38d944a8-455c-4bca-be79-ea1b996cbc43,0xe1800,0x32000)/File(EFIubuntugrubx64.efi)
Boot0010 Setup FvFile(721c8b66-426c-4e86-8e99-3457c46ab0b9)
Boot0011 Boot Menu FvFile(86488440-41bb-42c7-93ac-450fbf7766bf)
Boot0012* NVMe: HFM512GDHTNG-8310A PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)…2.LN…
Boot0013* ATA HDD: VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f602)
Boot0014* USB HDD: TOSHIBA TransMemory PciRoot(0x0)/Pci(0x14,0x0)/USB(12,0)3.!..3.G…A…
Boot0015* USB FDD: VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,6ff015a28830b543a8b8641009461e49)
Boot0016* USB CD: VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,86701296aa5a7848b66cd49dd3ba6a55)
Boot0017* USB LAN: VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,e854bca4cae7704ca322b00da0376322)

uname -r
4.15.0-112-generic

grub-install --efi-directory=/boot/efi --target=x86_64-efi --uefi-secure-boot
Installing for x86_64-efi platform.
Installation finished. No error reported.
df /dev/nvme0n1p1
mv /mnt/boot-sav/nvme0n1p8/boot/efi/EFI/Boot/bootx64.efi /mnt/boot-sav/nvme0n1p8/boot/efi/EFI/Boot/bkpbootx64.efi
cp /mnt/boot-sav/nvme0n1p8/boot/efi/EFI/ubuntu/grubx64.efi /mnt/boot-sav/nvme0n1p8/boot/efi/EFI/Boot/bootx64.efi

grub-install --efi-directory=/boot/efi --target=x86_64-efi --uefi-secure-boot
Installing for x86_64-efi platform.
Installation finished. No error reported.

efibootmgr -v from chroot after grub install
BootCurrent: 0014
Timeout: 0 seconds
BootOrder: 0001,0000,0016,0012,0013,0015,0014,0017
Boot0000* Windows Boot Manager HD(1,GPT,67360052-65b2-4fbd-8481-9eb139e75380,0x800,0x32000)/File(EFIMicrosoftBootbootmgfw.efi)WINDOWS…x…B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}…d……
Boot0001* ubuntu HD(1,GPT,67360052-65b2-4fbd-8481-9eb139e75380,0x800,0x32000)/File(EFIubuntugrubx64.efi)
Boot0010 Setup FvFile(721c8b66-426c-4e86-8e99-3457c46ab0b9)
Boot0011 Boot Menu FvFile(86488440-41bb-42c7-93ac-450fbf7766bf)
Boot0012* NVMe: HFM512GDHTNG-8310A PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)…2.LN…
Boot0013* ATA HDD: VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f602)
Boot0014* USB HDD: TOSHIBA TransMemory PciRoot(0x0)/Pci(0x14,0x0)/USB(12,0)3.!..3.G…A…
Boot0015* USB FDD: VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,6ff015a28830b543a8b8641009461e49)
Boot0016* USB CD: VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,86701296aa5a7848b66cd49dd3ba6a55)
Boot0017* USB LAN: VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,e854bca4cae7704ca322b00da0376322)

chroot /mnt/boot-sav/nvme0n1p8 update-grub
Generating grub configuration file …
Found linux image: /boot/vmlinuz-4.15.0-112-generic
Found initrd image: /boot/initrd.img-4.15.0-112-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
Windows is hibernated, refused to mount.
Failed to mount ‘/dev/nvme0n1p3’: Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the ‘ro’ mount option.
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount ‘/dev/nvme0n1p3’: Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the ‘ro’ mount option.

Boot successfully repaired.

You can now reboot your computer.

Please do not forget to make your UEFI firmware boot on the Ubuntu 16.04.7 LTS entry (nvme0n1p1/EFI/ubuntu/grubx64.efi file) !
If your computer reboots directly into Windows, try to change the boot order in your UEFI firmware.

If your UEFI firmware does not allow to change the boot order, change the default boot entry of the Windows bootloader.
For example you can boot into Windows, then type the following command in an admin command prompt:
bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ubuntu 16.04无法locate boot-repair的解决方法 的相关文章

随机推荐

  • ESP8266深度学习之一初识设备

    一 ESP8266是什么 xff1f 总的来说ESP8266是一款单片机 xff0c 而且是一款自带WIFI功能的单片机 它是安信可公司众多单片机中的一种 xff0c 同时它也有很多种型号可以供我们选择使用 二 ESP8266有什么特点 x
  • 什么是RTK?

    国内习惯把GNSS接收机叫成RTK这倒是真的 xff0c 因为RTK技术的普及 xff0c 让大家对接收机的作用就 限定 在了RTK xff0c 在之前没有RTK时 xff0c 接收机就是接收机 目前 xff0c GNSSj接收机约99 的
  • STM32F103VCT6 高级定时器的PWM输出

    要求得到下列波形 xff0c 死区时间1us CH1和CH1之间的相位差事3us 频率50HZ 1 xff0c To get TIM1 counter clock at 72MHz the prescaler is computer as
  • 计算机视觉(相机标定;内参;外参;畸变系数)

    目录 一 预备知识 1 坐标系变换过程 xff08 相机成像过程 xff09 xff08 1 xff09 相机坐标系转换为图像坐标系 xff08 透视投影变换遵循的是针孔成像原理 xff09 xff08 2 xff09 齐次坐标的引入原因
  • ROS基础(2)——工作空间

    一 工作空间 1 工作空间的概念 ros工作空间简单来说相当于工程或者项目 xff0c 编写ros程序之前 xff0c 首先需要创建ros工作空间 2 创建工作空间 span class token function mkdir span
  • Ubuntu18.04完整新手安装教程和分区设置

    作者PS xff1a 好久没关注blog了 xff0c 居然这么多同学看了这篇文章 xff1a xff09 注意注意 xff1a 以下是关键总结 xff1a 分区 xff1a 这三个就够了 xff1a xff0c home xff0c sw
  • ROS基础(4)——安装ROS相关软件包

    一 ROS的两种安装方式 本章将会通过两种安装方式安装ROS相关软件包 分别是 xff1a 通过apt方式安装RoboWare Studio 通过下载源码编译的方式安装安装ROS Academy for Beginners教学包 这是两种常
  • arm与51单片机之间串口通信实验

    这几天弄arm的串口通信 xff0c 因为以前有点单片机的基础 xff0c 于是 就选了块51单片机与其实验 实验内容是在linux下编写好串口通信程序 xff0c 编译后下载到arm板上运行 xff0c 验证其可行性 linux下串口程序
  • ROS源代码阅读(8)——定位

    2021SC 64 SDUSC ROS源代码阅读 xff08 8 xff09 SLAM定位 xff1a 机器人定位的方法可以分为非自主定位与自主定位两大类 非自主定位是在定位的过程中机器人需要借助机器人本身以外的装置如 xff1a 全球定位
  • 博途V15

    西门子 博途V15仿真报错 WIN10虚拟机安装博途V15 xff0c 仿真时出现如下报错 无法找到STEP 7 V15许可证 开始以为是许可证问题 xff0c 找了18和19的Sim EKB Install进行激活 xff0c 但是并没有
  • Jetson TX2入门之开箱刷机跑demo

    Jetson TX2 开箱配置 43 刷机 43 跑demo xff08 常见坑总结 xff09 简介 JetSon系列是Nvidia公司推出的面向无人智能化领域的嵌入式平台 xff0c 这块嵌入式板子的出现使得我们可以在边缘设备上处理复杂
  • 集成显卡安装pytorch

    Inter集成显卡安装pytorch 安装pytorch 计算机右键 管理 gt 设备显示器 gt 显示适配器 xff0c 查看显卡 我的电脑只有Inter的集成显卡 xff0c 没有独显 刚开始接触 xff0c 对GPU不懂 xff0c
  • ROS可视化动态查看所有topic的频率/带宽/消息类型/数值

    在程序运行或者回放数据包时 xff0c 希望实时查看到所有的正在向外发送的topic名字 类型 带宽 频率 数值等 除了rostopic list以外还可使用rqt辅助包 打开rqt rqt 选择Plugins插件 Topics信息 top
  • PID与MPC控制方法

    记录udacity 无人驾驶工程师课程中控制部分 MPC代码和实践链接https github com udacity CarND MPC Quizzes 本文按照对udacity课程的理解和翻译而来 1 PID P xff1a Propo
  • C++STL容器及其优缺点介绍

    STL容器介绍及选择方式 容器类型容器优缺点一 序列容器vectordequelistforward list xff08 C 43 43 11 xff09 queuepriority queue stackarray 二 关联容器setm
  • word中插入noteExpress和页码出现乱码解决方法

    在word中出现页码变成PAGE MERGEFORMAT xff0c noteExpress插入的代码也变成了乱码 打开出问题的word文档 xff0c 按照如下设置 xff1a 文件 选项 高级 显示文档内容 不勾选显示域代码而非阈值 修
  • FreeRTOS内核实现04:空闲任务与阻塞延时

    目录 1 引入原因 2 实现空闲任务 2 1 定义空闲任务组件 2 2 创建空闲任务 3 实现阻塞延时 3 1 vTaskDelay函数实现 3 2 修改vTaskSwitchContext函数 3 3 SysTick初始化函数实现 3 4
  • NoteExpress对参考文献格式修改

    文章目录 NoteExpress格式修改1 将带DOI的模板另存为 Revised GBT 7714 20152 编辑自定义的nes文件3 保存选择使用 NoteExpress参考文献格式修改规则GTB 7714 2015下载 NoteEx
  • ubuntu Nvidia显卡驱动安装后 屏幕不能外接显示(扩展显示)的问题

    文章目录 结论安装历程问题详细描述解决方法 结论 配置文件 etc X11 xorg conf未正确配置 xff0c 安装历程 安装显卡驱动后 xff0c 依旧无法正常扩展屏幕显示 xff0c 仔细一看发现在nvidia smi时出现No
  • ubuntu 16.04无法locate boot-repair的解决方法

    ubuntu16 04 07加windows10后无法启动ubunu的问题解决boot repair的安装方法同样适用于ubuntu18 04 ubuntu20 01等系统不能启动的问题 对boot repair修复的原理进行分析 文章目录