Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I am trying to create a udev rule to automatically mount a drives exfat partition to /media/offsite. My goal is to automatically mount a drive to /media/offsite and then kick off a .sh script to copy files around. I have been reading many guides and have learned a lot, but I am still getting stuck. Many of the guides are very outdated and apply to USB drives where as I have a docked drive.

Just to see if a rule would trigger, I created this rule in /etc/udev/rules.d/80-external-disk.rules:

ACTION=="add", ENV{DEVTYPE}=="partition", ENV{ID_FS_UUID}=="5359-818E", RUN+="/bin/mount -t exfat -U $env{ID_FS_UUID}"

I reloaded rules, rebooted server, few other things, and it appeared the rule wasn't firing.

udevadm test $(udevadm info -q path -n /dev/sdb) 2>&1 | grep /etc/udev/rules.d

That only produces the following;

parse_file: reading '/etc/udev/rules.d/70-persistent-cd.rules' as rules file
parse_file: reading '/etc/udev/rules.d/70-persistent-net.rules' as rules file
parse_file: reading '/etc/udev/rules.d/80-external-disk.rules' as rules file

My thought is that the UUID belongs to the partition and not the drive. With the partition being an exfat, can UDEV even see that UUID?

share|improve this question
With some help from Jordan_U in IRC, I have determined the disk does show up in /dev/disk/5359-818E. Its just not getting that rule applied to it. – MLindsay May 15 '14 at 20:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.