dm-crypt and confusing error messages

January 12, 2010 at 10:13 AM | Uncategorized | View Comments

(this is a post intended for Google - sorry for bothering you, faithful RSS readers)

I've been setting up encrypted backups for my Linux machine, found that cryptsetup gives a really cryptic and unhelpful error message:

$ cryptsetup luksFormat /dev/sda3 ~/.backupKey
WARNING!
========
This will overwrite data on /dev/sda3 irrevocably.

Are you sure? (Type uppercase yes): YES
Failed to setup dm-crypt key mapping.
Check kernel for support for the aes-cbc-essiv:sha256 cipher spec and verify
that /dev/sda3 contains at least 133 sectors.
Failed to write to key storage.
Command failed.
$

Google will suggest lots of things… But none of them solved my problem.

What was I doing wrong? I needed to run cryptsetup as root.

D'oh.