如何在 Linux 系统中访问 UEFI 设置
UEFI
![](/data/attachment/album/202212/19/092450oi0c0c7cp4ng2nem.jpg)


想要在固件级别检查启动顺序或电源设置？ **你可以在系统启动时按 `F2`、`F10` 或 `Del` 按键访问 UEFI 设置**。


这种方法的问题是你可能不知道确切的键，并且必须警惕在正确的时间按下这些键。


![Mr. Bean](/data/attachment/album/202212/19/092256nkeoyuou6h3ykud6.gif)


如果你不想像上面 Gif 中的憨豆先生，你可以从 Linux 中的 [Grub 引导加载器](https://itsfoss.com/what-is-grub/) 页面访问 UEFI 设置。


![uefi firmware settings grub linux](/data/attachment/album/202212/19/092517a6am6dlh6h3k6cyv.jpg)


当你打开 Linux 系统时，你会看到这个页面。Fedora 和 Ubuntu 等大多数 Linux 发行版都使用 Grub，它们允许你像这样从 Grub 页面访问 UEFI 设置。


如果你没有看到此页面，或你的发行版不使用 Grub 怎么办？ 仍然有一些方法可以从 Linux 中访问 UEFI 设置。


在你了解如何操作之前，请 [确保你的系统使用的是 UEFI](https://itsfoss.com/check-uefi-or-bios/)。


另一件重要的事情。你的系统重启才能进入 UEFI 设置。你无法从操作系统中访问和修改固件设置。


### 从 Linux 启动到 UEFI 设置


此方法仅适用于具有 systemd 的 Linux 发行版。这意味着这种方法适用于任何基于 Ubuntu、Debian、Fedora 和任何主流的基于 Arch 的发行版，包括 Manjaro 和 EndeavourOS。


[确保你的 Linux 发行版使用 systemd](https://linuxhandbook.com/check-if-systemd/) 仍然是一个好主意。使用给定的命令，如果它返回 systemd，你就可以开始了：



```
ps --no-headers -o comm 1

```

![how to know if i am using systemd on linux?](/data/attachment/album/202212/19/092453d7d7ss8p2ey8spzd.png)


当你发现你的发行版正在使用 systemd，你可以使用给定的命令启动到 UEFI 设置：



```
systemctl reboot --firmware-setup

```

让我首先分解使用的选项：


* `reboot`：顾名思义，它将重启你的系统。
* `--firmware-setup`: 当此选项与 `reboot` 一起使用时，它会指示系统固件启动进入固件设置界面。


就是这样！ 一个命令，你将进入 UEFI 设置。我知道 Windows 允许 [从 Windows 中启动进入 UEFI 固件设置](https://itsfoss.com/access-uefi-settings-windows-10/)。很高兴在 Linux 中看到类似的东西。


#### 创建桌面快捷方式以启动到 UEFI 设置（可选）


如果你经常发现自己启动进入 UEFI 设置，并且不记得所有命令，你可以通过创建桌面快捷方式让你的生活更轻松。这将使你可以通过单击桌面图标启动到 UEFI。


不过，对于大多数 Linux 用户来说，这是不必要的，也不是必需的。只有当你觉得有必要时才去做。该方法需要 [在命令行中编辑文件](https://learnubuntu.com/edit-files-command-line/)。


首先，使用给定的命令为 UEFI 设置创建桌面快捷方式文件：



```
sudo nano /usr/share/applications/uefi-reboot.desktop

```

并将以下内容粘贴到文件中：



```
[Desktop Entry]
Name=UEFI Firmware Setup (Reboot)
Comment=Access the motherboard configuration utility
Exec=systemctl reboot --firmware-setup
Icon=system-restart
Terminal=false
Type=Application
Categories=System;Settings;

```

![create a desktop shortcut to boot into uefi settings](/data/attachment/album/202212/19/092453opvg3q7fzzfkqsqd.png)


完成后，[保存更改并退出 nano](https://linuxhandbook.com/nano-save-exit/) 文本编辑器。


现在，你将在系统菜单中找到 UEFI 固件设置的快捷方式：


![boot into uefi firmware from system menu](/data/attachment/album/202212/19/092453ky0q2b00rrde6q3r.png)


完成了！一种进入 UEFI 设置的巧妙方法。


### 总结


访问启动设置的经典方法对某些人来说可能有点不方便。Grub 页面可能不会显示旧版本的 UEFI 选项。


这就是 systemd 方法的亮点所在。当我的系统崩溃并且我的功能键没有响应时，我发现这种方法是救命稻草，这是启动到 UEFI 所必需的（我当时就是这么想的！）。


我希望你发现它同样有用。




---


via: <https://itsfoss.com/access-uefi-from-linux/>


作者：[Sagar Sharma](https://itsfoss.com/author/sagar/) 选题：[lkxed](https://github.com/lkxed) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

Want to check the boot order or the power settings at the firmware level? **You can access the UEFI settings by pressing the F2, F10, or Del buttons when your system boots**.

The problem with this approach is that you may not know the exact key and must be alert about pressing those keys at the right time.

If you don’t want to feel like Mr. Bean in the above Gif, you can access the UEFI settings from the [Grub bootloader](https://itsfoss.com/what-is-grub/) screen in Linux.

![uefi firmware settings grub linux](https://itsfoss.com/content/images/wordpress/2022/12/uefi-firmware-settings-grub-linux.webp)

You see this screen when you turn on your Linux system. Most Linux distributions like Fedora and Ubuntu use Grub and they allow you to access the UEFI settings from the Grub screen like this.

What if you don’t see this screen or your distro doesn’t use Grub? There are still ways to access UEFI settings from within Linux.

Before you see how to do that, please [ensure that your system uses UEFI](https://itsfoss.com/check-uefi-or-bios/).

**Your system will reboot into UEFI settings.**You cannot access and modify the firmware settings from within an operating system.

## Boot into UEFI settings from Linux

This method will only work on Linux distros having systemd. This means this method will work on anything based on Ubuntu, Debian, Fedora, and any mainstream Arch-based distros, including Manjaro and EndeavourOS.

It is still a good idea to [ensure that your Linux distro uses systemd](https://linuxhandbook.com/check-if-systemd/?ref=itsfoss.com). Use the given command and if it returns systemd you are good to go:

`ps --no-headers -o comm 1`


![how to know if i am using systemd on linux?](https://itsfoss.com/content/images/wordpress/2022/12/how-to-know-if-i-am-using-systemd-on-linux.png)

*systemd*

Once you figure out that your distro is utilizing systemd, you can use the given command to boot into UEFI settings:

`systemctl reboot --firmware-setup`


Let me break down the used options first:

`reboot`

: As its name suggests, it will reboot your system.`--firmware-setup`

: When this option is used along with 'reboot', it will indicate the system’s firmware to boot into the firmware setup interface.

Yup, that was it! A single command and you will be kicked into UEFI settings. I know Windows allows [booting into UEFI firmware settings from within Windows](https://itsfoss.com/access-uefi-settings-windows-10/). It’s good to see something similar in Linux as well.

### Create a desktop shortcut to boot into UEFI settings (optional and for experts)

If you often find yourself booting into the UEFI settings and don’t always remember the command, you can make your life easier by creating a desktop shortcut. This will let you boot into UEFI by clicking on the desktop icon.

[editing files in the command line](https://learnubuntu.com/edit-files-command-line/?ref=itsfoss.com).

First, use the given command to create a desktop shortcut file for UEFI settings:

`sudo nano /usr/share/applications/uefi-reboot.desktop`


And paste the following content in the file:

```
[Desktop Entry]
Name=UEFI Firmware Setup (Reboot)
Comment=Access the motherboard configuration utility
Exec=systemctl reboot --firmware-setup
Icon=system-restart
Terminal=false
Type=Application
Categories=System;Settings;
```


![create a desktop shortcut to boot into uefi settings](https://itsfoss.com/content/images/wordpress/2022/12/create-a-desktop-shortcut-to-boot-into-uefi-settings.png)

Once done, [save the changes and exit from the nano](https://linuxhandbook.com/nano-save-exit/?ref=itsfoss.com) text editor.

And now, you will find the shortcut for UEFI Firmware Setup in your system menu:

![boot into uefi firmware from system menu](https://itsfoss.com/content/images/wordpress/2022/12/boot-into-uefi-firmware-from-system-menu.png)

That’s it! A neat way to get into UEFI settings.

## Wrapping Up

The classic ways of accessing the boot settings may be a little inconvenient for some people. The grub screen may not show the UEFI option for older versions.

And this is where the systemd method shines. I found this method a lifesaver when my system crashed and my function keys were not responding, which are necessary to boot into UEFI (that’s what I thought then!).

I hope you find it equally helpful.