20250605使用boot-repair来恢复WIN10和ubuntu22.04.6双系统的启动

rootroot@rootroot-X99-Turbo:~ sudo apt-get install boot-repair rootroot@rootroot-X99-Turbo:\~ sudo add-apt-repository ppa:yannubuntu/boot-repair
rootroot@rootroot-X99-Turbo:~$ sudo apt-get install boot-repair

20250605使用boot-repair来恢复WIN10和ubuntu22.04.6双系统的启动

2025/6/5 15:35

缘起:微星X99的主板,按照国际惯例,先安装WIN10,然后再安装ubuntu20.04.6作为编译服务器!

现在发现,上电之后直接进WIN10系统。

在上电的时候,黑屏的过程中就要不停地按F11,可以出现选择菜单/启动选项,这时候你才能够选择启动ubuntu。

在ubuntu启动的过程中:在ubuntu启动菜单中有WIN系统的选项!

最初判定为:启动损坏?由于是编译服务器,不敢乱动。就凑合用吧!

终于等在不太忙的时候,决定开始解决问题。

安装boot-repair没有解决引导的问题,但是解决了一个开机的时候就出现的错误的问题。

具体原因是否是因为引导导致的异常未知了!【大概率是引导异常导致的吧!】

【最终解决方法】在BIOS中配置引导菜单就搞定了!
以前安装双系统的时候,貌似主板BIOS/ubuntu系统他来就自动解决好引导问题。
也有可能是因为这片主板太老了/过于经典了!
有些不好使了吧?^_

CSDN:双系统重装WIN后找不到ubuntu的恢复启动操作

参考资料:

https://blog.csdn.net/orDream/article/details/80969717?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522f06bfedb24fc6f5eb1d4936787a12121%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D\&request_id=f06bfedb24fc6f5eb1d4936787a12121\&biz_id=0\&utm_medium=distribute.pc_search_result.none-task-blog-2\~all\~first_rank_ecpm_v1\~rank_v31_ecpm-1-80969717-null-null.142\^v102\^pc_search_result_base6\&utm_term=双系统重装WIN后找不到ubuntu的恢复启动操作\&spm=1018.2226.3001.4187

https://blog.csdn.net/orDream/article/details/80969717

双系统下重装win后找不到Ubuntu的恢复启动操作

或许,这就是梦想吧!

已于 2024-10-26 15:19:38 修改

在网上找了很多种方法,比如用 easyBCD啊,但是这个在 uefi 情况下他不适用啊,怎么办呢?

好吧,既然不能用,那就找一种更简单的方法吧。。。

那就是

用Boot-repair修复双系统引导

连接网络后我们打开终端,依次输入下面的内容,每行之后都要按回车

sudo -i

add-apt-repository ppa:yannubuntu/boot-repair && apt-get update

apt-get install -y boot-repair && boot-repair

第一行表示进入root账户模式

第二行添加软件源并更新系统

第三行为安装boot-repair并在安装完成后启动软件。

我们点击第一个选项Recommended repair

剩下的软件会自己操作,不需要人为干预

根据电脑配置的不同,花费的时间不等。趁着空当不如去喝杯咖啡。

等待修复完成,我们重启。

会出现这么多的选项,这都不是问题了,删掉一些就好了,关键是我们找回了Ubuntu系统。

好的,现在进行删除多余选项操作。

su     # 获取root权限

cp /boot/grub/grub.cfg /boot/grub/grub.cfg_backup  #先备份一下

cat /boot/grub/grub.cfg > tmp  #将内容重定向到其他文件,便于修改

gedit tmp  #或者vim tmp

#将下面这些内容全部删掉

### BEGIN /etc/grub.d/25_custom ###

menuentry "Windows UEFI bootmgfw.efi" {

search --fs-uuid --no-floppy --set=root 84F5-6727

chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi

}

menuentry "Windows Boot UEFI loader" {

search --fs-uuid --no-floppy --set=root 84F5-6727

chainloader (${root})/EFI/Boot/bkpbootx64.efi

}

...

menuentry "Windows Boot UEFI recovery bkpbootx64.efi" {

search --fs-uuid --no-floppy --set=root 5686-D913

chainloader (${root})/efi/Boot/bkpbootx64.efi

}

END /etc/grub.d/25_custom

其实就是删掉对应的中间那几项

删掉之后再:

cat tmp > /boot/grub/grub.cfg

reboot

OK!

【完整的LOG:】

BEGIN\] 2025/6/5 10:36:14 \[sudo\] password for rootroot: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package boot-repair rootroot@rootroot-X99-Turbo:\~$ rootroot@rootroot-X99-Turbo:\~$ rootroot@rootroot-X99-Turbo:\~$ sudo add-apt-repository ppa:yannubuntu/boot-repair Simple tool to repair frequent boot problems. Website: https://sourceforge.net/p/boot-repair/home More info: https://launchpad.net/\~yannubuntu/+archive/ubuntu/boot-repair Press \[ENTER\] to continue or Ctrl-c to cancel adding it. Get:1 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu focal InRelease \[18.3 kB

Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [128 kB]

Get:6 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu focal/main i386 Packages [1,824 B]

Get:7 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu focal/main amd64 Packages [1,824 B]

Get:8 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu focal/main Translation-en [1,592 B]

Get:9 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [3,564 kB]

Hit:10 http://th.archive.ubuntu.com/ubuntu jammy InRelease

Get:11 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages [881 kB]

Get:12 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [518 kB]

Get:13 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [74.9 kB]

Get:14 http://security.ubuntu.com/ubuntu focal-security/restricted i386 Packages [42.5 kB]

Get:15 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [3,768 kB]

Get:16 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [527 kB]

Get:17 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 DEP-11 Metadata [212 B]

Get:18 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [1,040 kB]

Get:19 http://security.ubuntu.com/ubuntu focal-security/universe i386 Packages [698 kB]

Get:20 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [221 kB]

Get:21 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [160 kB]

Get:22 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [26.6 kB]

Get:23 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [940 B]

Hit:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal InRelease

Get:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates InRelease [128 kB]

Get:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports InRelease [128 kB]

Get:24 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main i386 Packages [1,114 kB]

Get:25 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 Packages [3,954 kB]

Get:26 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main Translation-en [601 kB]

Get:27 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 DEP-11 Metadata [276 kB]

Get:28 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/restricted amd64 Packages [3,922 kB]

Get:29 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/restricted Translation-en [548 kB]

Get:30 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/restricted amd64 DEP-11 Metadata [212 B]

Get:31 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/universe i386 Packages [824 kB]

Get:32 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/universe amd64 Packages [1,262 kB]

Get:33 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/universe Translation-en [303 kB]

Get:34 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/universe amd64 DEP-11 Metadata [446 kB]

Get:35 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [940 B]

Get:36 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/main amd64 DEP-11 Metadata [7,996 B]

Get:37 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/restricted amd64 DEP-11 Metadata [216 B]

Get:38 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/universe amd64 DEP-11 Metadata [30.5 kB]

Get:39 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/multiverse amd64 DEP-11 Metadata [212 B]

Fetched 25.2 MB in 37s (686 kB/s)

Reading package lists... Done

rootroot@rootroot-X99-Turbo:~$

rootroot@rootroot-X99-Turbo:~$

rootroot@rootroot-X99-Turbo:~$ sudo apt-get install boot-repair

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following packages were automatically installed and are no longer required:

chromium-codecs-ffmpeg-extra gstreamer1.0-vaapi libgstreamer-plugins-bad1.0-0 libjs-underscore libnvidia-cfg1-535 libnvidia-common-535 libnvidia-decode-535 libnvidia-encode-535 libnvidia-extra-535 libnvidia-fbc1-535

libnvidia-gl-535 libva-wayland2 libx11-xcb1:i386 libxnvctrl0 nvidia-compute-utils-535 nvidia-kernel-source-535 nvidia-settings nvidia-utils-535 screen-resolution-extra xserver-xorg-video-nvidia-535

Use 'sudo apt autoremove' to remove them.

The following additional packages will be installed:

boot-sav boot-sav-extra glade2script glade2script-python3 pastebinit

Suggested packages:

boot-info cryptsetup dmraid lvm2 mdadm os-uninstaller zfsutils-linux gir1.2-appindicator3-0.1

The following NEW packages will be installed:

boot-repair boot-sav boot-sav-extra glade2script glade2script-python3 pastebinit

0 upgraded, 6 newly installed, 0 to remove and 1631 not upgraded.

Need to get 739 kB of archives.

After this operation, 3,365 kB of additional disk space will be used.

Do you want to continue? [Y/n] y

Get:1 http://th.archive.ubuntu.com/ubuntu jammy/main amd64 pastebinit all 1.5.1-1ubuntu1 [14.6 kB]

Get:2 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu focal/main amd64 glade2script-python3 all 3.2.4~ppa23 [35.9 kB]

Get:3 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu focal/main amd64 glade2script all 3.2.4~ppa23 [2,204 B]

Get:4 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu focal/main amd64 boot-sav all 4ppa2081 [521 kB]

Get:5 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu focal/main amd64 boot-repair all 4ppa2081 [17.5 kB]

Get:6 http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu focal/main amd64 boot-sav-extra all 4ppa2081 [147 kB]

Fetched 739 kB in 12s (60.0 kB/s)

Selecting previously unselected package glade2script-python3.

(Reading database ... 212472 files and directories currently installed.)

Preparing to unpack .../0-glade2script-python3_3.2.4~ppa23_all.deb ...

Unpacking glade2script-python3 (3.2.4~ppa23) ...

Selecting previously unselected package glade2script.

Preparing to unpack .../1-glade2script_3.2.4~ppa23_all.deb ...

Unpacking glade2script (3.2.4~ppa23) ...

Selecting previously unselected package boot-sav.

Preparing to unpack .../2-boot-sav_4ppa2081_all.deb ...

Unpacking boot-sav (4ppa2081) ...

Selecting previously unselected package boot-repair.

Preparing to unpack .../3-boot-repair_4ppa2081_all.deb ...

Unpacking boot-repair (4ppa2081) ...

Selecting previously unselected package boot-sav-extra.

Preparing to unpack .../4-boot-sav-extra_4ppa2081_all.deb ...

Unpacking boot-sav-extra (4ppa2081) ...

Selecting previously unselected package pastebinit.

Preparing to unpack .../5-pastebinit_1.5.1-1ubuntu1_all.deb ...

Unpacking pastebinit (1.5.1-1ubuntu1) ...

Setting up glade2script-python3 (3.2.4~ppa23) ...

Setting up glade2script (3.2.4~ppa23) ...

Setting up pastebinit (1.5.1-1ubuntu1) ...

Setting up boot-sav (4ppa2081) ...

Setting up boot-sav-extra (4ppa2081) ...

Setting up boot-repair (4ppa2081) ...

Processing triggers for mime-support (3.64ubuntu1) ...

Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...

Processing triggers for man-db (2.9.1-1) ...

Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...

rootroot@rootroot-X99-Turbo:~$

rootroot@rootroot-X99-Turbo:~$

https://chat.deepseek.com/a/chat/s/dc9e7c61-6e40-4507-9695-9a3b93727e33

修复Ubuntu20.04双系统启动问题

ubuntu20.04和win10的双系统 只能启动win10了 怎么修复?

修复 Ubuntu 20.04 和 Windows 10 双系统启动问题

如果你的双系统只能启动 Windows 10 而无法进入 Ubuntu,这通常是由于 GRUB 引导加载程序被覆盖或损坏导致的。以下是修复步骤:

方法一:使用 Ubuntu Live USB 修复 GRUB

准备 Ubuntu Live USB:

在另一台电脑上创建 Ubuntu 20.04 的启动U盘

从 Live USB 启动:

插入U盘,重启电脑

进入BIOS/UEFI设置(通常按F2、F12、Del等键)

选择从U盘启动

进入试用模式:

选择"Try Ubuntu"而不是安装

打开终端并执行以下命令:

bash

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

sudo apt update

sudo apt install -y boot-repair

boot-repair

在打开的Boot-Repair工具中选择"Recommended repair"

按照提示操作

方法二:手动修复 GRUB

如果上述方法无效,可以尝试手动修复:

从Live USB启动并进入试用模式

打开终端,执行:

bash

sudo fdisk -l

找到Ubuntu安装的分区(通常是ext4格式的分区,如/dev/sdaX)

挂载Ubuntu分区:

bash

sudo mount /dev/sdaX /mnt

(将X替换为你的实际分区号)

挂载必要的目录:

bash

sudo mount --bind /dev /mnt/dev

sudo mount --bind /proc /mnt/proc

sudo mount --bind /sys /mnt/sys

切换到Ubuntu环境:

bash

sudo chroot /mnt

重新安装GRUB:

bash

grub-install /dev/sda

update-grub

退出并重启:

bash

exit

sudo umount /mnt/dev /mnt/proc /mnt/sys

sudo umount /mnt

reboot

方法三:使用Windows启动管理器添加Ubuntu

如果GRUB完全无法修复,可以临时使用Windows启动管理器启动Ubuntu:

在Windows中打开管理员权限的CMD或PowerShell

执行:

powershell

bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

预防措施

为避免未来出现问题:

在Windows更新后检查启动选项

考虑备份EFI分区

使用sudo update-grub命令定期更新GRUB配置

如果以上方法都无法解决问题,可能需要考虑重新安装Ubuntu的引导程序或检查硬盘健康状况。

相关推荐
Leo.yuan15 分钟前
数据库同步是什么意思?数据库架构有哪些?
大数据·数据库·oracle·数据分析·数据库架构
Kookoos21 分钟前
ABP VNext 与 Neo4j:构建基于图数据库的高效关系查询
数据库·c#·.net·neo4j·abp vnext
云之兕1 小时前
MyBatis 的动态 SQL
数据库·sql·mybatis
gaoliheng0061 小时前
Redis看门狗机制
java·数据库·redis
?ccc?1 小时前
MySQL主从复制与读写分离
数据库·mysql
会飞的Anthony2 小时前
数据库优化实战分享:高频场景下的性能调优技巧与案例解析
数据库
潘yi.2 小时前
Redis哨兵模式
数据库·redis·缓存
行止63 小时前
MySQL主从复制与读写分离
linux·数据库·mysql
Htht1113 小时前
【Qt】之【Get√】【Bug】通过值捕获(或 const 引用捕获)传进 lambda,会默认复制成 const
数据库·bug