Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

I am using ubuntu 10.04 LTS - Locid Lynx. I have a requirement to set specific group and permissions for any usb stick file/directories on mount. I have tried overwriting the udev rules. Here is what I have done:

  1. Created 99-test.rules under /etc/udev/rules.d/ directory with content as SUBSYSTEMS=="usb",GROUP="tomcat6",MODE="0777",NAME="test"
  2. sudo service udev restart

Now when I mount the usb stick and run 'sudo blkid', it prints

/dev/test: UUID="002A-0AA5" TYPE="vfat"

But the ls -l /media/ gives back

drwx------ 4 admin admin 8192 1969-12-31 16:00 002A-0AA5

It seems that above rule from 99-test.rules is getting applied but getting overwritten afterwards, thus changing group and permissions back to some default value. What is it I am missing here? Do I have to change anything else?

share|improve this question
An aside: I gather from the name that you are testing this rule, but before you actually put it in place you might want to add something like KERNEL=="sd?1" so it does only apply to USB storage devices (and not cameras, audio devices, etc). – John S Gruber Aug 13 '12 at 17:36

This works for me:

  • I don't know why, but ACTION== stopped the rule from working at all.

  • The kernel rule was necessary to avoid a conflict between the stick and the stick's partition, I suspect that was the problem you were seeing.

  • The symlink is to get rid of an error message about a conflict between the kernel device name and the rule device name. You get a /dev/test that has a symlink to /dev/sdb1, or such.

On 12.04 restarting udev wasn't necessary when testing the rule. Error messages were logged at /var/log/syslog, so I used tail -f /var/log/syslog as I mounted the USB drive to watch for them.

You may wish to add more tests so you can limit your rule to just the drive(s) you want /dev/test to map to in case you might plug a camera or other device in simultaneously with you memory stick.

share|improve this answer

Try to add ACTION=="add" as trigger for that rule.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.