我的系统是安装在单独硬盘上的 Windows 10 (sdb) 和 Manjaro (sda) 的双重启动。Windows 系统驱动器使用 bitlocker 加密,Manjaro 通过 LUKS 上的 LVM 加密,如下所示 (lsblk)。
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 619M 0 part /boot/efi
├─sda2 8:2 0 232.8G 0 part
│ └─cryptroot 254:0 0 232.8G 0 crypt
│ ├─vg0-swap 254:1 0 32G 0 lvm [SWAP]
│ ├─vg0-system 254:2 0 20G 0 lvm /
│ └─vg0-data 254:3 0 180.8G 0 lvm /home
└─sda5 8:5 0 698.1G 0 part
sdb 8:16 0 232.9G 0 disk
├─sdb1 8:17 0 499M 0 part
├─sdb2 8:18 0 100M 0 part
├─sdb3 8:19 0 16M 0 part
└─sdb4 8:20 0 232.3G 0 part
我将 grub2 设置为默认引导加载程序(安装在 Manjaro 上),它可以让我通过菜单选择是要引导 Windows 还是 Manjaro。但是,问题是它会在给我那个菜单之前询问(LUKS FDE)密码。结果,由于Windows已经用bitlocker加密了,所以我必须在LUKS密码之后输入Windows bitlocker密码,这很不方便。(如果我想启动到 Manjaro,令人惊讶的是,我不需要输入两次 LUKS 密码)
因为 Windows 和 Manjaro 安装在不同的物理硬盘上,并且引导分区没有加密(如上所示),所以当我想引导到 Windows 时,grub 不需要询问我 LUKS 的密码。只有当我选择引导到 Manjaro 时,它才会首先显示菜单并询问我 LUKS 密码。但我不确定如何配置它,也找不到太多关于它的资源。
这是我的 grub 配置文件(在/etc/default/grub
)
GRUB_DEFAULT=saved
GRUB_TIMEOUT=10
GRUB_TIMEOUT_STYLE=hidden
GRUB_DISTRIBUTOR="Manjaro"
GRUB_CMDLINE_LINUX_DEFAULT="quiet udev.log_priority=3"
GRUB_CMDLINE_LINUX="cryptdevice=UUID=<uuid_is_hidden>:cryptroot"
# If you want to enable the save default function, uncomment the following
# line, and set GRUB_DEFAULT to saved.
GRUB_SAVEDEFAULT=true
# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
# Uncomment to enable booting from LUKS encrypted devices
GRUB_ENABLE_CRYPTODISK=y
# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console
# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command 'videoinfo'
GRUB_GFXMODE=auto
# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep
# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true
# Uncomment and set to the desired menu colors. Used by normal and wallpaper
# modes only. Entries specified as foreground/background.
GRUB_COLOR_NORMAL="light-gray/black"
GRUB_COLOR_HIGHLIGHT="green/black"
# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/usr/share/grub/background.png"
GRUB_THEME="/usr/share/grub/themes/manjaro/theme.txt"
# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"