My attempts to open a luks container fail with the following messages:

sudo cryptsetup luksOpen /dev/loop2 test.crypted
Enter LUKS passphrase for /dev/loop2:
key slot 0 unlocked.
Command failed: Invalid offset

As a result, the mapper never gets created in /dev/mapper.

The commands I am using to create my container are the following:

dd if=/dev/urandom of=test.crypted bs=1M count=256
sudo losetup -d /dev/loop2
sudo losetup /dev/loop2 /phil/test.crypted
sudo cryptsetup -c twofish -s 256 luksFormat /dev/loop2

The resulting container appears to be valid as shown by cryptsetup luksDump:

LUKS header information for /dev/loop2

Version: 1
Cipher name: twofish
Cipher mode: cbc-plain
Hash spec: sha1
[snip]

However, no mapper after the luksOpen.

I have a non-luks 'vanilla' container that works. Can anyone help me figure what I'm missing?

Thanks!