Thank you, that is a nice little program.


So I got the auto mount and unmount to work but those are now the only commands that do work. Do you seen anything wrong with these rules? Does standard echo outputs not work in udev? I’m trying to start a program I have compiled in the root folder called /root/microowl. This program is not launching.


KERNEL=="sda1", ACTION=="remove", RUN+="/bin/umount /mnt/usb"

KERNEL=="sda1", ACTION=="remove", RUN+="/bin/echo 'Unmounting USB'"

KERNEL=="sda1", ACTION=="add", RUN+="/root/microowl"

KERNEL=="sda1", ACTION=="add", RUN+="/bin/mount /mnt/usb"

KERNEL=="sda1", ACTION=="add", RUN+="/bin/echo 'Mounting USB'"


Thanks for looking this over,




From: [] On Behalf Of Craig Hughes
Sent: Friday, June 29, 2007 12:12 PM
To: General mailing list for gumstix users.
Subject: Re: [Gumstix-users] Udev rules to automount USB thumbdrive


On Jun 29, 2007, at 10:10 AM, Joshua Hintze wrote:

Hey guys,


I’m trying to write some udev rules to automount the USB thumbdrive on the Verdex. I’m following the same pattern that was already on there for the mmc card rules. Here are my rules…


KERNEL=="sda1", ACTION=="remove", RUN+="/bin/umount /mnt/usb" RUN+="/bin/echo 'Unmounting USB'"

KERNEL=="sda1", ACTION=="add", RUN+="/bin/mount /mnt/usb" RUN+="/bin/echo 'Mounting USB'"


Now the interesting thing is that the “add” rule works and it does mount the usb thumbdrive on insertion (it previous did not do this). But the remove rule does not unmount the file system. If I just type in the console after the thumb drive has been removed “/bin/umount /mnt/usb” it does work.


Any suggestions? Also my echo statements are NOT being displayed.


use udevmonitor to see if the remove event is firing the way you think it should.