[Bug 1481536] Re: "cryptsetup: unknown fstype, bad password or options?" error unlocking / decrypting LUKS volume at boot

Richard Hansen 1481536 at bugs.launchpad.net
Thu Dec 3 00:41:20 UTC 2015


This problem is caused by a race condition, which is why only some
people are experiencing it.

At /usr/share/initramfs-tools/scripts/local-top/cryptsetup line 322, the
setup_mapping() function in the cryptroot script calls the activate_vg()
function, which runs 'lvm vgchange -a y'.  At line 340, without waiting
for udev to finish creating the device links for the newly activated
volume group, 'blkid' is invoked to get the filesystem type of the
logical volume.  This fails if udev hasn't yet finished creating the
device links, which causes the script to log "cryptsetup: unknown
fstype, bad password or options?" at line 345 and run 'cryptsetup
remove' at line 347.  Fortunately 'cryptsetup remove' fails because the
volume group was successfully activated (the crypt device is now busy),
which allows the next iteration through the loop to succeed.

The attached patch fixes this bug for me.

** Patch added: "call udev_settle() from activate_vg()"
   https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/1481536/+attachment/4528826/+files/do-udev-settle-after-activate-vg.patch

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

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

Status in cryptsetup:
  Confirmed
Status in One Hundred Papercuts:
  Confirmed
Status in cryptsetup package in Ubuntu:
  Confirmed

Bug description:
  Since upgrading to cryptsetup-1.6.6-5ubuntu1 to replace
  cryptsetup-1.6.1-1ubuntu7 today on my Ubuntu Wily 15.10 installation,
  I have been receiving an error message at boot time after entering my
  passphrase to unlock the LUKS partition.

  I noticed that at the same time the verbiage of the prompt to enter
  the passphrase also changed, to something like "Please unlock
  <devicename>", which is a little different than before, so I'm
  guessing something in this change may have caused the error message.

  Interestingly, the error message does not impede successful system
  boot, so my suspicion is that the error is maybe not real, but just
  being incorrectly displayed.  In other words, if I successfully enter
  the passphrase, this error will appear but the system will then
  proceed to boot successfully and have the encrypted volume
  successfully mounted.

  ProblemType: Bug
  DistroRelease: Ubuntu 15.10
  Package: cryptsetup 2:1.6.6-5ubuntu1
  ProcVersionSignature: Ubuntu 4.1.0-3.3-generic 4.1.3
  Uname: Linux 4.1.0-3-generic x86_64
  ApportVersion: 2.18-0ubuntu5
  Architecture: amd64
  Date: Tue Aug  4 20:46:55 2015
  InstallationDate: Installed on 2015-05-28 (68 days ago)
  InstallationMedia: Xubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422.1)
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: cryptsetup
  UpgradeStatus: No upgrade log present (probably fresh install)
  crypttab: sda3_crypt UUID=fe4c1c1f-252e-4bcc-904c-07896f9b1361 none luks,discard

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



More information about the foundations-bugs mailing list