Create "98-usb-mount.rules" file at /lib/udev/rules.d. Add the following rules in the file.
KERNEL=="sd?[0-9]", ACTION=="add", RUN+="/bin/mkdir -p /media/usb", RUN+="/bin/mount -o gid=1000,uid=1000 /dev/%k /media/usb"
KERNEL=="sd?[0-9]", ACTION=="remove", RUN+="/bin/umount /media/usb", RUN+="/bin/rmdir /media/usb"
KERNEL=="sd?[0-9]", ACTION=="add", RUN+="/bin/mkdir -p /media/usb", RUN+="/bin/mount -o gid=1000,uid=1000 /dev/%k /media/usb"
KERNEL=="sd?[0-9]", ACTION=="remove", RUN+="/bin/umount /media/usb", RUN+="/bin/rmdir /media/usb"
No comments:
Post a Comment