udev
Zde je nastavení udev 0.056 a odpovídající část v /etc/fstab, díky které mám čtečku paměťových karet a jeden flashdisk přístupný pomocí symlinků, ať je mu přiřazeno jakékoliv zařízení.
/etc/udev/rules.d/my_dev.rules
BUS="scsi" SYSFS{model}="USB Storage-SMC" NAME="%k" SYMLINK="card_sm" OWNER="root" MODE="0600" BUS="scsi" SYSFS{model}="USB Storage-CFC" NAME="%k" SYMLINK="card_cf" OWNER="root" MODE="0600" BUS="scsi" SYSFS{model}="USB Storage-SDC" NAME="%k" SYMLINK="card_sd" OWNER="root" MODE="0600" BUS="scsi" SYSFS{model}="USB Storage-MSC" NAME="%k" SYMLINK="card_ms" OWNER="root" MODE="0600" BUS="scsi" SYSFS{model}="MassStorage Disk" NAME="%k" SYMLINK="flash" OWNER="root" MODE="0600"
Co napsat k SYSFS{model} je k nalezení v /sys/bus/scsi/.../model.
/etc/fstab
/dev/cdrom /media/cdrom auto ro,user,noauto 0 0 /dev/card_sd /media/card_sd vfat rw,user,noauto,noatime,umask=133,dmask=022 0 0 /dev/card_cf /media/card_cf vfat rw,user,noauto,noatime,umask=133,dmask=022 0 0 /dev/card_sm /media/card_sm vfat rw,user,noauto,noatime,umask=133,dmask=022 0 0 /dev/card_ms /media/card_ms vfat rw,user,noauto,noatime,umask=133,dmask=022 0 0 /dev/flash /media/flash vfat rw,user,noauto,noatime,umask=133,dmask=022 0 0 /dev/sda1 /media/usb1 auto rw,user,noauto,noatime,umask=133,dmask=022 0 0 /dev/sdb1 /media/usb2 auto rw,user,noauto,noatime,umask=133,dmask=022 0 0 /dev/sdc1 /media/usb3 auto rw,user,noauto,noatime,umask=133,dmask=022 0 0 /dev/sdd1 /media/usb4 auto rw,user,noauto,noatime,umask=133,dmask=022 0 0 /dev/sde1 /media/usb5 auto rw,user,noauto,noatime,umask=133,dmask=022 0 0
~/.bashrc
# mount aliases alias mntcf='mount /media/card_cf' alias umntcf='umount /media/card_cf' alias mntms='mount /media/card_ms' alias umntms='umount /media/card_ms' alias mntsd='mount /media/card_sd' alias umntsd='umount /media/card_sd' alias mntsm='mount /media/card_sm' alias umntsm='umount /media/card_sm' alias mntf='mount /media/flash' alias umntf='umount /media/flash' alias mnt1='mount /media/usb1' alias umnt1='umount /media/usb1' alias mnt2='mount /media/usb2' alias umnt2='umount /media/usb2' alias mnt3='mount /media/usb3' alias umnt3='umount /media/usb3' alias mnt4='mount /media/usb4' alias umnt4='umount /media/usb4' alias mnt5='mount /media/usb5' alias umnt5='umount /media/usb5' alias mntcd='mount /dev/cdrom' alias umntcd='umount /dev/cdrom ; ejcd' alias ejcd='eject /dev/cdrom'