#StackBounty: #lvm #cryptsetup WARNING Option 'hash' missing in crypttab after upgrading Ubuntu

Bounty: 300

I upgraded Ubuntu from 18.04 to 18.10. I have full disk encryption enabled. When I boot up, I get this error message displayed above the password prompt for the full disk encryption:

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

Once I enter the correct password, I am told it has been set up correctly, but then I am only shown a black screen with a flashing cursor

Using a live USB stick, I managed to read /etc/crypttab in my machine, the contents look like this:

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

This is what /etc/fstab looks like on my machine:

/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

I have been reading README.initramfs. (Despite what the error message says, I actually found it at /usr/share/doc/cryptesetup-initramfs/README.initramfs.gz.) I tried modifying cryptsetup to include hash=sha1

In the live CD, I unencrypted the encrypted partition using Files, and then I chroot it like this:

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

And then I ran update-initramfs -k all -c, and got this output:

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.

So I decided to modify crypttab again, like this:

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

Now when I run the command, I get this output:

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'

I rebooted my machine, and I got the exact same behaviour described initially. I rebooted again in recovery mode, I get this output before being prompted for a password:

 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:

More information on my hard drive layout:

$ 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


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.