LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   cryptsetup error (Command failed: Invalid argument) (http://www.linuxquestions.org/questions/slackware-14/cryptsetup-error-command-failed-invalid-argument-526053/)

SlackN00b 02-06-2007 09: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:

Slackware-11

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


Code:

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

Code:

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

Code:

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

Code:

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

cryptsetup-0.1 is the version


---Now when I issue the command:

Code:

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 12:21 PM

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

http://feraga.com/node/51

There is a 10.2 version of cryptsetup-luks available:

http://www.linuxpackages.net/pkg_details.php?id=7660

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

http://luks.endorphin.org/dm-crypt

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 02:07 PM

Perhaps my Wiki article on encryption using cryptoloop gives you new insights: http://alien.slackbook.org/dokuwiki/...nux:cryptoloop

Eric

kilgoretrout 02-06-2007 04: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 05: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 ??

Cheers.

kilgoretrout 02-07-2007 01: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 12:56 PM.