Last active
August 29, 2015 14:07
-
-
Save fxlv/bd444a76f0df1a2783ab to your computer and use it in GitHub Desktop.
10-usbtest.rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# add this to your /etc/udev/rules.d | |
# | |
# then run "udevadm control --reload-rules" | |
# and your flash will be automounted whenever you insert it | |
ATTRS{model}=="USB Flash Drive ", ATTRS{vendor}=="ADATA ", SYMLINK+="usbflash-adata%n" | |
ACTION=="add", ATTRS{model}=="USB Flash Drive ", ATTRS{vendor}=="ADATA ", RUN+="/bin/mkdir -p /mnt/usbflash-adata%n" | |
ACTION=="add", ATTRS{model}=="USB Flash Drive ", ATTRS{vendor}=="ADATA ", RUN+="/bin/mount /dev/%k /mnt/usbflash-adata%n" | |
ACTION=="remove", ATTRS{model}=="USB Flash Drive ", ATTRS{vendor}=="ADATA ", RUN+="/bin/umount -l /mnt/usbflash-adata%n" | |
ACTION=="remove", ATTRS{model}=="USB Flash Drive ", ATTRS{vendor}=="ADATA ", RUN+="/bin/rmdir /mnt/usbflash-adata%n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment