# dmcrypt with remdev and key

## gregf

I just setup dmcrypt using a gpg key on one of my partitions to test. The rest are still using passphrases. I stuick the key on a small usb thumb drive and figured I could just stick it in during boot and avoid typing in my passphrase for each partition if this went well. Here's is what my config looks like right now for the partition using the passphrase.

```

target=tmp

source='/dev/sda4'

remdev='/dev/sdc1'

key='/private_key.gpg''
```

I have dmcrypt at the boot level. When I boot up it says it can't find my key to please insert my removable media. Then after 10 seconds or so it asks if I want to abort or not. I started reading some older posts about this where people were talking about sleeping till the remdev was found discovered and could be mounted but looking at /lib/rscripts/addons/dm-crypt-start.sh there is a 10 second loop looking for it. Anyone have ideas on what I might be doing wrong?

I have also tried putting key='/private_key.gpg:gpg' and tried to remove the /. It does work fine If after I boot up I login and run /etc/init.d/dmcrypt restart. Finds the key instantly. I also noticed the config mentioning keys most not have any '\n''s so I removed those from key as well.

----------

## phil free

You don't tell us very much about your system, but I'd guess your kernel can't handle the USB-drive at this stage of booting, probably due to a missing driver. Depending on your setup I'd either compile them into the kernel (i.e. not as a module) or add them to the initrd (and mind - *all* drivers needed to access the USB-drive).

----------

## gregf

Sorry for the long delay. usb modules are compiled directly into the kernel not as modules. I'll have to look at trying it with a initrd.

----------

## phil free

If "usb modules are compiled directly into the kernel" also means things like

- usb_storage (to use USB-disks)

- vfat/fat (or whatever filesystem you're using on the stick)

- nls_iso8859_* (not sure, if that's really necessary)

then you should be OK. Try to find out which drivers are loaded when you insert the stick on a running system and double-check they are included in the kernel.

Another possibility is a missing gpg (somewhere in the PATH) on the initrd.

Good luck!

----------

## dermartn

hey,

@gregf:

did you solve the problem?

i am looking for an answer for a long time now, but nothing seems to work...   :Crying or Very sad: 

thanks for answers and ideas.

- dermartn

----------

