Hello,
i'm trying to understand why i'm not getting action="remove" and how to make it work.
Here are the details:
SD card is been plugged into the internal SD reader. Rules fire up, create a subdir per partition and mount the card.- Life is good
SD card is been pulled out of the SD reader - no rules are been executed. SD is still been mounted.
Here are the rules:
---start copy/paste---
cat /etc/udev/rules.d/50-card.rules
# SD reader
KERNEL=="sd[a-z][0-9]",SUBSYSTEM=="block",BUS=="scsi",SYSFS{rev}=="1.00",SYSFS{model}=="USB SD Reader ",SYSFS{vendor}=="Generic ",NAME{all_partitions}="%k",SYMLINK+="cardreader/SD%n"
ACTION=="add",KERNEL=="sd[a-z][0-9]",SUBSYSTEM=="block",BUS=="scsi",SYSFS{rev}=="1.00",SYSFS{model}=="USB SD Reader ",SYSFS{vendor}=="Generic ",NAME{all_partitions}="%k",RUN+="/bin/mkdir /media/SD/sd%n",RUN+="/bin/mount -t auto -o users,rw /dev/cardreader/SD%n /media/SD/sd%n"
ACTION=="remove",KERNEL=="sd[a-z][0-9]",SUBSYSTEM=="block",BUS=="scsi",SYSFS{rev}=="1.00",SYSFS{model}=="USB SD Reader ",SYSFS{vendor}=="Generic ",NAME{all_partitions}="%k",RUN+="/bin/umount /dev/cardreader/SD%n",RUN+="/bin/rmdir /media/SD/sd%n"
--- end of copy/paste----