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:
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.
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.
:::::::::::::: bin/mount- luks
/home/pete/
::::::::::::::
#!/bin/sh
# mount encrypted external USB WD drive
# ASSUMES plugged in disk is /dev/sdb1!!
sudo cryptsetup luksOpen /dev/sdb1 wdcrypt
mount /mnt/wdcrypt
:::::::::::::: bin/unmount- luks
/home/pete/
::::::::::::::
#!/bin/sh
# unmount encrypted external USB WD drive
# ASSUMES plugged in disk is /dev/sdb1!!
umount /mnt/wdcrypt
sudo cryptsetup luksClose wdcrypt