cor*_*sk1 4 encryption partitioning boot fstab mount
我知道有人问过这个问题,但我问这个问题是因为我发现的修复不起作用。我遇到了这个人同样的问题:Ubuntu 19.04“等待加密的源设备/交换文件”,然后启动时提示 initramfs :linuxquestions
但我尝试了修复,即在 /etc/crypttab 中添加“size=256”。我这样做了,但它仍然警告我,我没有在 crypttab 中指定大小,并且仍然需要时间来启动。(如果我在提示符下键入 exit,我的计算机仍会启动到工作 GUI)
以下是 /etc/fstab 的内容:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme0n1p2 during installation
UUID=694b4858-ead8-400d-9406-f9fc45dc71f1 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=CA5F-286C /boot/efi vfat umask=0077 0 1
#/swapfile none swap sw 0 0
#/dev/mapper/cryptswap1 none swap sw 0 0
#/swapfile swap swap defaults 0 0
/dev/mapper/cryptswap1 none swap sw,pri=100 0 0
Run Code Online (Sandbox Code Playgroud)
这是 /etc/crypttab:
# <target name> <source device> <key file> <options>
cryptswap1 /swapfile /dev/urandom swap,offset=1024,cipher=aes-xts-plain64,size=256
Run Code Online (Sandbox Code Playgroud)
它以前一直有效,但现在不行,而且在编辑 /etc/crypttab 之前我必须使用 Ubuntu 恢复模式 DPKG,这有帮助吗?
任何帮助将非常感激。提前TY!
编辑:如果我可以保留交换就好了,因为我只有 5.7GB 内存(2.3GB 内存是系统保留的)
上述解决方法有效的根本原因和解释是,/usr/share/initramfs-tools/hooks/cryptroot
当/swapfile
您在/etc/crypttab
. 这显然失败了/swapfile
它不是一个设备,并且在 initramfs 运行期间不可用。
由于您没有使用加密的 rootfs(否则/swapfile
已经作为其一部分进行加密),最简单的方法是禁用此 cryptroot 挂钩。不幸的是没有好的方法,如何做到这一点。我发现最好的方法是插入,exit 0
因为/etc/cryptsetup-initramfs/conf-hook
该脚本是由 cryptroot 挂钩获取的。