Я знаю, что об этом спрашивали, но я спрашиваю об этом, потому что обнаруженное мною исправление не сработало. У меня возникла та же проблема, что и у этого человека: Ubuntu 19.04 «ожидание зашифрованного исходного устройства / файла подкачки», а затем приглашение initramfs при загрузке: linuxquestions
, но я попытался исправить это, добавив «size = 256» в / и т.д. / crypttab. I did that, but it still warns me that I haven't specified size in crypttab and still takes time to boot. (my computer will still boot to a working gui if i type exit at the prompt)
Here's the contents of /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
and here is /etc/crypttab:
# <target name> <source device> <key file> <options>
cryptswap1 /swapfile /dev/urandom swap,offset=1024,cipher=aes-xts-plain64,size=256
does it help that it worked all the time before but just doesnt now, and that i had to use Ubuntu recovery mode DPKG before I edited /etc/crypttab?
Any help would be VERY appreciated. TY in advance!
edit: it would be nice if i could keep swap as i only have 5.7gb ram (2.3gb ram is system reserved)
I found a way to fix this.
/etc/fstab
and /etc/crypttab
sudo swapoff -a && sudo update-initramfs -u
However, although this works, I think this breaks for every new kernel update.
Основная причина и объяснение того, почему описанный выше обходной путь работает, заключается в том, что хук initramfs cryptroot (/usr/share/initramfs-tools/hooks/cryptroot
) пытается перевести /swapfile
, чтобы заблокировать устройство, если у вас есть cryptswap в /etc/crypttab
. Очевидно, что это не работает, так как /swapfile
не является устройством и недоступен во время работы initramfs.
Поскольку вы не используете зашифрованные rootfs (иначе файл /swapfile
уже был бы зашифрован как его часть), проще всего отключить этот хук cryptroot. К сожалению, нет хорошего способа, как это сделать. Лучшим способом, который я нашел, было вставить exit 0
в /etc/cryptsetup-initramfs/conf-hook
, так как этот скрипт получен хуком cryptroot.