|
发表于 2014-10-27 08:35:53
|
显示全部楼层
输入命令:
sudo nano /etc/udev/rules.d/10-usbstorage.rules- KERNEL!="sd*", GOTO="media_by_label_auto_mount_end"
- SUBSYSTEM!="block",GOTO="media_by_label_auto_mount_end"
- IMPORT{program}="/sbin/blkid -o udev -p %N"
- ENV{ID_FS_TYPE}=="", GOTO="media_by_label_auto_mount_end"
- ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
- ENV{ID_FS_LABEL}=="", ENV{dir_name}="Untitled-%k"
- ACTION=="add", ENV{mount_options}="relatime,sync"
- ACTION=="add", ENV{ID_FS_TYPE}=="vfat", ENV{mount_options}="iocharset=utf8,umask=000"
- ACTION=="add", ENV{ID_FS_TYPE}=="ntfs-3g", ENV{mount_options}="iocharset=utf8,umask=000"
- ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/%E{dir_name}"
- ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"
- LABEL="media_by_label_auto_mount_end"
复制代码 |
|