User Tools

Site Tools


en:linux:scripts:11-mnt-media-auto-mountrules

/etc/udev/rules.d/11-mnt-media-auto-mount.rules

Udev rules for automatic media mounting.

# KERNEL!="sd[a-z][0-9]", GOTO="mnt_media_auto_mount_end"
# 
# # Global mount options
# ACTION=="add", ENV{mount_options}="relatime,users"
# # Filesystem specific options
# ACTION=="add", PROGRAM=="/lib/initcpio/udev/vol_id -t %N", RESULT=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"
# 
# ACTION=="add", RUN+="/bin/mkdir -p /mnt/usbhd-%k", RUN+="/bin/mount -o $env{mount_options} /dev/%k /mnt/usbhd-%k", RUN+="/bin/ln -s /mnt/usbhd-%k /media/usbhd-%k"
# ACTION=="remove", RUN+="/bin/rm -f /media/usbhd-%k", RUN+="/bin/umount -l /mnt/usbhd-%k", RUN+="/bin/rmdir /mnt/usbhd-%k"
# LABEL="mnt_media_auto_mount_end"
en/linux/scripts/11-mnt-media-auto-mountrules.txt · Last modified: 2010/01/19 14:19 (external edit)