rEFInd

出自 Arch Linux 中文维基

rEFInd 是一個 UEFI 能夠啟動 EFISTUB 內核的啟動管理器。它是 rEFIt (不再維護)的一個分支並且針對非 Mac 硬件修復了若干問題。它被設計為平台無關,可啟動多個作業系統。

注意: 整篇文章中 esp 代表 EFI system partition 的掛載點。

安裝[編輯 | 編輯原始碼]

安裝 refind 包。

安裝 rEFInd 啟動管理器[編輯 | 編輯原始碼]

rEFInd 附帶了實現了對 ReiserFS, Ext2, Ext4, Btrfs, ISO-9660 and HFS+ 只讀支持的 UEFI drivers。而且 rEFInd 能夠訪問任何 UEFI 本身能夠存取的文件系統,包括 FAT (由 UEFI 規範強制要求), 在 Mac 上的 HFS+ 和一些系統上的 ISO-9660。

額外的驅動可以參考 The rEFInd Boot Manager: Using EFI Drivers: Finding Additional EFI Drivers

為了使用 rEFInd, 務必將它安裝到 EFI 分區, 使用 rEFInd 安裝腳本或者手動複製文件並設置啟動入口.

警吿: 你的內核和 initramfs 必須在一個 rEFInd 能夠讀取的文件系統上。

以 rEFInd 安裝腳本安裝[編輯 | 編輯原始碼]

rEFInd 包含有一個 refind-install 腳本來簡化將你的 rEFInd 設置為默認 EFI 啟動項的過程。這個腳本有幾個選項用於處理不同的設置和 UEFI 實現。想要了解不同選項的含義,請參見 refind-install(8) 或者讀安裝腳本裏面的註釋。

對於許多系統來説,運行下面的命令就足夠了:

# refind-install

此操作會嘗試找到並掛載您的 ESP,將 rEFInd 的文件複製到 esp/EFI/refind/,並使用 efibootmgr 將 rEFInd 設置為默認的 UEFI 啟動項。

或者您可以將 rEFInd 安裝到默認/回退(fallback)啟動路徑 esp/EFI/BOOT/bootx64.efi。這對於可啟動的 USB 驅動器或者在那些 efibootmgr 做的 NVRAM 更改有問題的系統上會有幫助:

# refind-install --usedefault /dev/sdXY

其中 /dev/sdXY 是你的 EFI 分區 (塊設備, 不是掛載點).

提示:默認情況下 refind-install 只會為內核所在的文件系統安裝驅動。 其他的文件系統需要手動安裝,通過將 /usr/share/refind/drivers_x64/ 複製到 esp/EFI/refind/drivers_x64/, 或者你可以以 --alldrivers 選項安裝。 這對於可啟動的 USB 驅動器有幫助。

將 rEFInd 的文件安裝到 ESP 之後, 驗證 rEFInd 已經在你的內核所在文件夾創建了包含內核參數refind_linux.conf 文件。如果你用了 --usedefault 選項,該文件不會被創建,請以 root 身份運行 mkrlconf 來創建它。

警吿:refind-install 運行在chroot環境下 (例如:安裝Arch Linux時的live環境) /boot/refind_linux.conf 內將會添加live系統的內核選項,而不是安裝它的系統。

編輯 /boot/refind_linux.conf 並確保其中的 內核參數 對於你的系統是正確的,否則下次啟動可能會出現內核錯誤。

查看示例:rEFInd#refind_linux.conf

默認情況下,rEFInd 會掃描你的所有的驅動器(它有驅動的那些)並為它找到的每一個 EFI bootloader 添加一個啟動入口,其中就包含你的內核(因為 Arch 默認啟用了 EFISTUB )。因此你在這時候就可能有一個可以啟動的系統。

Secure Boot[編輯 | 編輯原始碼]

要在 rEFInd 中使用 Secure Boot,請參考 Managing Secure Boot

使用 PreLoader[編輯 | 編輯原始碼]

要獲取經過簽名的 PreLoader.efiHashTool.efi 二進制文件,請參考 Secure Boot#Set up PreLoader

--preloader /path/to/preloader 選項執行 refind-install

# refind-install --preloader /usr/share/preloader-signed/PreLoader.efi

當你下次以 Secure Boot 開啟狀態啟動時,HashTool 會啟動並讓你註冊 rEFInd (loader.efi) 、rEFInd 的驅動器 (如 ext4_x64.efi)和內核 (如 vmlinuz-linux) 的 hash。

更多信息參見 refind-install(8)

提示:經過簽名的 HashTool 只能夠訪問啟動它的分區。 這意味着如果你的內核不在 EPS 上, 你就不能從 HashTool 註冊它的 hash. 你可以使用 #KeyTool 來替代這種情況, 因為它可以將一個 hash 註冊到 MokList 並且不被限制在一個分區。在使用之前,請記住要先註冊 KeyTool 的 hash。
使用 shim[編輯 | 編輯原始碼]

安裝 shim-signedAUR。閱讀 Secure Boot#shim,但是跳過所有的文件複製。

使用 hash[編輯 | 編輯原始碼]

要只使用帶有 hash 的 shim,請以 --shim /path/to/shim 參數執行 refind-install

# refind-install --shim /usr/share/shim-signed/shimx64.efi

當你下次以 Secure Boot 開啟狀態啟動時, MokManager 會啟動並讓你註冊 rEFInd (loader.efi) 、rEFInd 的驅動器 (如 ext4_x64.efi)和內核 (如 vmlinuz-linux) 的 hash。

使用機器所有者密鑰(Machine Owner Key)[編輯 | 編輯原始碼]

要使用計算機所有者密鑰(MOK)對 rEFInd 進行簽名,請安裝 sbsigntools

提示:如果您已經創建了一個計算機所有者密鑰,則將文件命名為 refind_local.key(PEM 格式私鑰)、refind_local.crt (PEM 格式證書)和 refind_local.cer (DER 格式證書),並放置在/etc/refind.d/keys目錄中。

--shim /path/to/shim--localkeys 選項執行 refind-install

# refind-install --shim /usr/share/shim-signed/shimx64.efi --localkeys

refind-install 會為你創建密鑰並為它和它的驅動器簽名。你需要用同一個密鑰為內核簽名,如:

# sbsign --key /etc/refind.d/keys/refind_local.key --cert /etc/refind.d/keys/refind_local.crt --output /boot/vmlinuz-linux /boot/vmlinuz-linux
提示:內核簽名可以由 pacman 鈎子自動化, 參見 Secure Boot#Signing the kernel with a pacman hook

進入 MokManager 之後,將 refind_local.cer 添加到 MoKList。在 rEFInd 的安裝目錄下,如 esp/EFI/refind/keys/refind_local.cer,一個叫做 keys 的文件夾裏面可以找到 refind_local.cer

更多信息參見 refind-install(8)

使用你自己的密鑰[編輯 | 編輯原始碼]

跟隨 Secure Boot#Using your own keys 來創建密鑰。

創建目錄 /etc/refind.d/keys 並將 Signature Database (db) 密鑰和證書放在其中。 將文件命名為: refind_local.key (PEM 格式私鑰), refind_local.crt (PEM 格式證書) 和 refind_local.cer (DER 格式證書)。

在運行安裝腳本時添加 --localkeys 選項,如:

# refind-install --localkeys

rEFInd EFI 二進制文件將會被用提供的密鑰和證書籤名。

手動安裝[編輯 | 編輯原始碼]

提示: rEFInd 能夠以多種方式啟動 Linux。參見 The rEFInd Boot Manager: Methods of Booting Linux。本節將闡述使用 EFISTUB 的過程。
注意: 對於 32 位 EFI,請將 x64 替換為 ia32

如果 refind-install 腳本沒有正常工作,您可以手動設置 rEFInd。

首先,將可執行文件複製到 ESP:

# mkdir -p esp/EFI/refind
# cp /usr/share/refind/refind_x64.efi esp/EFI/refind/

如果想要將 rEFInd 安裝到默認/回退(fallback) 啟動路徑,請在下面將 esp/EFI/refind/ 替換為 esp/EFI/BOOT/,並將 rEFInd EFI 可執行文件複製到 esp/EFI/BOOT/bootx64.efi:

# mkdir -p esp/EFI/BOOT
# cp /usr/share/refind/refind_x64.efi esp/EFI/BOOT/bootx64.efi

然後使用 efibootmgr 來在 UEFI NVRAM 中創建一個啟動入口,其中 /dev/sdXY 是你的 EFI 分區的設備和分區號。如果你要將 rEFI 安裝到默認/回退(fallback) 啟動路徑 esp/EFI/BOOT/bootx64.efi,你可以跳過這一步。

# efibootmgr --create --disk /dev/sdX --part Y --loader /EFI/refind/refind_x64.efi --label "rEFInd Boot Manager" --verbose

此時,你應該能重啟到 rEFInd,但是它無法引導你的內核。如果你的內核不在你的 ESP 上,那麼 rEFInd 可以掛載你的分區來查找它,只要它具有正確的驅動程序即可。

rEFInd 會從其安裝目錄中的子目錄 driversdrivers_arch(例如 drivers_x64)自動加載所有驅動程序。

# mkdir esp/EFI/refind/drivers_x64
# cp /usr/share/refind/drivers_x64/drivername_x64.efi esp/EFI/refind/drivers_x64/

現在,rEFInd應該為你的內核提供了一個啟動項,但是不會傳遞正確的內核參數。設置#傳遞內核參數。現在,你應該可以使用 rEFInd 引導內核了。如果仍然無法啟動或想要調整 rEFInd 的設置,則可以使用配置文件來更改許多選項:

# cp /usr/share/refind/refind.conf-sample esp/EFI/refind/refind.conf

該示例配置文件具有很好的註釋並且不言自明。

除非你在配置文件中設置了textonly,否則你應該複製 rEFInd 的圖標以擺脱難看的佔位符:

# cp -r /usr/share/refind/icons esp/EFI/refind/

你可以嘗試通過複製不同的字體並更改 refind.conf 中的 font 設置來進行嘗試:

# cp -r /usr/share/refind/fonts esp/EFI/refind/
提示:在 rEFInd 中按 F10將會保存屏幕截圖到 ESP 分區的根目錄。

更新 rEFInd[編輯 | 編輯原始碼]

Pacman 只更新在 /usr/share/refind 中的文件,不會將新文件複製到 ESP。 如果最初 refind-install 成功安裝了 rEFInd,則可以再次運行以更新文件。 新的配置文件會被複製為 refind.conf-sample ,你可以使用一個 diff 工具選擇、改變合併到你的配置文件。如果你的 rEFInd 需要#手動安裝,你需要自己找出需要複製哪些文件。

Pacman 鈎子[編輯 | 編輯原始碼]

你可以使用一個 pacman 鈎子來自動化更新過程:

/etc/pacman.d/hooks/refind.hook
[Trigger]
Operation=Upgrade
Type=Package
Target=refind

[Action]
Description = Updating rEFInd on ESP
When=PostTransaction
Exec=/usr/bin/refind-install

你可能需要為你的設置將 Exec=更改為正確的更新命令。如果您進行了#手動安裝,則可以創建自己的更新腳本以使用鈎子進行調用。

提示:如果你使用 #Secure Boot 設置 rEFInd,則可能需要在 refind-install 命令中額外添加選項 --yes。如果在禁用 Secure Boot 後執行該命令,它將防止該命令失敗。更多信息參見 refind-install(8)
注意: 如果 ESP 未掛載到 /boot,而你依靠自動掛載來掛載它,請確保按照 EFI system partition#Alternative mount points 來預加載 vfat 模塊。否則,如果 refind與內核一起升級,ESP 將變得不可訪問。

配置[編輯 | 編輯原始碼]

rEFInd 的配置文件 refind.conf 存放在 rEFInd EFI 應用的同一目錄下(通常為 esp/EFI/refindesp/EFI/BOOT)。默認的配置文件包含了解釋了所有選項的擴展註釋,更詳細的解釋參考 Configuring the Boot Manager

傳遞內核參數[編輯 | 編輯原始碼]

有兩種方法可以設置 rEFInd 傳遞給內核的內核參數

對於 rEFInd 自動檢測到的內核[編輯 | 編輯原始碼]

對於自動檢測到的內核,你可以在 /boot/refind_linux.conf 中顯式指定內核參數,也可以依靠 rEFInd 識別 root 分區和內核參數的能力。更多信息參見Methods of Booting Linux: For Those With Foresight or Luck: The Easiest Method

提示:

為了使 rEFInd 支持 Arch Linux 內核的命名方案並因此使其與各自的 initramfs 鏡像相匹配,必須取消註釋並編輯 refind.conf 中的 extra_kernel_version_strings選項。例如:

esp/EFI/refind/refind.conf
...
extra_kernel_version_strings linux-hardened,linux-zen,linux-lts,linux
...
注意:
  • rEFInd 僅支持為每個內核檢測一個 initramfs 鏡像,這意味着它將不檢測 fallback initramfs 或微碼鏡像,必須手動指定它們。
  • 如果沒有上述 extra_kernel_version_strings 行,refind_linux.conf 中的 %v 變量將不適用於 Arch Linux 內核
refind_linux.conf[編輯 | 編輯原始碼]

如果 rEFInd 自動檢測到你的內核,你可以將包含內核參數的 refind_linux.conf 文件放置在與內核相同的目錄中。你可以使用 /usr/share/refind/refind_linux.conf-sample 作為起點。 refind_linux.conf 未註釋的第一行將是內核的默認參數。隨後的行將在子菜單中創建可使用 +, F2, 或 Insert 訪問的條目。

或者,嘗試以 root 身份運行 mkrlconf。它將會嘗試在 /boot 中找到你的內核,並自動生成 refind_linux.conf。該腳本只會設置最基本的內核參數,因此請確保檢查其創建的文件的正確性。

如果未指定 initrd= 參數,rEFInd 將通過在與內核相同的目錄中搜索常用RAM磁盤文件名來自動添加它。如果需要多個 initrd= 參數,則必須在 refind_linux.conf 中手動指定它們。例如,一個在 initramfs 之前傳遞的微碼

/boot/refind_linux.conf
"Boot using default options"     "root=PARTUUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw add_efi_memmap initrd=boot\intel-ucode.img initrd=boot\amd-ucode.img initrd=boot\initramfs-%v.img"
"Boot using fallback initramfs"  "root=PARTUUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw add_efi_memmap initrd=boot\intel-ucode.img initrd=boot\amd-ucode.img initrd=boot\initramfs-%v-fallback.img"
"Boot to terminal"               "root=PARTUUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw add_efi_memmap initrd=boot\intel-ucode.img initrd=boot\amd-ucode.img initrd=boot\initramfs-%v.img systemd.unit=multi-user.target"
警吿:
  • initrd 路徑是相對於內核所在文件系統的根目錄。這可能是 initrd=\boot\initramfs-%v.img 或者 initrd = initramfs-%v.img(如果 /boot 是一個單獨的分區,例如 ESP)。
  • 在參數 initrd 中使用反斜槓 (\) 作為路徑分隔符,否則內核可能無法找到 initramfs 鏡像:EFI stub: ERROR: Failed to open file: /boot/intel-ucode.img
注意: rEFInd用內核的版本替換 refind_linux.conf 中的 %v}(通過從文件名中提取if)。為了使 rEFInd 支持Arch Linux內核,必須按照 #對於 rEFInd 自動檢測到的內核中的説明編輯 esp/EFI/refind/refind.conf 中的 extra_kernel_version_strings
無需配置的情況[編輯 | 編輯原始碼]

如果你僅將 rEFInd 安裝到 ESP 上並毫不費力地啟動它(例如通過 UEFI Shell 或 KeyTool,或直接從固件),您仍然可以通過自動檢測從啟動菜單,而無需進行任何配置。

這之所以可行,是因為 rEFInd 具有回退機制,可以:

注意: rEFInd 不支持轉義碼 (如 /etc/fstab 中的 路徑名空格)。

手動啟動項[編輯 | 編輯原始碼]

如果未自動檢測到內核,或者你只想對菜單項的選項進行更多控制,則可以使用 refind.conf 中的 stanzas 來手動創建引導項。確保 scanfor 包含 manual,否則這些條目將不會出現在 rEFInd 的菜單中。內核參數使用 options 關鍵字設置。 rEFInd 將使用 stanza 中的 initrd 關鍵字指定的文件附加 initrd= 參數。如果你需要其他 initrd(例如微碼),則可以在 options 中指定它們(並且 initrd 關鍵字指定的會添加到末尾)。

手動啟動項在 Creating Manual Boot Stanzas 中有詳細解釋。

esp/EFI/refind/refind.conf
...

menuentry "Arch Linux" {
	icon     /EFI/refind/icons/os_arch.png
	volume   "Arch Linux"
	loader   /boot/vmlinuz-linux
	initrd   /boot/initramfs-linux.img
	options  "root=PARTUUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw add_efi_memmap initrd=boot\intel-ucode.img initrd=boot\amd-ucode.img"
	submenuentry "Boot using fallback initramfs" {
		initrd /boot/initramfs-linux-fallback.img
	}
	submenuentry "Boot to terminal" {
		add_options "systemd.unit=multi-user.target"
	}
}

您可能需要更改 volume以匹配文件系統的標籤、PARTLABEL 或內核鏡像所在分區的 PARTUUID。PARTUUID 必須大寫的。有關分配卷標的示例,請參見 Persistent block device naming#通過標籤。如果未指定 volume,則默認為啟動 rEFInd 的卷(通常是EFI系統分區)。

警吿:
  • loaderinitrd 的路徑是相對於 volume 的根目錄的相對路徑。如果 /boot 是一個單獨的分區(例如 ESP ),那麼加載程序和 initrd 路徑分別是 /vmlinuz-linux/initramfs-linux.img
  • 在所有引用的 initrd 參數中使用反斜槓 (\) 作為路徑分隔符,否則內核可能無法找到 initramfs 鏡像:EFI stub: ERROR: Failed to open file: /boot/initramfs-linux.img

在已有的 Windows UEFI 安裝中使用 rEFInd[編輯 | 編輯原始碼]

注意: 在頁面 Windows and Arch Dual Boot 中查看通常的注意事項。

rEFInd 兼容 UEFI Windows 安裝時創建的 EFI 系統分區,因此沒有必要創建或格式化另一個 FAT32 分區。只需掛載 Windows 的 ESP 並像往常一樣安裝 rEFInd。默認情況下,rEFInd 的自動檢測功能應該識別任何現有的 Windows 引導程序。

注意: 在某些情況下,Windows 的行為不同(低解像度啟動屏幕、OEM logo 被 Windows logo 替換、啟動屏幕後出現黑屏、偽影)。如果您遇到這樣的問題,請嘗試在 esp/EFI/refind/refind.conf 中設置 use_graphics_for +,windows 或者將 graphics on 添加到Windows 引導項。

工具[編輯 | 編輯原始碼]

rEFInd支持運行各種[1]。工具需要單獨安裝。在 refind.conf 中編輯 showtools 文件選擇要顯示的內容。

esp/EFI/refind/refind.conf
...
showtools shell, memtest, mok_tool, gdisk, fwupdate ...
...

UEFI shell[編輯 | 編輯原始碼]

參見 Unified Extensible Firmware Interface#UEFI Shell

複製 shellx64.efiEFI 分區 的根目錄。

Memtest86[編輯 | 編輯原始碼]

安裝 memtest86-efiAUR 並將它複製到 esp/EFI/tools/

# cp /usr/share/memtest86-efi/bootx64.efi esp/EFI/tools/memtest86.efi

密鑰管理工具[編輯 | 編輯原始碼]

rEFInd 能夠檢測 Secure Boot 密鑰管理工具,如果他們被放在 EPS 上的 rEFInd 的文件夾內,如 esp/esp/EFI/tools/

HashTool[編輯 | 編輯原始碼]

參照 #使用 PreLoaderHashTool.efi 將被放在 rEFInd 的文件夾內。

MokManager[編輯 | 編輯原始碼]

參照 #使用 shim,MokManager 將被放在 rEFInd 的文件夾內。

KeyTool[編輯 | 編輯原始碼]

安裝 efitools

將 KeyTool EFI 二進制文件放在 esp/ 或者 esp/EFI/tools/ 中,並命名為 KeyTool.efiKeyTool-signed.efi

關於簽名 KeyTool.efi 的指導,請參考 Secure Boot#Using KeyTool

GPT fdisk (gdisk)[編輯 | 編輯原始碼]

下載 gdisk EFI 應用 並將 gdisk_x64.efi 複製到 esp/EFI/tools/

fwupdate[編輯 | 編輯原始碼]

安裝並設置好 fwupd

fwupx64.efi 和固件複製到 esp/EFI/tools/

# cp /usr/lib/fwupd/efi/fwupdx64.efi esp/EFI/tools/

關機或重啟[編輯 | 編輯原始碼]

據報道,rEFInd 內置了關機和重啟菜單項。由於這個工具列表是這個 wiki 中的同類工具中最廣泛的,因此 UEFI shell 或其他 UEFI 引導管理器(如 systemd-boot )的用户可能會對 powerofforreboot.efiAUR 感興趣。

提示與小技巧[編輯 | 編輯原始碼]

在 UEFI shell 中使用驅動[編輯 | 編輯原始碼]

要在 UEFI shell 中使用 rEFInd 的驅動,請使用load 命令來加載它們,並使用 map -r 來刷新驅動器映射。

Shell> load FS0:\EFI\refind\drivers\ext4_x64.efi
Shell> map -r

現在你可以從 UEFI shell 訪問你的文件系統了。

設置 efifb 解像度[編輯 | 編輯原始碼]

如果 refind.conf 中的解像度被設置為一個不正確的值,在除了 Apple Mac 的所有系統中, rEFInd 都會展示一個支持的解像度列表。對於 Apple Mac, 它會靜默使用默認解像度。

要確定 efifb 支持的幀緩衝區解像度,請 gnu-efi/usr/share/gnu-efi/apps/x86_64/modelist.efi 複製到 ESP 的根目錄。進入 UEFI shell 並運行 modelist.efi

Shell> FS0:\modelist.efi
GOP reports MaxMode 3
 0: 640x480 BGRR pitch 640
*1: 800x600 BGRR pitch 800
 2: 1024x768 BGRR pitch 1024

refind.conf 中設置一個。重啟並用 dmesg | grep efifb 來檢查設置是否已被應用。

Btrfs 子卷支持[編輯 | 編輯原始碼]

提示:確保安裝了 btrfs_x64.efi 驅動程序, 可以將 /usr/share/refind/drivers_x64/btrfs_x64.efi 複製到 esp/EFI/refind/drivers_x64/btrfs_x64.efi來手動安裝, 或者你也可以以 refind-install /dev/sdx --alldrivers 選項安裝所有驅動程序。
警吿: btrfs_x64.efi 不支持 raid1c3/4

自動檢測[編輯 | 編輯原始碼]

要允許在 Btrfs 子卷上進行內核自動檢測,請取消註釋並編輯 refind.conf 中的 also_scan_dirs

esp/EFI/refind/refind.conf
...
also_scan_dirs +,subvolume/boot
...

然後在 refind_linux.conf 中將 subvol=subvolume 添加到 rootflags,之後將 subvolume 添加到 initrd 路徑之前。

/boot/refind_linux.conf
"Boot using standard options"  "root=PARTUUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw rootflags=subvol=subvolume initrd=subvolume\boot\initramfs-%v.img"

手動啟動項[編輯 | 編輯原始碼]

如果將一個 btrfs 子卷作為根目錄引導,請將子卷的路徑預先添加到 loader 和 initrd 路徑之前,並用 rootflags=subvol=root_subvolume 修改 options 行。在下面的示例中,root 已作為名為「ROOT」的btrfs子卷掛載(例如 mount -o subvol=ROOT /dev/sdxY /mnt):

esp/EFI/refind/refind.conf
...
menuentry "Arch Linux" {
        icon     /EFI/refind/icons/os_arch.png
        volume   "[bootdevice]"
        loader   /ROOT/boot/vmlinuz-linux
        initrd   /ROOT/boot/initramfs-linux.img
        options  "root=PARTUUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw rootflags=subvol=ROOT"
...
}

如果失敗將導致以下錯誤信息:ERROR: Root device mounted successfully, but /sbin/init does not exist.

LoaderDevicePartUUID[編輯 | 編輯原始碼]

從 0.13.1 版本開始,rEFInd 支持設置 UEFI 變量 LoaderDevicePartUUID。啟用此選項允許 systemd-gpt-auto-generator(8) 自動掛載 EFI 系統分區,而無需在 /etc/fstab 中指定它。請參閱 systemd#GPT partition automounting

對於 rEFInd, 要設置 LoaderDevicePartUUID, 請編輯 refind.conf 並取消註釋 write_systemd_vars true:

esp/EFI/refind/refind.conf
...
write_systemd_vars true
...

您可以通過使用 cat /sys/firmware/efi/efivars/LoaderDevicePartUUID-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f 檢查它的值,或者通過查看 bootclt 輸出中 「Boot loader sets ESP partition information」 的狀態來驗證它是否已設置。

疑難解答[編輯 | 編輯原始碼]

Apple Macs[編輯 | 編輯原始碼]

AUR 上的 mactel-bootAUR 是 "bless" 工具的實驗性替代品。如果它不能正常工作, 在 OS X 中使用 "bless" 來將 rEFInd 設置為默認啟動項。

 # bless --setBoot --folder esp/EFI/refind --file esp/EFI/refind/refind_x64.efi

VirtualBox[編輯 | 編輯原始碼]

6.1 版本之前的 VirtualBox 將只引導默認的 esp/EFI/BOOT/bootx64.efi 路徑,因此 refind-install 至少需要與 --usedefault 選項一起使用。有關詳細信息,請參閱 VirtualBox/Install Arch Linux as a guest#Installation in EFI mode on VirtualBox < 6.1

參見[編輯 | 編輯原始碼]