This works on my box, it should work on yours. Make sure you have pmount installed.
If you use thunar or pcmanfm, do not use this method, or edit it accordingly.
Thanks to arch wiki for information.
Code: Select all
KERNEL!="sd*[1-9]*", GOTO="exit"
# Import FS infos
SUBSYSTEMS=="usb", IMPORT{program}="/sbin/blkid -o udev -p %N"
# Get a label if present, otherwise specify one
SUBSYSTEMS=="usb", ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
SUBSYSTEMS=="usb", ENV{ID_FS_LABEL}=="", ENV{dir_name}="usb-%k"
# Global mount options
SUBSYSTEMS=="usb", ACTION=="add", ENV{pmount_options}="--noatime"
# File system specific mount options to avoid auto probing
SUBSYSTEMS=="usb", ACTION=="add", ENV{ID_FS_TYPE}=="ntfs|vfat", ENV{pmount_options}="%E{pmount_options} --umask 007 --charset utf8"
SUBSYSTEMS=="usb", ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", ENV{pmount_options}="%E{pmount_options} -t ntfs-3g"
SUBSYSTEMS=="usb", ACTION=="add", ENV{ID_FS_TYPE}=="vfat", ENV{pmount_options}="%E{pmount_options} -t vfat"
SUBSYSTEMS=="usb", ACTION=="add", ENV{ID_FS_TYPE}=="ext2", ENV{pmount_options}="%E{pmount_options} -t ext2"
SUBSYSTEMS=="usb", ACTION=="add", ENV{ID_FS_TYPE}=="ext3", ENV{pmount_options}="%E{pmount_options} -t ext3"
SUBSYSTEMS=="usb", ACTION=="add", ENV{ID_FS_TYPE}=="ext4", ENV{pmount_options}="%E{pmount_options} -t ext4"
# Mount the device
SUBSYSTEMS=="usb", ACTION=="add", RUN+="/bin/su antiX -c '/usr/bin/pmount $env{pmount_options} /dev/%k /media/%E{dir_name}'"
# Clean up after removal
SUBSYSTEMS=="usb", ACTION=="remove", ENV{dir_name}!="", RUN+="/usr/bin/pumount /dev/%k"
# Exit
LABEL="exit"
Copy/paste into a file, save as 99-usbstorage.rules and put in /etc/udev/rules.d
Next time you plug in a usb device it should auto-mount in rox/media. To unmount, right-click on folder and choose Unmount.
Make sure rox uses pmount/pumount rather than mount/umount. (Options-Action window in rox via right click.)
If you get an error when trying to open the folder, right-click on folder, Properties, and click entries for Group and World.
If you have a testing version of antiX-M11-base, remove usbmount.
I have also changed mountbox in antiXcc to mount usb devices as user.