# 【Linux】grub命令行引导进入windows系统

@[TOC](https://github.com/UnderTurrets/notes/blob/master/Linux/文章目录/README.md)

***

在卸载Linux系统后，有的小白可能会忘记删除Linux的EFI引导。这样的话，下次开机时就会自动进入grub的命令行，连windows系统都进不去了！本文提供了使用grub命令行进入win系统的急救方法。

## 1.grub命令行界面

如图所示，如果您没有删除Linux的EFI引导，那么您应该连win系统都启动不了，而会进入类似于下图所示的grub命令行界面：

![](https://cdn.jsdelivr.net/gh/UnderTurrets/ImageHosting@master/grub_interface.jpeg)

不要慌张，这并不意味着您的windows系统没了，只要三行命令，就可以重新启动您的win系统。

## 2.设置启动目录

首先，设置启动目录，一般来说总是`(hd0,gpt1)`，不放心的话，可以在输入为`set root=(hd0`时，按下`TAB`，这时会自动提示我们可能的结果。

查看这些结果，找到标签是`SYSTEM`的即可。

![](https://cdn.jsdelivr.net/gh/UnderTurrets/ImageHosting@master/grub_search.jpeg)

根据提示，我们确定了`(hd0,gpt1)`：

```shell
set root=(hd0,gpt1)
```

## 3.chainloader加载windows启动文件

windows的启动文件是`bootmgfw.efi`。一般来说，这个文件的路径总是`/efi/Microsoft/Boot/bootmgfw.efi`，不放心的同样可以键入`TAB`查看当前目录。

![](https://cdn.jsdelivr.net/gh/UnderTurrets/ImageHosting@master/grub_bootmgfw.jpeg) 找到之后加载：

```shell
chainloader /efi/Microsoft/Boot/bootmgfw.efi
```

加载完成之后出现`/EndEntire`：

## 4.启动

```shell
boot
```

成功进入win系统！

## 5.grub命令行无响应办法

有时，您的grub命令行可能会无响应，此时不需要长按电源键重启。只需要按下`Ctrl`+`Alt`+`Delete`就可以重启。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hanxu.gitbook.io/blogs/linux/linuxgrub-ming-ling-xing-yin-dao-jin-ru-windows-xi-tong.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
