1、引言
衆所周知,Windows在UEFI+GPT下無法用傳統方式設置啓動項來引導雙系統,以Linux發行版系統爲例,一個解決方法是每次啓動從ubuntu引導,然而對於不常用ubuntu系統的人來說,每次開機從ubuntu引導無疑是非常麻煩的,所以這裏我們使用一個第三方工具rEFInd來引導。
這裏我以Deepin爲例,win10裝在固態上,Deepin在機械上,值得一提的是,如果你想將雙系統裝在不同的硬盤上,Deepin所在的硬盤分區表也必須爲gpt格式,可以使用DiskGenius無損轉換,而ubuntu則允許爲mbr格式。
安裝所需工具見文末百度雲鏈接,需要的自取。
2、rEFind的安裝
下載地址:https://sourceforge.net/projects/refind/
打開DiskGenius,找到ESP分區即我們的EFI引導分區,右鍵選擇“指派新的驅動器號”,(如Z:),爲下一步做準備。
進入ESP分區下的EFI目錄,新建文件夾命名爲rEFInd,然後我們需要將剛剛下載的rEFind文件搬進來。
解壓refind-bin-0.11.2.zip,進入refind目錄,仿照refind.conf-sample,新建文件refind.conf,不會寫也沒關係,先建個空文件,否則會報錯,我們後面再講如何配置。
將refind目錄下所有文件包括文件夾及文件夾內的文件,全放入EFI/rEFInd目錄下,注意由於軟件功能限制,文件夾只能手動創建,然後右鍵-“複製文件到當前分區”(一次可以複製多個文件)。
3、修改啓動項
使用BOOTICE
選擇UEFI
點擊修改啓動序列
點擊添加
進入EFI/rEFind路徑,選擇refind_x64.efi
修改菜單標題,上移至第一位,點擊“保存當前啓動項設置”即可
重啓即可看到rEFInd引導頁了
4、配置rEFind
當你配置好rEFInd,可能會發現有多餘的啓動項,或是覺得界面不夠好看,可以通過修改refind.conf來編輯菜單項或是更換主題。
rEFInd Theming:
http://www.rodsbooks.com/refind/themes.html
推薦一個我使用的主題,個人覺得蠻簡潔的
https://github.com/EvanPurkhiser/rEFInd-minimal
更改主題只需要將解壓後的文件放在refind/themes下即可
效果圖:
refind.conf的配置這裏不做具體分析,可以參考以下三篇博客:
https://blog.csdn.net/bleachswh/article/details/51713567
https://blog.csdn.net/XiaoshaXs/article/details/52016717
https://blog.csdn.net/han_shan_zi/article/details/79207002
下面我貼出我自己的配置文件,deepin自己p了一個圖標可以在百度雲鏈接裏icons下找到,ubuntu用默認的就好。
注意:
1.更改主題需要在refind.conf最後一行加上include themes/rEFInd-minimal/theme.conf
,具體路徑根據你的目錄而定
2.更改後的文件需要從DiskGenius重新替換,主題文件也一樣
refind.conf
#
# refind.conf
# Configuration file for the rEFInd boot menu
#
timeout 5
hideui badges
scan_all_linux_kernels false
dont_scan_dirs EFI/ubuntu, EFI/Boot
include themes/rEFInd-minimal/theme.conf
theme.conf
# Minimal refind theme
# Hide user interface elements for personal preference or to increase
# security:
# banner - the rEFInd title banner (built-in or loaded via "banner")
# label - boot option text label in the menu
# singleuser - remove the submenu options to boot Mac OS X in single-user
# or verbose modes; affects ONLY MacOS X
# safemode - remove the submenu option to boot Mac OS X in "safe mode"
# hwtest - the submenu option to run Apple's hardware test
# arrows - scroll arrows on the OS selection tag line
# hints - brief command summary in the menu
# editor - the options editor (+, F2, or Insert on boot options menu)
# badges - device-type badges for boot options
# all - all of the above
# Default is none of these (all elements active)
#
#hideui singleuser,hints,arrows,label,badges
hideui label,singleuser,safemode,hwtest,arrows,hints,editor,badges
# Set the name of a subdirectory in which icons are stored. Icons must
# have the same names they have in the standard directory. The directory
# name is specified relative to the main rEFInd binary's directory. If
# an icon can't be found in the specified directory, an attempt is made
# to load it from the default directory; thus, you can replace just some
# icons in your own directory and rely on the default for others.
# Default is "icons".
#
icons_dir themes/rEFInd-minimal/icons
# Use a custom title banner instead of the rEFInd icon and name. The file
# path is relative to the directory where refind.efi is located. The color
# in the top left corner of the image is used as the background color
# for the menu screens. Currently uncompressed BMP images with color
# depths of 24, 8, 4 or 1 bits are supported, as well as PNG images.
#
banner themes/rEFInd-minimal/background.png
# Tells rEFInd whether to display banner images pixel-for-pixel (noscale)
# or to scale banner images to fill the screen (fillscreen). The former is
# the default.
#
banner_scale fillscreen
# Custom images for the selection background. There is a big one (144 x 144)
# for the OS icons, and a small one (64 x 64) for the function icons in the
# second row. If only a small image is given, that one is also used for
# the big icons by stretching it in the middle. If only a big one is given,
# the built-in default will be used for the small icons.
#
# Like the banner option above, these options take a filename of an
# uncompressed BMP image file with a color depth of 24, 8, 4, or 1 bits,
# or a PNG image. The PNG format is required if you need transparency
# support (to let you "see through" to a full-screen banner).
#
selection_big themes/rEFInd-minimal/selection_big.png
selection_small themes/rEFInd-minimal/selection_small.png
# Which non-bootloader tools to show on the tools line, and in what
# order to display them:
# shell - the EFI shell (requires external program; see rEFInd
# documentation for details)
# gptsync - the (dangerous) gptsync.efi utility (requires external
# program; see rEFInd documentation for details)
# apple_recovery - boots the Apple Recovery HD partition, if present
# mok_tool - makes available the Machine Owner Key (MOK) maintenance
# tool, MokManager.efi, used on Secure Boot systems
# about - an "about this program" option
# exit - a tag to exit from rEFInd
# shutdown - shuts down the computer (a bug causes this to reboot
# EFI systems)
# reboot - a tag to reboot the computer
# firmware - a tag to reboot the computer into the firmware's
# user interface (ignored on older computers)
# Default is shell,apple_recovery,mok_tool,about,shutdown,reboot,firmware
#
#showtools shutdown
showtools reboot,shutdown,firmware
5、所需工具
https://pan.baidu.com/s/1AHIqbY08tAqI51eVlwF7Cw
說明一下,DiskGenius和BOOTICE都是免安裝的,refind-bin-0.11.2.zip即爲rEFInd文件,rEFInd-minimal-master.zip是主題文件,可在GitHub自行下載,icons是deepin的圖標,其他幾個爲deepin和ubuntu的系統鏡像和系統製作工具,不需要的無視就好。
歡迎提問和指正。