[pkg-cryptsetup-devel] Bug#586120: Bug#586120: device-mapper: reload ioctl failed: Invalid argument

Jonas Meurer jonas at freesources.org
Sun Jun 27 09:35:31 UTC 2010


Hey Clayton,

On 27/06/2010 Clayton wrote:
> On Sat, 26 Jun 2010 12:32:02 +0200
> Jonas Meurer <jonas at freesources.org> wrote:
> 
> > On 16/06/2010 clayton wrote:
> > > # cryptsetup create backcrypt /dev/sda2
> > > Enter passphrase:
> > > device-mapper: reload ioctl failed: Invalid argument
> > Can you post dmsetup table when this fails?
> 
> Hi Jonas,
> 
> Sad to say, I think the original symptom I reported may have been due to
> finger problems associated with the recent shuffling of device names.
> The encrypted partition is on USB drive that used to be assigned sda
> when it was plugged in. Now the internal hard drive is assigned sda,
> and the USB drive gets assigned sdb. Not sure how I missed that....

are you sure that this is the case? what does 'blkid /dev/sda' and
'blkid /dev/sdb' return? for a plain dm-crypt encrypted device, no
filesystem should be detected.

also you should take a look at /var/log/syslog, and at /dev/disk/by-id/
in order to find out which device is the encrypted partition on external
USB drive.

> So now: cryptsetup create backcrypt /dev/sdb2
> works.

this should work for _any_ block device, regardless whether it contains
encrypted fs or not. thus the success of above command does not indicate
that /dev/sdb2 is the correct device.

> BUT!!: when I try to mount the partition, this happens:
> 
> # mount /media/backcrypt/
> mount: wrong fs type, bad option, bad superblock on /dev/dm-0,
>        missing codepage or helper program, or other error
>        In some cases useful info is found in syslog - try
>        dmesg | tail  or so
> 
> (Nothing at all is showing up in /var/log/messages associated with this
> event....)
> 
> /etc/fstab contains:
> /dev/mapper/backcrypt  /media/backcrypt  ext3  rw,,user  0 0
> 
> # ll /dev/mapper/backcrypt
> lrwxrwxrwx 1 root root 7 Jun 27 11:50 /dev/mapper/backcrypt -> ../dm-0
> 
> Again, the fstab entry has not changed for years, and this is a monthly
> routine that has worked consistently for years. There is also another,
> unencrypted, ext3 partition on this USB drive that continues to mount
> just fine.

what does 'blkid /dev/mapper/backcrypt' return?

the default key size and cipher mode changed for plain dm-crypt in
cryptsetup package 2:1.1.0-1. it seems like you don't use /etc/crypttab
at all, where key size and cipher mode can be configured.

again, 'cryptsetup create' doesn't fail if either passphrase or cipher/
hash/keysize are wrong. thus the only way to verify successfull setup is
to check the content of unlocked device.

try the following (these where the old defaults for cryptsetup before
1.1.0):

# cryptsetup --key-size 128 --cipher aes-cbc-plain create backcrypt /dev/sdb2

and see what 'blkid /dev/mapper/backcrypt' returns in that case.

greetings,
 jonas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-cryptsetup-devel/attachments/20100627/2c9e7ccf/attachment.pgp>


More information about the pkg-cryptsetup-devel mailing list