User Tools

Site Tools


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

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:linux:scripts:11-mnt-media-auto-mountrules [2010/01/19 14:19] (current)
Line 1: Line 1:
 +===== /​etc/​udev/​rules.d/​11-mnt-media-auto-mount.rules =====
 +
 +Udev rules for automatic media mounting.
 +
 +<​code>​
 +# 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"​
 +</​code>​
  
en/linux/scripts/11-mnt-media-auto-mountrules.txt · Last modified: 2010/01/19 14:19 (external edit)