udevil & devmon

created onJanuary 19, 2022

mounting removable media with udevil & devmon

udevil is a Linux command line tools which mounts and unmounts removable devices. From it’s authors', it’s meant to be a ‘hasslefree’ udisk replacement. It monitors device changes and lists device information. udevil comes with devmon, a daemon script to automount and unmount optical and removable drives.

devmon uses udevil to monitor and mount devices.

start devmon in demon mode

devmon 2>&1 > /dev/null &

mounting usb devices by UUID

Create the script with the following content:

#!/bin/bash uuid=`udevil info $1 | grep '^ uuid:' | sed 's/^ uuid: *\(.*\)/\1/'` udevil mount $1 /media/$uuid

run devmon:

devmon --no-mount --exec-on-drive "/usr/local/bin/devmonmount %d"

references

udevil man page

IgnorantGuru's Blog Script: devmon