SCIENTIFIC-LINUX-USERS Archives

November 2013

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Andrew Z <[log in to unmask]>
Reply To:
Date:
Tue, 12 Nov 2013 11:46:26 -0500
Content-Type:
multipart/alternative
Parts/Attachments:
text/plain (2803 bytes) , text/html (4 kB)
after some reading, it appears that my intention to use udev rules for
"automount" is ill thought of.
It appears that udisks (devicekit) is the way to handle this type of
requirements.
I found good intro here -
http://www.scribd.com/doc/63425975/Introduction-to-Udisks




On Fri, Nov 1, 2013 at 12:06 PM, Andrew Z <[log in to unmask]> wrote:

> 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----
>
> after fresh reboot :
> <---start copy/paste-->
> udevadm monitor --udev
> monitor will print the received events for:
> UDEV - the event which udev sends out after rule processing
>
> <--- plugging the SD in --->
> UDEV  [1383321790.616432] change
> /devices/pci0000:00/0000:00:02.0/usb2/2-6/2-6:1.0/host6/target6:0:0/6:0:0:0/block/sdc
> (block)
> UDEV  [1383321792.625084] add      /module/fat (module)
> UDEV  [1383321792.638649] add      /module/vfat (module)
> UDEV  [1383321792.886526] add
> /devices/pci0000:00/0000:00:02.0/usb2/2-6/2-6:1.0/host6/target6:0:0/6:0:0:0/block/sdc/sdc1
> (block)
> UDEV  [1383321792.887997] change
> /devices/pci0000:00/0000:00:02.0/usb2/2-6/2-6:1.0/host6/target6:0:0/6:0:0:0
> (scsi)
> UDEV  [1383321794.141120] change
> /devices/pci0000:00/0000:00:02.0/usb2/2-6/2-6:1.0/host6/target6:0:0/6:0:0:0/block/sdc
> (block)
>
> <---pulling it out --->
> UDEV  [1383321807.046784] change
> /devices/pci0000:00/0000:00:02.0/usb2/2-6/2-6:1.0/host6/target6:0:0/6:0:0:0
> (scsi)
> UDEV  [1383321807.311459] change
> /devices/pci0000:00/0000:00:02.0/usb2/2-6/2-6:1.0/host6/target6:0:0/6:0:0:0/block/sdc
> (block)
>
> <---end copy/paste-->
>
> it is my understanding that there is no "remove" event occurs? But that'
> doesn't sound right.
> Please advise.
>
> Thank you
> AZ
>
>
>


ATOM RSS1 RSS2