Skip to content

Instantly share code, notes, and snippets.

@xsephiroth
Created June 19, 2018 14:14
Show Gist options
  • Save xsephiroth/35db073b57dd5a9e7f66c17c795d0b9e to your computer and use it in GitHub Desktop.
Save xsephiroth/35db073b57dd5a9e7f66c17c795d0b9e to your computer and use it in GitHub Desktop.
udev mount usb by pid uid
# /etc/udev/rules.d/50-usb-mount.rules
ACTION=="add",ATTRS{idVendor}=="0951",ATTRS{idProduct}=="1643",RUN+="/bin/mkdir -p /media/abc",RUN+="/bin/mount -o relatime,sync,utf8,uid=1000,gid=1000,umask=002 /dev/%k /media/abc"
ACTION=="remove",ATTRS{idVendor}=="0951",ATTRS{idProduct}=="1643",RUN+="/bin/umount -l /media/acc",RUN+="/bin/rmdir /media/abc"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment