|
pinkspider 發表於 2013-7-23 14:48
cubox 仲有好多地方未攪清, 我仲未知點解hdd 要用FAT32 format. NTFS & exFAT 都未認到, 不過照計冇理由 ...
你可用這個, 我自己整給CUBOX作自己 mount USB 手指的.
vi /etc/udev/rules.d/11-auto-mount.rules
===========================================================
KERNEL=="sdhc*", GOTO="auto_mount_end"
KERNEL=="mmc*", GOTO="auto_mount_end"
KERNEL!="sd[a-z]*", GOTO="auto_mount_end"
ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="auto_mount_end"
# Set environment
ACTION=="add", IMPORT{program}="/sbin/blkid -o udev -p -s TYPE -s LABEL %N"
# Global mount options
ACTION=="add", ENV{mount_options}="ro,relatime,users,umask=0"
# Filesystem specific options
ACTION=="add", ENV{ID_FS_TYPE}=="vfat", ENV{mount_options}="%E{mount_options},showexec"
ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", ENV{mount_options}="%E{mount_options},utf8"
ACTION=="add", ENV{ID_FS_TYPE}=="ext2", ENV{mount_options}="%E{mount_options}"
ACTION=="add", ENV{ID_FS_TYPE}=="ext3", ENV{mount_options}="%E{mount_options}"
ACTION=="add", ENV{ID_FS_TYPE}=="ext4", ENV{mount_options}="%E{mount_options}"
# Get mount point
# use basename to correctly handle labels such as ../mnt/foo
ACTION=="add", ENV{ID_FS_LABEL}=="?*", PROGRAM="/usr/bin/basename '%E{ID_FS_LABEL}'", ENV{dir_name}="%c"
ACTION=="add", ENV{dir_name}!="?*", ENV{dir_name}="usbhd-%k"
# Main action
ACTION=="add", ENV{dir_name}=="?*", RUN+="/bin/mkdir -p '/var/lib/mpd/music/USB/%E{dir_name}'", RUN+="/bin/mount -o %E{mount_options} /dev/%k '/var/lib/mpd/music/USB/%E{dir_name}'", RUN+="/usr/bin/mpc update"
ACTION=="remove", ENV{dir_name}=="?*", RUN+="/bin/umount -l '/var/lib/mpd/music/USB/%E{dir_name}'", RUN+="find /var/lib/mpd/music/USB -type d -empty -delete", RUN+="/usr/bin/mpc update"
LABEL="auto_mount_end"
# label must be cleared
ENV{ID_FS_LABEL}=""
===========================================================
它會視不同的 file system 用上不同參數. 但我有時也不能出中文. 有時間你也幫忙研究一下吧. |
評分
-
查看全部評分
|