Comment 8 for bug 484429

Revision history for this message
Pete Phillips (pete-smtl) wrote :

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