# dm-crypt luksOpen device problems

## Atle

I set up dmcrypt some time ago, but have not used in regularly. I tried "opening" my partion now, but not sure whether I'm doing something wrong, or something is wrong with my system. I don't really know what I'm doing.

From fstab I have this line:

/dev/mapper/stackback /mnt/stackback ext4 noauto,noatime 0 1

And I know the physical disk is /dev/sdb1.

This is what's in dev/mapper when I start:

```

# ls -l /dev/mapper/

total 0

crw------- 1 root root 10, 236 Aug  9 07:32 control

lrwxrwxrwx 1 root root       7 Aug  9 07:32 sdb1 -> ../dm-0

```

So i try:

```

# cryptsetup luksOpen /dev/sdb1 stackback

Enter passphrase for /dev/sdb1:

device-mapper: reload ioctl failed: Invalid argument

Failed to setup dm-crypt key mapping for device /dev/sdb1.

Check that kernel supports aes-cbc-essiv:sha256 cipher (check syslog for more info).

Failed to read from key storage.

```

Checking /proc/crypto

```

# cat /proc/crypto | grep aes

name         : ecb(aes)

driver       : ecb(aes-asm)

name         : cbc(aes)

driver       : cbc(aes-asm)

name         : cbc(aes)

driver       : cbc(aes-asm)

name         : aes

driver       : aes-asm

module       : aes_x86_64

name         : aes

driver       : aes-generic

module       : aes_generic

```

Anything obviously wrong this far?

I'm only 90% sure about my password, it's a long time since i set this up, and I don't write passwords down. But this doesn't look like a password issue.

----------

## Atle

dmesg:

```

device-mapper: table: 253:1: crypt: Device lookup failed

device-mapper: ioctl: error adding target to table

```

----------

## Skymotz

maybe it's not the aes that's missing but the sha256...

```

cat /usr/src/linux/.config | grep SHA

```

could be interesting

----------

## Atle

```

# grep SHA .config

CONFIG_SCTP_HMAC_SHA1=y

CONFIG_SERIAL_8250_SHARE_IRQ=y

CONFIG_CRYPTO_SHA1=m

CONFIG_CRYPTO_SHA256=m

CONFIG_CRYPTO_SHA512=m

tin linux # lsmod | grep sha

tin linux #

```

----------

## Skymotz

seems for some reason sha256 module doesn't get loaded automagically

```

modprobe sha256_generic

lsmod

# try to mount again

```

if that doesn't work, maybe look at aes: maybe it's also a module that doesn't get loaded?

----------

## Atle

Modprobe works, but I get the same error when I use luksOpen.

----------

## Skymotz

hmmm

what does

```

cryptsetup isLuks /dev/sdb1

```

say?

----------

## Atle

Hello again,

I've been able to mount the partition using a live CD. So the problem is something with my system. The strange thing is that I don't think I've upgraded anything since the last time it worked.

However, that is also the reason I will replace gentoo with a simpler to administrate distro on this machine. I just don't have the time. So the problem, if not solved, is no longer necessary to solve. I got to the content, and that was all I needed to do at this time.

But thanks for the suggestions.

----------

## Skymotz

well, I tried that once and went to debian which I used before gentoo ... came back crawling after a short time because I only where to configure stuff under gentoo. if you just don't have the time to compile, try sabayon.

good luck!

----------

## Atle

I love gentoo, and will keep using it at home. But for my computer at work, I've found that I don't have the necessary time to give it the love it deserves.

I've had the same experience as you earlier, and never found a distro I was comfortable with, and always returned to gentoo. But after trying a few, I have found one that works well for me, and doesn't have too many custom solutions that makes custom configuration and problem solving too difficult.

----------

