-   Slackware (
-   -   cryptsetup error (Command failed: Invalid argument) (

SlackN00b 02-06-2007 08:25 AM

cryptsetup error (Command failed: Invalid argument)
Hi, I think I've read any existing faq and guide on dm-crypt so I think I'm helpless,but I try to expose my problem anyway.

I'd like to encrypt a container with dm-crypt and this is what I have:


Custom kernel 2.6.19 compiled with static dm-crypt and loop device and aes as module.


root@nowhere:~# ls -l /dev/mapper/control
crw-rw---- 1 root root 10, 63 2007-02-06 15:39 /dev/mapper/control


root@nowhere:~# dmsetup targets
crypt            v1.3.0
striped          v1.0.2
linear          v1.0.2
error            v1.0.1


root@nowhere:~# cat /proc/crypto
name        : aes
driver      : aes-generic
module      : aes
priority    : 100
refcnt      : 1
type        : cipher
blocksize    : 16
min keysize  : 16
max keysize  : 32


root@nowhere:~# losetup /dev/loop0
/dev/loop0: [0804]:228891 (/home/joe/terces)

cryptsetup-0.1 is the version

---Now when I issue the command:


cryptsetup -y create terces /dev/loop0
Command failed: Invalid argument

Can you help me please understanding what's the problem.

Thx a lot in advance.

kilgoretrout 02-06-2007 11:21 AM

If the version of cryptsetup you have is LUKS enabled, this is an excellent HowTo on setting up encrypted partitions/containers:

There is a 10.2 version of cryptsetup-luks available:

don't know if it will work on 11.0. But you can download and compile from source here:

The LUKS version of cryptsetup gives you a lot of additional features and the bulk of info on the net for cryptsetup is on the LUKS version AFAIK. I haven't used anything but the LUKS version myself, so I can't be of much assistance if you don't have that version or don't want to use it.

Alien Bob 02-06-2007 01:07 PM

Perhaps my Wiki article on encryption using cryptoloop gives you new insights:


kilgoretrout 02-06-2007 03:14 PM

That's a nice article but I believe cryptoloop is deprecated and is replaced by dm-crypt/cryptsetup in most distros. IIRC there may be some security issues with cryptoloop as well.

SlackN00b 02-07-2007 04:37 AM

Thanks anyway but I've decided to reinstall slackware 11 from scratch with kernel 2.6.17 and found out that dm-crypt works perfectly.

Since the the 2 systems are both slackware 11 "default install" but the "not working" one was using a recompiled 2.6.19 kernel, the only difference might be in the kernel libs.
Might be there a bug in the 2.6.19 ??


kilgoretrout 02-07-2007 12:59 PM

It's possible but not likely; you generally hear about that type of problem if it exists. I think it's more likely that there was an error or oversight in your kernel compilation or some incompatability with the version of cryptsetup used and your kernel.

All times are GMT -5. The time now is 03:06 PM.