红联Linux门户
Linux帮助

LFS系统usb设备的自动加载的UDEV设置

发布时间:2007-07-17 22:20:48来源:红联作者:postnew
自动加载usb设备

KERNEL=="sd[a-z]", , SYMLINK+="usb%m", GROUP="users", OPTIONS="last_rule"
ACTION=="add", KERNEL=="sd[a-z][0-9]", SYMLINK+="usb%n", GROUP="users",
ACTION=="add", KERNEL=="sd[a-z][0-9]", RUN+="/bin/mkdir -p /mnt/usb%n"
ACTION=="add", KERNEL=="sd[a-z][0-9]", PROGRAM=="/lib/udev/vol_id -t %N", RESULT=="vfat", RUN+="/bin/mount -t vfat -o rw,noauto,sync,dirsync,noexec,nodev,noatime,dmask=000,fmask=111 /dev/%k /mnt/usb%n", OPTIONS="last_rule"
ACTION=="add", KERNEL=="sd[a-z][0-9]", RUN+="/bin/mount -t auto -o rw,noauto,sync,dirsync,noexec,nodev,noatime /dev/%k /mnt/usb%n", OPTIONS="last_rule"
ACTION=="remove", KERNEL=="sd[a-z][0-9]", RUN+="/bin/umount -l /mnt/usb%n"
ACTION=="remove", KERNEL=="sd[a-z][0-9]", RUN+="/bin/rmdir /mnt/usb%n", OPTIONS="last_rule"

把这些udev规则放到/etc/udev/rules.d/下任何一个文件名以.rules结尾的文件中,例如/etc/udev/rules.d/sda.rules。
文章评论

共有 1 条评论

  1. 193.235.87.* 于 2007-08-24 01:50:07发表:

    I bookmarked this guestbook. Thank you for good job
    http://hometown.aol.com/lorropizwirewi/herbal-medicine-for-erectile-dysfunction.html
    impotence treatment erectile dysfunction treatment
    impotence treatment erectile dysfunction treatment