警告:升级 Ubuntu 后,crypttab 中缺少选项“hash”

警告:升级 Ubuntu 后,crypttab 中缺少选项“hash”

我将 Ubuntu 从 18.04 升级到了 18.10。我启用了全盘加密。启动时,我在全盘加密的密码提示上方看到以下错误消息:

cryptsetup: WARNING: Option 'hash' missing in crypttab for plain dm-crypt mapping cryptcherries. Please read /usr/share/doc/cryptsetup/README.initramfs and add the correct 'hash' option to your crypttab(5).

Please unlock disk cryptcherries

输入正确的密码后,系统会提示我密码设置正确,但随后只显示黑屏,屏幕上有一个闪烁的光标

使用实时 USB 记忆棒,我设法读取/etc/crypttab我的机器,内容如下:

cryptcherries UUID=1ae5c201-etc-etc none luks,retry=1,lvm=vgcherries

/etc/fstab在我的计算机上看起来是这样的:

/dev/mapper/vgcherries-vgcherriesroot / ext4 errors=remount-ro 0 1
UUID=03daa82f-etc-etc /boot ext3 defaults 0 2
/dev/mapper/vgcherries-vgcherriesswap none swap sw 0 0

我一直在阅读README.initramfs。(尽管错误消息说了什么,但我实际上在 找到了它/usr/share/doc/cryptesetup-initramfs/README.initramfs.gz。)我尝试修改cryptsetup以包括hash=sha1

在实时 CD 中,我使用文件解密了加密分区,然后像这样 chroot 它:

sudo mount /dev/mapper/vgcherries-vgcherriesroot /mnt
sudo mount /dev/sda4 /mnt/boot
sudo mount --bind /dev /mnt/dev
sudo chroot /mnt
> mount -t proc proc /proc
> mount -t sysfs sys /sys
> mount -t devpts devpts /dev/pts

然后我运行update-initramfs -k all -c,得到了这个输出:

update-initramfs: Generating /boot/initrd.img-4.18.0-10-generic
cryptsetup: WARNING: target 'luks-1ae5c201-a8c8-458f-a364-6cda7717c24f' not 
    found in /etc/crypttab
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries 
    nor crypto modules. If that's on purpose, you may want to uninstall the 
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs 
    integration and avoid this warning.
update-initramfs: Generating /boot/initrd.img-4.15.0-38-generic
cryptsetup: WARNING: target 'luks-1ae5c201-a8c8-458f-a364-6cda7717c24f' not 
    found in /etc/crypttab
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries 
    nor crypto modules. If that's on purpose, you may want to uninstall the 
    'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs 
    integration and avoid this warning.

所以我决定再次修改crypttab,像这样:

luks-1ae5c201-a8c8-458f-a364-6cda7717c24f UUID=1ae5c201-a8c8-458f-a364-6cda7717c24f none luks,retry=1,lvm=vgcherries,hash=sha1

现在,当我运行命令时,我得到以下输出:

update-initramfs: Generating /boot/initrd.img-4.18.0-10-generic
cryptsetup: WARNING: luks-1ae5c201-a8c8-458f-a364-6cda7717c24f: ignoring 
    unknown option 'retry'
cryptsetup: WARNING: luks-1ae5c201-a8c8-458f-a364-6cda7717c24f: ignoring 
    unknown option 'lvm'
update-initramfs: Generating /boot/initrd.img-4.15.0-38-generic
cryptsetup: WARNING: luks-1ae5c201-a8c8-458f-a364-6cda7717c24f: ignoring 
    unknown option 'retry'
cryptsetup: WARNING: luks-1ae5c201-a8c8-458f-a364-6cda7717c24f: ignoring 
    unknown option 'lvm'

我重启了机器,得到了与最初描述的完全相同的行为。我再次以恢复模式重启,在提示输入密码之前,我得到了以下输出:

 Volume group "vgcherries" not found
 Cannot process volume group vgcherries
cryptsetup: WARNING: cryptcherries: ignoring unknown option 'lvm'
/scripts/local-top/cryptroot: line 1: fold: not found
/scripts/local-top/cryptroot: line 1: fold: not found
/scripts/local-top/cryptroot: line 1: fold: not found
Please unlock disk cryptcherries:

有关我的硬盘布局的更多信息:

$ sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
NAME   FSTYPE        SIZE MOUNTPOINT LABEL
sda                238.5G            
├─sda1 ntfs          350M            Réservé au système     
├─sda2 ntfs        114.3G
├─sda3 crypto_LUKS   123G 
| └─luks-1ae5c201-...
|      LVM2_member   123G
|   ├─vgcherries-vgcherriesroot
|   |  ext4          115G
|   └─vgcherries-vgcherriesswap
|      swap            8G
└─sda4 ext3          800M

答案1

这听起来17.1018.04升级问题类似:


感谢您提及升级到 Ubuntu 18.04 后 sd5_crypt 的键盘问题。

我以前试过,但你让我更仔细地重新审视它。对我来说,这不是英国键盘布局与美国键盘布局的问题,而是意识到对于 sd5-crypt,我仍然使用混合了德国布局的英语布局。

在维基百科中查找键盘映射:https://en.wikipedia.org/wiki/British_and_American_keyboards

我将密码短语转换成英文布局字符串,它对我有用。

奇怪的是这个问题在之前的 Ubuntu 17.10 版本中没有出现过

相关内容