Hi,
da es gerade um diese Datei geht, ich hätte da noch einen Vorschlag.
Im Werkszustand bindet mld unabhängig von den fstab-Einträgen sämtliche Partitionen ein, die auf dem Rechner zu finden sind. Das ist insofern lästig, weil die dann z.B. bei Kodi in allen möglichen Listen auftauchen.
Mit dieser Änderung in Zeile 3 werden wirklich nur noch USB-Geräte gemountet.
ENV{UDISKS_AUTOMOUNT_HINT}=="never", GOTO="usb_stick_auto_mount_end"
DEVPATH!="*/usb[0-9]/*", GOTO="usb_stick_auto_mount_end"
KERNEL!="sd[a-z][0-9]", KERNEL!="mmcblk[0-9]p[0-9]", GOTO="usb_stick_auto_mount_end"
# Import FS infos
IMPORT{parent}="ID_BUS"
IMPORT{parent}="ID_NAME"
IMPORT{program}="/sbin/blkid -o udev -p %N"
# Get a label if present, otherwise specify one
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
ENV{ID_FS_LABEL}=="", ENV{ID_BUS}!="", ENV{dir_name}="%E{ID_BUS}-%k"
ENV{ID_FS_LABEL}=="", ENV{ID_BUS}=="", ENV{dir_name}="%E{ID_NAME}-%k"
# Clean up after removal
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"
# skip already mounted device
PROGRAM="/bin/grep -q '\s/dev/%k\s' /proc/self/mountinfo", GOTO="usb_stick_auto_mount_end"
# skip devicees of the fstab
PROGRAM="/bin/grep -q '^/dev/%k\s' /etc/fstab", GOTO="usb_stick_auto_mount_end"
ENV{ID_FS_UUID}!="", PROGRAM="/bin/grep -q '^UUID=%E{ID_FS_UUID}\s' /etc/fstab", GOTO="usb_stick_auto_mount_end"
# Global mount options
ACTION=="add", ENV{mount_options}="relatime"
ACTION=="add", ENV{mount_cmd}="/bin/mount"
# Filesystem-specific mount options
ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", ENV{mount_cmd}="/bin/ntfs-3g"
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"
# Mount the device
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="$env{mount_cmd} -o $env{mount_options} /dev/%k /media/%E{dir_name}"
# Exit
LABEL="usb_stick_auto_mount_end"
Gruß
Alex