You are not logged in.
When I plug an SD card into my USB flash card reader it is detected by the kernel but does not automount. I can mount it manually, read/write to it,
and unmount it with no problems.
If I unplug the card reader from the USB port, plug the SD card into the reader and then plug the reader back into the USB port it automounts.
Looks like hot plugging a USB device triggers some magic that hot plugging an SD card does not but I am not familiar enough with udev to find the
magic and attach it to an sd card hot plug event. I have read the udev and udisks wiki pages and relevant man pages but remain unenlightened.
Here is the syslog from plugging in the SD card:
Nov 16 15:14:14 pion kernel: sd 9:0:0:0: [sdc] 1939456 512-byte logical blocks: (993 MB/947 MiB)
Nov 16 15:14:45 pion kernel: usb 5-1.4: reset high-speed USB device number 4 using xhci_hcd
Nov 16 15:14:45 pion kernel: xhci_hcd 0000:03:00.0: Setup ERROR: setup context command for slot 3.
Nov 16 15:14:45 pion kernel: usb 5-1.4: hub failed to enable device, error -22
Nov 16 15:14:45 pion kernel: usb 5-1.4: reset high-speed USB device number 4 using xhci_hcd
Nov 16 15:14:45 pion kernel: xhci_hcd 0000:03:00.0: Setup ERROR: setup context command for slot 3.
Nov 16 15:14:45 pion kernel: usb 5-1.4: hub failed to enable device, error -22
Nov 16 15:14:45 pion kernel: usb 5-1.4: reset high-speed USB device number 4 using xhci_hcd
Nov 16 15:14:45 pion kernel: xhci_hcd 0000:03:00.0: xHCI xhci_drop_endpoint called with disabled ep ffff880211aff240
Nov 16 15:14:45 pion kernel: xhci_hcd 0000:03:00.0: xHCI xhci_drop_endpoint called with disabled ep ffff880211aff288
Nov 16 15:14:46 pion kernel: sdc:
Nov 16 15:14:46 pion devmon[381]: ===========================================
Nov 16 15:14:46 pion devmon[381]: changed: /org/freedesktop/UDisks/devices/sdc
Nov 16 15:14:46 pion udisks-daemon[3305]: **** CHANGING /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host9/target9:0:0/9:0:0:0/block/sdc
Nov 16 15:14:46 pion udisks-daemon[3305]: **** UPDATING /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host9/target9:0:0/9:0:0:0/block/sdc
Nov 16 15:14:46 pion udisks-daemon[3305]: **** EMITTING CHANGED for /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host9/target9:0:0/9:0:0:0/block/sdc
Nov 16 15:14:46 pion udisks-daemon[3305]: **** CHANGED /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host9/target9:0:0/9:0:0:0/block/sdc
Nov 16 15:14:46 pion devmon[381]: device: [/dev/sdc]
Nov 16 15:14:46 pion devmon[381]: systeminternal: [0]
Nov 16 15:14:46 pion devmon[381]: usage: [filesystem]
Nov 16 15:14:46 pion devmon[381]: type: [vfat]
Nov 16 15:14:46 pion devmon[381]: label: []
Nov 16 15:14:46 pion devmon[381]: ismounted: [0]
Nov 16 15:14:46 pion devmon[381]: nopolicy: [0]
Nov 16 15:14:46 pion devmon[381]: hasmedia: [1]
Nov 16 15:14:46 pion devmon[381]: opticaldisc: []
Nov 16 15:14:46 pion devmon[381]: numaudiotracks: []
Nov 16 15:14:46 pion devmon[381]: blank: []
Nov 16 15:14:46 pion devmon[381]: media: []
Nov 16 15:14:46 pion devmon[381]: partition: [0]
Nov 16 15:14:46 pion udisks-daemon[3305]: **** CHANGING /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host9/target9:0:0/9:0:0:0/block/sdc
Nov 16 15:14:46 pion devmon[381]: ===========================================
Nov 16 15:14:46 pion devmon[381]: changed: /org/freedesktop/UDisks/devices/sdc
Nov 16 15:14:46 pion udisks-daemon[3305]: **** UPDATING /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host9/target9:0:0/9:0:0:0/block/sdc
Nov 16 15:14:46 pion udisks-daemon[3305]: **** EMITTING CHANGED for /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host9/target9:0:0/9:0:0:0/block/sdc
Nov 16 15:14:46 pion udisks-daemon[3305]: **** CHANGED /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host9/target9:0:0/9:0:0:0/block/sdc
Nov 16 15:14:46 pion devmon[381]: device: [/dev/sdc]
Nov 16 15:14:46 pion devmon[381]: systeminternal: [0]
Nov 16 15:14:46 pion devmon[381]: usage: [filesystem]
Nov 16 15:14:46 pion devmon[381]: type: [vfat]
Nov 16 15:14:46 pion devmon[381]: label: []
Nov 16 15:14:46 pion devmon[381]: ismounted: [0]
Nov 16 15:14:46 pion devmon[381]: nopolicy: [0]
Nov 16 15:14:46 pion devmon[381]: hasmedia: [1]
Nov 16 15:14:46 pion devmon[381]: opticaldisc: []
Nov 16 15:14:46 pion devmon[381]: numaudiotracks: []
Nov 16 15:14:46 pion devmon[381]: blank: []
Nov 16 15:14:46 pion devmon[381]: media: []
Nov 16 15:14:46 pion devmon[381]: partition: [0]and here is the syslog from plugging into the USB port:
Nov 16 15:24:52 pion kernel: usb 5-1.4: new high-speed USB device number 9 using xhci_hcd
Nov 16 15:24:52 pion kernel: usb-storage 5-1.4:1.0: USB Mass Storage device detected
Nov 16 15:24:52 pion kernel: scsi host15: usb-storage 5-1.4:1.0
Nov 16 15:24:52 pion mtp-probe[21562]: checking bus 5, device 9: "/sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4"
Nov 16 15:24:52 pion mtp-probe[21562]: bus: 5, device: 9 was not an MTP device
Nov 16 15:24:52 pion colord-sane[21564]: io/hpmud/musb.c 2074: Invalid usb_open: Permission denied
Nov 16 15:24:52 pion udisks-daemon[3305]: **** scsi_host ADDING /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host15/scsi_host/host15
Nov 16 15:24:52 pion udisks-daemon[3305]: **** scsi_host IGNORING ADD /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host15/scsi_host/host15
Nov 16 15:24:53 pion kernel: scsi 15:0:0:0: Direct-Access Multi Flash Reader 1.00 PQ: 0 ANSI: 0
Nov 16 15:24:54 pion kernel: sd 15:0:0:0: [sdc] 1939456 512-byte logical blocks: (993 MB/947 MiB)
Nov 16 15:24:54 pion kernel: sd 15:0:0:0: [sdc] Write Protect is off
Nov 16 15:24:54 pion kernel: sd 15:0:0:0: [sdc] Mode Sense: 03 00 00 00
Nov 16 15:24:54 pion kernel: sd 15:0:0:0: [sdc] No Caching mode page found
Nov 16 15:24:54 pion kernel: sd 15:0:0:0: [sdc] Assuming drive cache: write through
Nov 16 15:24:54 pion kernel: sdc:
Nov 16 15:24:54 pion kernel: sd 15:0:0:0: [sdc] Attached SCSI removable disk
Nov 16 15:24:54 pion devmon[381]: ===========================================
Nov 16 15:24:54 pion devmon[381]: added: /org/freedesktop/UDisks/devices/sdc
Nov 16 15:24:54 pion udisks-daemon[3305]: **** ADDING /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host15/target15:0:0/15:0:0:0/block/sdc
Nov 16 15:24:54 pion udisks-daemon[3305]: **** UPDATING /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host15/target15:0:0/15:0:0:0/block/sdc
Nov 16 15:24:54 pion udisks-daemon[3305]: **** ADDED /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host15/target15:0:0/15:0:0:0/block/sdc
Nov 16 15:24:54 pion udisks-daemon[3305]: **** EMITTING ADDED for /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host15/target15:0:0/15:0:0:0/block/sdc
Nov 16 15:24:54 pion devmon[381]: device: [/dev/sdc]
Nov 16 15:24:54 pion devmon[381]: systeminternal: [0]
Nov 16 15:24:54 pion devmon[381]: usage: [filesystem]
Nov 16 15:24:54 pion devmon[381]: type: [vfat]
Nov 16 15:24:54 pion devmon[381]: label: []
Nov 16 15:24:54 pion devmon[381]: ismounted: [0]
Nov 16 15:24:54 pion devmon[381]: nopolicy: [0]
Nov 16 15:24:54 pion devmon[381]: hasmedia: [1]
Nov 16 15:24:54 pion devmon[381]: opticaldisc: []
Nov 16 15:24:54 pion devmon[381]: numaudiotracks: []
Nov 16 15:24:54 pion devmon[381]: blank: []
Nov 16 15:24:54 pion devmon[381]: media: []
Nov 16 15:24:54 pion devmon[381]: partition: [0]
Nov 16 15:24:54 pion devmon[381]: devmon: /usr/sbin/udevil --mount /dev/sdc --mount-options "noexec,nosuid,nodev,noatime"
Nov 16 15:24:54 pion udisks-daemon[3305]: **** /proc/self/mountinfo changed
Nov 16 15:24:54 pion udisks-daemon[3305]: **** MOUNTED /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host15/target15:0:0/15:0:0:0/block/sdc
Nov 16 15:24:54 pion udisks-daemon[3305]: **** CHANGING /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host15/target15:0:0/15:0:0:0/block/sdc
Nov 16 15:24:54 pion udisks-daemon[3305]: **** UPDATING /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host15/target15:0:0/15:0:0:0/block/sdc
Nov 16 15:24:54 pion udisks-daemon[3305]: **** EMITTING CHANGED for /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host15/target15:0:0/15:0:0:0/block/sdc
Nov 16 15:24:54 pion udisks-daemon[3305]: **** CHANGED /sys/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/usb5/5-1/5-1.4/5-1.4:1.0/host15/target15:0:0/15:0:0:0/block/sdc
Nov 16 15:24:54 pion devmon[381]: Mounted /dev/sdc at /media/sdc-usb-Multi_Flash_Read
Nov 16 15:24:54 pion devmon[381]: ===========================================
Nov 16 15:24:54 pion devmon[381]: changed: /org/freedesktop/UDisks/devices/sdc
Nov 16 15:24:54 pion devmon[381]: device: [/dev/sdc]
Nov 16 15:24:54 pion devmon[381]: systeminternal: [0]
Nov 16 15:24:54 pion devmon[381]: usage: [filesystem]
Nov 16 15:24:54 pion devmon[381]: type: [vfat]
Nov 16 15:24:54 pion devmon[381]: label: []
Nov 16 15:24:54 pion devmon[381]: ismounted: [1]
Nov 16 15:24:54 pion devmon[381]: nopolicy: [0]
Nov 16 15:24:54 pion devmon[381]: hasmedia: [1]
Nov 16 15:24:54 pion devmon[381]: opticaldisc: []
Nov 16 15:24:54 pion devmon[381]: numaudiotracks: []
Nov 16 15:24:54 pion devmon[381]: blank: []
Nov 16 15:24:54 pion devmon[381]: media: []
Nov 16 15:24:54 pion devmon[381]: partition: [0]Last edited by foleda (2014-11-17 23:55:32)
Offline
Hello
Looks like hot plugging a USB device triggers some magic that hot plugging an SD card does not
I see that you use devmon with udisks1 for automounting.
The difference with SD card insertion is that the device for the reader already exists since boot time and the insertion just triggers a 'changed' event, and not an 'added' event by udisks1.
Looking into the devmon script, I don't see anything concerning SD card insertion when a 'changed' event is detected; so devmon will not work in this case;
if it works when you plug out the reader and you plug it in again with the SD card already inserted, it is because then an 'added' event is generated which devmon can detect to automount the device.
devmon needs to be edited to manage this case, but as IgnorantGuru has ceased to develop, this will be difficult to be done.
You can try something else to automount: I don't know if spacefm can do better with SD card insertion (I don't use it); you could try udisksvm if you are in graphical environment with a system tray; or other ways (see in the wiki).
Give feedback of what you choose to use.
Bye.
Edit: but take care to use only one automount program at a time.
Last edited by berbae (2014-11-17 15:54:10)
Offline
I uninstalled udevil (devmon) and installed udiskie. SD cards now automount when inserted.
Thanks for pointing me in the right direction. I did have to create a systemd unit to start the udiskie daemon
when I log in.
[Unit]
Description=udiskie Service
[Service]
Type=simple
User=%i
Environment=DISPLAY=:0
ExecStart=/usr/bin/udiskie $ARGS
[Install]
WantedBy=multi-user.targetOffline