Users repeatedly complain about lost data on USB thumb drives after they unplugged them without unmounting. We run Ubuntu 14.04 LTS on our machines. Auto-mounting is enabled.
As I am tired of remembering them to do a safe removal before unplugging, I want to make Ubuntu display an alert whenever a mounted USB drive is unplugged.
I thought of adding an
udev rule that runs
notify-send on removal in case the drive is still mounted. How can I determine if the USB drive was mounted upon removal?