Hello, i hope my first post is helpful.

After some debugging i figured out where this error message "cryptsetup:
unknown fstype, bad password or options?"  in my case comes from.

The point is that i am having a LVM Partition which holds several
logical volumes which need to be mounted (at least one of them as root
partition). This partition seems not to be visible/available at this
time.

I patched the script and the error is gone for me. So can someone please check 
and confirm that this helps?!
It would then be great to get this fixed for future versions because i do not 
want to use a self-patched version which will be overwritten with some new 
updates.


To sum up. This are the problems with that i think

1) "cryptsetup: unknown fstype, bad password or options?" 
Problem: LVM Partitions not fully set up at the time the script tries to detect 
the File-System type.
Solution: Wait until all partitions fully set up and accessible

2) "device-mapper: remove ioctl on sda5_crypt failed: Device or resource busy" 
This error is shown because of the Problem in "1)" because the File-System is 
not being detected (due to empty FSTYPE variable)

3) /run/lvm/lvmetad.socket: connect failed: No such file or directory +
WARNING: Failed to connect to lvmetad. Falling back to internal
scanning.

This warning comes from /etc/lvm/lvm.conf because in this configuration file 
"use_lvmetad" is activated and set to 1.
Having this enabled seems to be fine i think. The problem is that this daemon 
is not running at the time the lvm commands from the initramfs-tools are being 
executed.

I solved this "optical problem" of displaying this warnings by creating
a hook, which set the use_lvmetad to "use_lvmetad = 0".

$ cat /etc/initramfs-tools/hooks/fix_lvm2_hook
#!/bin/sh

PREREQ="lvm2"

prereqs()
{
        echo "$PREREQ"
}

case $1 in
prereqs)
        prereqs
        exit 0
        ;;
esac

. /usr/share/initramfs-tools/hook-functions

if [ -e ${DESTDIR}/etc/lvm/lvm.conf ]; then
        # Replace use_lvmetad=1 with use_lvmetad=0
        sed -E 's/(^\s*use_lvmetad\s*=\s*)(1)(\s*.*$)/\10\3/' 
${DESTDIR}/etc/lvm/lvm.conf
fi


** Patch added: "Patch for 
/usr/share/initramfs-tools/scripts/local-top/cryptroot"
   
https://bugs.launchpad.net/cryptsetup/+bug/1481536/+attachment/4526849/+files/cryptroot.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1481536

Title:
  "cryptsetup: unknown fstype, bad password or options?" error unlocking
  / decrypting LUKS volume at boot

To manage notifications about this bug go to:
https://bugs.launchpad.net/cryptsetup/+bug/1481536/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to