Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to use cryptdisks_start to open a LUKS device that is defined in my /etc/crypttab. Unfortunately, the command fails with the following error message:

martin ~ # cryptdisks_start luks-01a2e5d8-9211-40ce-b160-d3f973d1a155
 * Starting crypto disk...
 * luks-01a2e5d8-9211-40ce-b160-d3f973d1a155 (starting)..
 * luks-01a2e5d8-9211-40ce-b160-d3f973d1a155: the precheck for '/dev/disk/by-uuid/01a2e5d8-9211-40ce-b160-d3f973d1a155' failed:  - The device /dev/disk/by-uuid/01a2e5d8-9211-40ce-b160-d3f973d1a155 contains a filesystem type crypto_LUKS.
 * luks-01a2e5d8-9211-40ce-b160-d3f973d1a155 (failed)...
   ...fail!

A rather strange error, because of course that device has to contain a crypto_LUKS filesystem!

The relevant line from /etc/crypttab, as set up by GNOME Disks:

luks-01a2e5d8-9211-40ce-b160-d3f973d1a155 UUID=01a2e5d8-9211-40ce-b160-d3f973d1a155 /etc/luks-keys/luks-01a2e5d8-9211-40ce-b160-d3f973d1a155 nofail
share|improve this question

1 Answer 1

up vote 4 down vote accepted

It doesn't work because the /etc/crypttab line is missing the option keyword luks. Changing the line to this resolved the issue:

luks-01a2e5d8-9211-40ce-b160-d3f973d1a155 UUID=01a2e5d8-9211-40ce-b160-d3f973d1a155 /etc/luks-keys/luks-01a2e5d8-9211-40ce-b160-d3f973d1a155 luks,nofail

This is due to the fact that cryptdisks_start uses the options to determine what kind of encryption is being used so that it will use the correct command to open the device. Without the luks option, cryptdisks_start will try to open the device as a plain dm-crypt device with cryptsetup create. Luckily a sanity check prevents this, although it causes a confusing error message.

Apparently the Disks tool of GNOME3 writes this incorrect line to /etc/crypttab when using the unlock icon and saving the passphrase.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.