unsatisfactory workaround to do the whole thing manually.

NOTE: assumes that your external LUKS encrypted drive is mounted as
/dev/sdb1 and the device name in /dev/mapper is wdcrypt.  Change these
for your own situation.

Create 2 scripts - mount-luks and unmount-luks (or umount-luks if you
are a purest!) as below, and make executable. This also assumes you have
something like:

   /dev/mapper/wdcrypt  /mnt/wdcrypt    ext3
user,atime,noauto,rw,dev,exec,owner

in /etc/fstab.

Run the mount-luks script, and you get prompted for a password, then the
disk gets mounted.   unmount-luks umounts it so you can unplug it. Not
exactly seamless but as an interim measure it's OK.

::::::::::::::
/home/pete/bin/mount-luks
::::::::::::::
#!/bin/sh

# mount encrypted external USB WD drive
# ASSUMES plugged in disk is /dev/sdb1!!

sudo cryptsetup luksOpen /dev/sdb1 wdcrypt
mount /mnt/wdcrypt


::::::::::::::
/home/pete/bin/unmount-luks
::::::::::::::
#!/bin/sh

# unmount encrypted external USB WD drive
# ASSUMES plugged in disk is /dev/sdb1!!

umount /mnt/wdcrypt
sudo cryptsetup luksClose wdcrypt

-- 
Plugging in a LUKS device causes the following error: Error unlocking device: 
cryptsetup exited with exit code 239: Command failed: Device already exists
https://bugs.launchpad.net/bugs/484429
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to