我升级并以某种方式丢失了启动分区上的内核。
我已经设法恢复了大部分内容(通过启动旧的 14、安装加密分区并 chroot 到其中 - 因此是下面的 /mnt),但我仍然无法启动。它从不询问我的根分区密码并卡在 initramfs shell 中。
我尝试将其添加到 /etc/default/grub
GRUB_CMDLINE_LINUX="cryptdevice=/dev/disk/by-uuid/8711af09-1c70-414a-af43-e859ddabf09f:cryptroot root=/dev/mapper/cryptroot"
Run Code Online (Sandbox Code Playgroud)
该 UUID 位于我的 /etc/crypttab 中:
sda5_crypt UUID=8711af09-1c70-414a-af43-e859ddabf09f none luks,discard
Run Code Online (Sandbox Code Playgroud)
但是当我这样做并运行 grub-install 时,如下所示:
grub-install --boot-directory=/mnt/boot /dev/sda1
Run Code Online (Sandbox Code Playgroud)
我明白了:
Installing for i386-pc platform.
grub-install: error: attempt to install to encrypted disk without cryptodisk enabled. Set `GRUB_ENABLE_CRYPTODISK=1' in file `/etc/default/grub'..
Run Code Online (Sandbox Code Playgroud)
据我所知,GRUB_ENABLE_CRYPTODISK 仅适用于加密整个磁盘的情况 - 我不是。我在 /boot(或 USB 启动机器上的 /mnt/boot)上安装了一个单独的 EXT2 启动分区。
当我打开该选项时:
GRUB_ENABLE_CRYPTODISK=y
Run Code Online (Sandbox Code Playgroud)
并运行 grub-install,我得到:
Installing for i386-pc platform.
grub-install: warning: Filesystem `ext2' doesn't support embedding.
grub-install: error: embedding is …
Run Code Online (Sandbox Code Playgroud)