This script checks if any process is using the mountpoint and unmounts the fs and removes the mapper if no one is using it:nero wrote:I'd like to see a script for this that would monitor IO on that file and then automatically unmount it and destroy the loop device. I have a terrible history of forgetting to do things like this.
/me leaves to figure out how to monitor the file IO...
--sean
Code: Select all
#!/bin/sh
fuser -m /mnt/secure > /dev/null || (umount /mnt/secure/; cryptsetup remove secure)You can have cron execute it every 10 minutes or so.





