Hi Peter,
Am using your above below rules modified as below fro monitoring USB insertion, this is working fine
ACTION=="add", KERNEL=="sd[a-z]*", SUBSYSTEM=="block", KERNELS=="fsl-ehci",RUN+="/usr/bin/usb_init add %k 1"
ACTION=="add", KERNEL=="sd[a-z]*", SUBSYSTEM=="block", KERNELS=="fsl-ehci.0",RUN+="/usr/bin/usb_init add %k 2"
For monitoring USB removal,
ACTION=="remove", ENV{DEVPATH}=="/devices/platform/fsl-ehci/usb1/1-1", RUN+="/usr/bin/usb_init remove %k 1"
ACTION=="remove", ENV{DEVPATH}=="/devices/platform/fsl-ehci.0/usb2/2-1", RUN+="/usr/bin/usb_init remove %k 2"
ACTION=="remove", ENV{DEVPATH}=="/devices/platform/fsl-ehci/usb1/1-1", RUN+="/bin/umount -l /media1/%k"
ACTION=="remove", ENV{DEVPATH}=="/devices/platform/fsl-ehci.0/usb2/2-1", RUN+="/bin/umount -l /media2/%k"
When I remove & insert frequently I get the following errors
FAT: Directory bread(block 30509) failed
FAT: Directory bread(block 30510) failed
FAT: Directory bread(block 30511) failed
FAT: Directory bread(block 30512) failed
FAT: Directory bread(block 30513) failed
FAT: Directory bread(block 30514) failed
FAT: Directory bread(block 30515) failed
FAT: Directory bread(block 1151804) failed
FAT: Directory bread(block 1151805) failed
FAT: Directory bread(block 1151806) failed
FAT: Directory bread(block 1151807) failed
FAT: Directory bread(block 1151808) failed
FAT: Directory bread(block 1151809) failed
FAT: Directory bread(block 1151810) failed
FAT: Directory bread(block 1151811) failed
When I tried to manually umount as below am unbale to umount
root@CMS5 /media1$ umount -l *
umount: can't forcibly umount sdb: Invalid argument
umount: can't forcibly umount sdc: Invalid argument
umount: can't forcibly umount sdd: Invalid argument
umount: can't forcibly umount sde: Invalid argument
umount: can't forcibly umount sdf: Invalid argument
umount: can't forcibly umount sdh: Invalid argument
umount: can't forcibly umount sdi: Invalid argument
umount: can't forcibly umount sdj: Invalid argument
umount: can't forcibly umount sdl: Invalid argument
root@CMS5 /media1$
Could you please help me in resolving the above errors as early as possible
Kindly do the needful as early as possible
Awaiting for your replies
Many Many Thanks in advance