
Hi Diederick, On 10/25/07, Diederick de Vries <diederick@diederickdevries.net> wrote:
Hi all,
I have a bit of a mystery on my hands with mounting an sdcard in my printer. [...] So, trying to mount the card has triggered the kernel into finding the sdb1 file system (I waited a quarter of an hour to make sure my computer wasn't just being slow). Now I can mount and access sdb1 without problems. I've observed the same with an USB card reader, and just opted for the mount <disk>; mount <partition> work around since it's simple and reliable.
However, in my case the /dev/sdX node appears independently of inserting a card, when plugging in the card reader.
Can someone tell me what could be causing this and how I can set things up so that when I turn on my printer and insert a card, its file system is recognized immediately? See http://lkml.org/lkml/2007/6/28/282 and the reply by Kay Sievers (udev maintainer).
Apparently, the behaviour as we see it is the expected behaviour, no udev event is generated for the insertion of the card itself. Now, from your mail it appears you get an udev event when you insert a card (which then creates sdb), so you could probably use that to trigger an open() call to the device (according to the LKML thread, using hdparm -Z should do the trick) which should create your partiton nodes in /dev. Unfortunately, I can't apply this since the device (sdX) is created independently from the insertion of cards. Alternatively - also mentioned in the LKML discussion - hald apparently polls the device all the time, thus triggering the udev events as well; may be overkill in your situation though (it sure is in mine). HTH, Johannes -- Johannes Winkelmann jw@smts.ch