At work I will start to handle sensitive information. Encrypted USB-sticks is a convenient way of handling sensitive data. To auto-mount such USB-sticks I needed to add a row to ivman configuration, that started a new terminal-window for accepting input (the pass-phrase) to pmount.
Here is the needed row:
<ivm:Match name="ivm.mountable" value="true"> <ivm:Option name="mount" value="true" /> <ivm:Option name="exec" value="x-terminal-emulator -e pmount '$hal.block.device$'" /> </ivm:Match>
I already had this to open mc with in a any newly mounted volumes:
<ivm:Match name="hal.volume.is_mounted" value="true"> <ivm:Option name="exec" value="bin/removable-media '$hal.volume.mount_point$'" /> </ivm:Match>
Where bin/removable-media contained something in the lines of
#!/bin/bash export LC_ALL=sv_SE.utf8 x-terminal-emulator -e mc "$1" pumount "$1"
Auto-unmounting it when mc is closed.
Together, this gives:
It would be nice to have the possibility to let the new mountpoint be $HOME, however running programs would be confused, so it should be done when no programs with open files are running. Either run only the window-manager when you insert the stick, or have a test in .xsession that looks for an unmounted usb-stick and if any is found, then runs the script above and then bind-mounts $HOME to new mountpoint.