Pues como tengo esto un poco abandonado escribiré algo rápido, resulta que me he cambiado a Fluxbox, popular gentor de ventanas bastante ligerito, y ya no tenía “automontado” de memorias USB. Así que tome unas reglas Udev (de las cuales ya había hablado en artículos anteriores) y las extendí con un comentario que esta disponible en el foro de Gentoo, las reglas incluso montan Memory Stick Pro pero hay un error raro de E/S cuando manipulas algunos de los datos. Espero resolverlo pronto.
No tengo unidades con NTFS así que no hay reglas para ese sistema de archivos, aunque quizás funcione con las reglas que ya están hechas.
Espero que como yo puedan liberarse con esto de pmount o ivman (soluciones que encuentras en todos los Howto cuando buscas sobre el tema), lo único que tienen que hacer es crear un archivo donde guardar las reglas: /etc/udev/rules.d/10-automount.rules, e iniciar Udev y Hal.
# Example udev rules for automounting usb volumes. Pulled from # http://forums.gentoo.org/viewtopic-t-720401-highlight-automount.html # To be placed in /etc/udev/rules.d/ # Match the mounted volume KERNEL=="sd[b-z]", NAME="%k", GROUP="users", OPTIONS="last_rule" KERNEL=="mmcblk[0-9]", NAME="%k", GROUP="users", OPTIONS="last_rule" KERNEL=="mspblk[0-9]", NAME="%k", GROUP="users", OPTIONS="last_rule" # Add the volume ACTION=="add", KERNEL=="sd[b-z][0-9]", GROUP="users", NAME="%k" ACTION=="add", KERNEL=="mmcblk[0-9]p[0-9]", GROUP="users", NAME="%k" ACTION=="add", KERNEL=="mspblk[0-9]p[0-9]", GROUP="users", NAME="%k" # Create the mount point ACTION=="add", KERNEL=="sd[b-z][0-9]", RUN+="/bin/mkdir -p /mnt/%k" ACTION=="add", KERNEL=="mmcblk[0-9]p[0-9]", RUN+="/bin/mkdir -p /mnt/%k" ACTION=="add", KERNEL=="mspblk[0-9]p[0-9]", RUN+="/bin/mkdir -p /mnt/%k" # Some udev magic runs this mount command if vfat is detected, else it falls # through to the next rule, which tries to autodetect the fstype ACTION=="add", KERNEL=="sd[b-z][0-9]", PROGRAM=="/lib/udev/vol_id -t %N", RESULT=="vfat", RUN+="/bin/mount -t vfat -o rw,noauto,flush,quiet,nodev,nosuid,noexec,noatime,dmask=000,fmask=111,umask=007 /dev/%k /mnt/%k", OPTIONS="last_rule" ACTION=="add", KERNEL=="mmcblk[0-9]p[0-9]", PROGRAM=="/lib/udev/vol_id -t %N", RESULT=="vfat", RUN+="/bin/mount -t vfat -o rw,noauto,flush,quiet,nodev,nosuid,noexec,noatime,dmask=000,fmask=111 /dev/%k /mnt/%k", OPTIONS="last_rule" ACTION=="add", KERNEL=="mspblk[0-9]p[0-9]", PROGRAM=="/lib/udev/vol_id -t %N", RESULT=="vfat", RUN+="/bin/mount -t vfat -o rw,noauto,flush,quiet,nodev,nosuid,noexec,noatime,dmask=000,fmask=111 /dev/%k /mnt/%k", OPTIONS="last_rule" # Mount the volume ACTION=="add", KERNEL=="sd[b-z][0-9]", RUN+="/bin/mount -t auto -o rw,noauto,sync,dirsync,noexec,nodev,noatime /dev/%k /mnt/%k", OPTIONS="last_rule" ACTION=="add", KERNEL=="mmcblk[0-9]p[0-9]", RUN+="/bin/mount -t auto -o rw,noauto,sync,dirsync,noexec,nodev,noatime /dev/%k /mnt/%k", OPTIONS="last_rule" ACTION=="add", KERNEL=="mspblk[0-9]p[0-9]", RUN+="/bin/mount -t auto -o rw,noauto,sync,dirsync,noexec,nodev,noatime /dev/%k /mnt/%k", OPTIONS="last_rule" # Rules for umounting volume ACTION=="remove", KERNEL=="sd[b-z][0-9]", RUN+="/bin/umount -l /mnt/%k" ACTION=="remove", KERNEL=="mmcblk[0-9]p[0-9]", RUN+="/bin/umount -l /mnt/%k" ACTION=="remove", KERNEL=="mspblk[0-9]p[0-9]", RUN+="/bin/umount -l /mnt/%k" # Clean up ACTION=="remove", KERNEL=="sd[b-z][0-9]", RUN+="/bin/rmdir /mnt/%k", OPTIONS="last_rule" ACTION=="remove", KERNEL=="mmcblk[0-9]p[0-9]", RUN+="/bin/rmdir /mnt/%k", OPTIONS="last_rule" ACTION=="remove", KERNEL=="mspblk[0-9]p[0-9]", RUN+="/bin/rmdir /mnt/%k", OPTIONS="last_rule"
Notas:
- Yo como el autor original del foro de Gentoo estoy hecho a la vieja escuela y suelo montar las cosas en /mnt pero pueden cambiarlo fácilmente a /media.
- Diferente a las reglas del comentario original del foro de Gentoo ahora el punto de montaje es igual al nombre de la partición, es decir, /dev/sdb3 se monta en /mnt/sdb3, así no hay confusión.
- Mi disco duro es detectado como sda, por eso la primera regla de cada sección tiene “sd[b-z][0-9]” pero si su disco duro es /dev/hd? pueden cambiarlo a “sd[a-z][0-9]“
También pueden descargar el archivo con las reglas, donde se ven correctamente y no como en WordPress donde se ve medio feo. El archivo lo actualizaré según corrija errores y aumente reglas.