# Decryption of volume on start

## ernov

Hi, I'be been following this document on setting up encrypted partition, but it doesn't work as expected. On startup I get: cryptsetup will be called with: luksOpen /dev/sdb2 sdb2 Enter passphrase for /dev/sdb2. 

Why doesn't it decrypt automatically?

----------

## Hu

You need to provide more information.  What is /dev/sdb2?  The only thing in that document that calls for activity at startup is encrypted swap, which is not intended to be automatic.

----------

## ernov

/dev/sdb2 is an encrypted partition mapped to /dev/mapper/sdb2

```
ls -l /dev/mapper/sdb2 

lrwxrwxrwx 1 root root 7 05-29 18:49 /dev/mapper/sdb2 -> ../dm-0
```

Mounts fine manually, but requires password on startup.

----------

## Hu

I gathered that much from your original post.  My point is, why do you expect that sdb2 should not behave in this way?  If /dev/mapper/sdb2 is your swap device, then everything is working as intended.  Please post the output of nl /etc/fstab ; nl /etc/conf.d/dmcrypt ; nl /proc/mounts.  Run that last one after you have logged in to your user account.

----------

## ernov

/dev/sdb2 is not swap, it's just data partition which in fstab looks:

```
/dev/mapper/sdb2        /muz            ext4    user,noatime,nodev,nosuid,noexec         0 0
```

/etc/conf.d/dmcrypt is:

```
target=sdb2

source="/dev/sdb2"
```

/dev/mapper/sdb2 requires password on system startup and then manual mounting - after that all is ok, but I want to be unlocked/decrypted and mounted on boot.

----------

