I have a udev rule that mounts my encfs encrypted backup disk:
ACTION=="add",KERNEL=="sd*1",ENV{ID_SERIAL}=="Seagate_GoFlex_Desk_NA0MEYKM-0:0"
,SYMLINK="ext_hd",RUN+="/root/bin/mount.encfs 'Large Backup Drive' /dev/%k"
The contents of mount.encfs are:
#!/bin/bash
set -e
export XAUTHORITY=/home/me/.Xauthority
export DISPLAY=:0.0
NAME=$1
DEV=$2
ENCRYPTED_MOUNT_POINT=/media/ext_hd.encfs
UNENCRYPTED_MOUNT_POINT=/media/ext_hd
[ ! -e $ENCRYPTED_MOUNT_POINT ] && mkdir $ENCRYPTED_MOUNT_POINT
[ ! -e $UNENCRYPTED_MOUNT_POINT ] && mkdir $UNENCRYPTED_MOUNT_POINT
mount -t ext4 $DEV $ENCRYPTED_MOUNT_POINT
encfs -o allow_other --extpass="ssh-askpass $NAME" \
$ENCRYPTED_MOUNT_POINT $UNENCRYPTED_MOUNT_POINT
When I insert the disk, I get the prompt, but when I try to ls /media/ext_hd, I get the classic FUSE:
ls: cannot access '/media/ext_hd': Transport endpoint is not connected
If I manually umount then manually run my mount.encfs, it works.
The output from mount is the same for the two cases:
encfs on /media/ext_hd type fuse.encfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other)
I'm at a loss as to what could cause this, whose fault it is, or even what the next debug step should be. Any ideas?