Introduction
解决双系统的 Windows 的启动项失踪和grub正常的情况下启动 Windows 系统出现黑屏的问题。
Note:
- 我的系统是
Ubuntu 24.04 LTS desktop
,安装了双系统(先安装 Win ,再安装 Ubuntu)
文章目录
Stage1: 我看不到任何让我选择系统的界面
假如你的安装顺序是先安装 Windows ,再安装 Ubuntu(安装时选择了为Windows安装) 的话,你可能很想先重启一下,看能不能正常进入 Windows 系统。
答案很明显,不能,你什么都没有看见,除了大概在左上角闪动了一下光标外,你什么都没有看见。
首先点出一个须知:GRUB(GRand Unified Bootloader)是 Linux 操作系统中广泛使用的一种引导加载程序 。
这里并不需要深究,只需要知道 Ubuntu 是使用 grub(确切来说,现在所用的是 grub2 ) 做引导,如果想要进一步了解的话,可以访问 https://www.pavelhan.tech/2024-06-21-BIOS-UEFI-MBR-GPTGRUB-EFI-Basics 看一看。
既然使用了 GRUB 来引导启动系统,且我们可以直接进入到 Ubuntu,这就说明我们的 GRUB 是正常工作的,为什么看不到 Windows 的启动项呢?答案就是被藏起来或者找不到了。
那么,怎么确定是哪种情况呢?这就要涉及到对 GRUB 的使用了。
Stage2: 对 GRUB 的文件的介绍,了解和编辑
对 GRUB 文件的概要介绍
首先,了解一下 GRUB 有哪些文件,以及它们存放的位置。
-
配置文件:
/etc/default/grub
If you change this file, run ‘update-grub’ afterwards to update
/boot/grub/grub.cfg.For full documentation of the options in this file, see:
info -f grub -n ‘Simple configuration’ -
可执行文件目录:
/etc/grub.d
All executable files in this directory are processed in shell expansion order.
00_*: Reserved for 00_header.
10_*: Native boot entries.
20_*: Third party apps (e.g. memtest86+).
The number namespace in-between is configurable by