Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a headless debian (3.2.0-3-686-pae) to which I wanted to attach a standalone card reader to automatically process my pictures. The idea is that the reader will be plugged in all the time and I would just insert the SD card.

Unfortunately the card is not detected when I insert it.

  • the card reader is correctly recognized
  • when I connect the card reader with the SD card already inserted both are correctly recognized and the card is automatically mounted.

Therefore this is the action of inserting the card into a working card reader which is not recognized. There are no messages in /var/log/messages (nor anywhere else). When the card reader is inserted the messages are correct:

Aug  4 14:25:03 server kernel: [711743.411320] usb 1-6: USB disconnect, device number 5
Aug  4 14:25:12 server kernel: [711751.964021] usb 1-6: new high-speed USB device number 6 using ehci_hcd
Aug  4 14:25:12 server kernel: [711752.097364] usb 1-6: New USB device found, idVendor=058f, idProduct=6366
Aug  4 14:25:12 server kernel: [711752.097369] usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug  4 14:25:12 server kernel: [711752.097373] usb 1-6: Product: Mass Storage Device
Aug  4 14:25:12 server kernel: [711752.097375] usb 1-6: Manufacturer: Generic
Aug  4 14:25:12 server kernel: [711752.097377] usb 1-6: SerialNumber: 058F63666433
Aug  4 14:25:12 server kernel: [711752.098062] scsi4 : usb-storage 1-6:1.0
Aug  4 14:25:13 server kernel: [711753.224612] scsi 4:0:0:0: Direct-Access     Multiple Card  Reader     1.00 PQ: 0 ANSI: 0
Aug  4 14:25:14 server kernel: [711753.810820] sd 4:0:0:0: [sdc] 1984000 512-byte logical blocks: (1.01 GB/968 MiB)
Aug  4 14:25:14 server kernel: [711753.811559] sd 4:0:0:0: [sdc] Write Protect is off
Aug  4 14:25:14 server kernel: [711753.829719]  sdc: sdc1
Aug  4 14:25:14 server kernel: [711753.840025] sd 4:0:0:0: [sdc] Attached SCSI removable disk

I was wondering if I am missing something somewhere (the behavior above is out of the box - I did not need to configure anything) -or- that the insertion of a card into an already-connected card reader is simply not recognized by design.


EDIT: While fora discussions claim that the lack of message is normal, it obviously works for some (thanks Piskvor nad darnir for the comments). I will leave the question unanswered and file a bug with Debian - updating this post if there is any progress.

EDIT: filed Bug#684306 (bugs.debian.org)

share|improve this question
    
I can't find the original mails atm, but a year ago there was a discussion about this on a the FreeBSD mailing lists. The answer was that insertion can not be detected by the hardware. (or as you write: not recognized by design). The only workaround was to poll the device. –  Hennes Aug 4 '12 at 14:42
    
Hmmm...the card insertion event generates a "detected capacity change from 0 to 123456789" line in syslog for me (where 123456789 is card capacity in bytes, IIRC); not sure what is generating this (logged as "kernel"). –  Piskvor Aug 8 '12 at 13:42
    
@Piskvor: ah this is interesting. Which kernel are you on? I log everything and do not see this kind of message –  WoJ Aug 8 '12 at 14:02
    
@WoJ: 3.2.0-27; I currently don't have a SD card to try this and post the exact message. –  Piskvor Aug 8 '12 at 15:04
add comment

2 Answers

Here's how I've solved this problem:

  1. Install the udisks package
  2. Run udisks --poll-for-media

Via a udev rule I then trigger a script that takes care of downloading the data from my CF card automatically.

share|improve this answer
add comment

EDIT: please disregard (see edit in the main question). I leave the "answer" so that the comments can refer to something)

Well, after having done a round through various fora it looks like that this is currently not possible. It looks like there is, technically, a way to have it done (as the insertion generates specific HW events) but this is not implemented. This is quite unfortunate as there are plenty of possible applications. In my case this is not too bad as the card reader is standalone but it gest tricky for built-in ones (though maybe in that case this is handled differently, I do not know as I do no have one)

share|improve this answer
    
I tried it on Arch and I have an entry in dmesg on card insertion/removal with the reader already plugged in. So, it is possible, out-of-the-box on the vanilla kernel. –  darnir Aug 8 '12 at 13:40
    
@darnir: what message do you get? Something similar to Piskvor's one (above) –  WoJ Aug 8 '12 at 14:03
    
dmesg output: [ 4366.893775] r592: IRQ: card removed [ 4375.765801] r592: IRQ: card added [ 4376.519845] memstick0: switching to 4-bit parallel mode [ 4376.523049] mspblk0: p1 –  darnir Aug 8 '12 at 14:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.