056 popos with grub
This commit is contained in:
parent
50cb551e78
commit
f495bccbef
149
content/post/056.Popos&grub/056.md
Normal file
149
content/post/056.Popos&grub/056.md
Normal file
@ -0,0 +1,149 @@
|
||||
---
|
||||
title: "PopOS 20.04 安装 Grub 引导 Win 11 + Linux 双系统并配置主题"
|
||||
categories: [ "Linux" ]
|
||||
tags: [ "popos", "grub" ]
|
||||
draft: false
|
||||
slug: "popos-grub"
|
||||
date: "2021-12-30 23:29:00"
|
||||
---
|
||||
|
||||
## 前言
|
||||
|
||||
因为 PopOS 默认内置用的是 systemd 做的系统引导,systemd 仅适合单系统引导,双系统引导就无法完成,因为其无法识别在多个硬盘上的不同分区的引导加载器,除非将 Windows 分区上的 esp 文件复制到 Linux esp 下,新手不建议折腾,直接根据本教程安装 grub 引导即可。
|
||||
|
||||
|
||||
|
||||
## 目标
|
||||
|
||||
安装 Grub 引导器到 PopOS 系统上,并且成功引导双系统(Windows 11 + PopOS)
|
||||
|
||||
|
||||
|
||||
## 预置要求
|
||||
|
||||
- PopOS 20.04
|
||||
- Windows 10 / 11
|
||||
- 以上系统必须为 UEFI 引导,不能是传统 BIOS
|
||||
- Linux 下的具有 root 权限的用户
|
||||
|
||||
|
||||
|
||||
## 安装步骤
|
||||
|
||||
### 更新 & 安装软件包
|
||||
|
||||
在安装前,将系统的软件包列表更新到最新版本
|
||||
|
||||
```shell
|
||||
sudo apt update -y && sudo apt upgrade -y
|
||||
```
|
||||
|
||||
安装 grub 和 grub-customizer 的软件包用于下面的步骤生成引导配置文件
|
||||
|
||||
```shell
|
||||
sudo apt install grub-efi grub2-common grub-customizer
|
||||
```
|
||||
|
||||
|
||||
|
||||
### 安装 grub 引导到系统
|
||||
|
||||
这一步将 grub 实际安装到引导分区中
|
||||
|
||||
```shell
|
||||
sudo grub-install
|
||||
```
|
||||
|
||||
出现如下提示则代表安装成功
|
||||
|
||||
> Installing for x86_64-efi platform.
|
||||
>
|
||||
> Installation finished. No error reported.
|
||||
|
||||
由于 grub 安装位置问题,需要将 grub.efi 复制到相应的文件夹并覆盖
|
||||
|
||||
```shell
|
||||
sudo cp /boot/grub/x86_64-efi/grub.efi /boot/efi/EFI/pop/grubx64.efi
|
||||
```
|
||||
|
||||
这一步没有任何的输出提示
|
||||
|
||||
|
||||
|
||||
### 使用 grub-customizer 配置
|
||||
|
||||
目前 grub 的配置文件中基本没有内容,需要通过 grub-customizer 来进行生成
|
||||
|
||||
|
||||
|
||||
打开 grub-customizer
|
||||
|
||||
```shell
|
||||
sudo grub-customizer
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
打开 grub-customizer 后点击 文件(F) / 更改环境(C)...
|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
做如下操作:
|
||||
|
||||
|
||||
|
||||
1. 将 OUTPUT_FILE 的值更改为 `/boot/efi/EFI/pop/grub.cfg`
|
||||
2. 勾选 `保存该配置`
|
||||
|
||||
|
||||
|
||||
完成后单击 `应用`
|
||||
|
||||
|
||||
|
||||
回到主界面后,稍等几秒后,单击 `保存` 保存配置文件,重启系统即可看到最原始界面的 grub 引导程序了,方向键选择要进入的系统按下回车即可引导
|
||||
|
||||
|
||||
|
||||
## 引导界面美化
|
||||
|
||||
grub 最著名的美化主题莫过于 **[vinceliuice / grub2-themes](https://github.com/vinceliuice/grub2-themes)** 这个仓库了
|
||||
|
||||
|
||||
|
||||
下载最新的 release 或者 git clone 下来,进入到文件夹,根据其 Github 说明,执行对应的指令即可
|
||||
|
||||
|
||||
|
||||
**使用说明(中文翻译)**
|
||||
|
||||
> 命令: `sudo ./install.sh [选项...]`
|
||||
>
|
||||
> | 选项: | 描述: |
|
||||
> | -------------------- | ------------------------------------------------------------ |
|
||||
> | -b, --boot | 安装 Grub 主题到 `/boot/grub/themes` 目录 |
|
||||
> | -t, --theme | 可安装主题选项(可多选) [tela/vimix/stylish/whitesur] (默认是 tela) |
|
||||
> | -i, --icon | 可安装图标选项(可多选) [color/white/whitesur] (默认是 color) |
|
||||
> | -s, --screen | 屏幕分辨率选项(可多选) [1080p/2k/4k/ultrawide/ultrawide2k] (默认是 1080p)" |
|
||||
> | -r, --remove [THEME] | 卸载指定的主题 |
|
||||
> | -h, --help | 显示这个帮助 |
|
||||
>
|
||||
> *如果没有提供过任何选项, 一个用户界面 `dialog` 会被显示*
|
||||
>
|
||||
> ### 案例:
|
||||
>
|
||||
> - 安装 Tela 主题 on 到 2k 分辨率的屏幕:
|
||||
> - `sudo ./install.sh -t tela -s 2k`
|
||||
> - 安装 Tela 主题到 /boot/grub/themes:
|
||||
> - `sudo ./install.sh -b -t tela`
|
||||
> - 卸载 Tela 主题:
|
||||
> - `sudo ./install.sh -r -t tela`
|
||||
|
||||
|
||||
|
BIN
content/post/056.Popos&grub/change-env.png
Normal file
BIN
content/post/056.Popos&grub/change-env.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 55 KiB |
BIN
content/post/056.Popos&grub/grub-customizer.png
Normal file
BIN
content/post/056.Popos&grub/grub-customizer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
BIN
content/post/056.Popos&grub/preview.png
Normal file
BIN
content/post/056.Popos&grub/preview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 922 KiB |
Loading…
x
Reference in New Issue
Block a user