You are not logged in.
Pages: 1
I'd like to share my udev rules for usb drive & flash pen automount:
KERNEL=="sd?1", ATTRS{vendor}=="Corsair", ATTRS{model}=="Flash Voyager", NAME="%k", SYMLINK+="voyager"
ACTION=="add", KERNEL=="sd?1", ATTRS{vendor}=="Corsair", ATTRS{model}=="Flash Voyager", RUN+="/bin/mkdir /mnt/voyager"
ACTION=="add", KERNEL=="sd?1", ATTRS{vendor}=="Corsair", ATTRS{model}=="Flash Voyager", RUN+="/bin/mount -t vfat -o sync,flush,uid=1000,gid=100 /dev/voyager /mnt/voyager"
ACTION=="remove", KERNEL=="sd?1", ENV{ID_VENDOR}=="Corsair", ENV{ID_MODEL}="Flash_Voyager", RUN+="/bin/umount /mnt/voyager"
ACTION=="remove", KERNEL=="sd?1", ENV{ID_VENDOR}=="Corsair", ENV{ID_MODEL}="Flash_Voyager", RUN+="/bin/rmdir /mnt/voyager"
KERNEL=="sd?1", ATTRS{vendor}=="WD", ATTRS{model}=="1600BEV External", NAME="%k", SYMLINK+="passport"
ACTION=="add", KERNEL=="sd?1", ATTRS{vendor}=="WD", ATTRS{model}=="1600BEV External", RUN+="/bin/mkdir /mnt/passport"
ACTION=="add", KERNEL=="sd?1", ATTRS{vendor}=="WD", ATTRS{model}=="1600BEV External", RUN+="/bin/mount -t vfat -o sync,flush,uid=1000,gid=100 /dev/passport /mnt/passport"
ACTION=="remove", KERNEL=="sd?1", ENV{ID_VENDOR}=="WD", ENV{ID_MODEL}="1600BEV_External", RUN+="/bin/umount /mnt/passport"
ACTION=="remove", KERNEL=="sd?1", ENV{ID_VENDOR}=="WD", ENV{ID_MODEL}="1600BEV_External", RUN+="/bin/rmdir /mnt/passport"
That's what I came up with consulting guide Writing udev rules guide.
I've run into problem that was not immediately obvious to me. Udev won't recognize devices by ATTRS match-keys on remove. I had to use ENV keys, like guy in this thread.
Everything seems to work fine . I'll see if my files start disappearing from my external drive .
Any suggestions for improvement (like better mount options)?
Thanks
Offline
Pages: 1