Hi all, I have a bit of a mystery on my hands with mounting an sdcard in my printer. After I turn on the printer, the log says: Oct 25 22:16:11 zaphod kernel: usb 2-1: new full speed USB device using uhci_hcd and address 7 Oct 25 22:16:11 zaphod kernel: usb 2-1: configuration #1 chosen from 1 choice Oct 25 22:16:11 zaphod kernel: scsi13 : SCSI emulation for USB Mass Storage devices Then I insert the card. The log now says: Oct 25 22:16:16 zaphod kernel: scsi 13:0:0:0: Direct-Access HP PSC 2355 1.00 PQ: 0 ANSI: 2 Oct 25 22:16:16 zaphod kernel: sd 13:0:0:0: [sdb] Attached SCSI removable disk Then, when I do # ls /dev/sdb* I only get: /dev/sdb So that's the card only, no filesystem. I know it has one partition, formatted as vfat. Then I do this: # sudo mount -t /dev/sdb /mnt/sdcard It responds with: mount: wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or other error In some cases useful info is found in syslog - try dmesg | tail or so instead of telling me I should be mounting a filesystem and not the medium itself. At the same time, this is added to the log: Oct 25 22:30:22 zaphod sudo: diederick : TTY=pts/5 ; PWD=/dev ; USER=root ; COMMAND=/bin/mount -t vfat /dev/sdb /mnt/sdcard/ Oct 25 22:30:22 zaphod kernel: sd 17:0:0:0: [sdb] 3993600 512-byte hardware sectors (2045 MB) Oct 25 22:30:22 zaphod kernel: sd 17:0:0:0: [sdb] Write Protect is off Oct 25 22:30:22 zaphod kernel: sd 17:0:0:0: [sdb] Assuming drive cache: write through Oct 25 22:30:22 zaphod kernel: sd 17:0:0:0: [sdb] 3993600 512-byte hardware sectors (2045 MB) Oct 25 22:30:22 zaphod kernel: sd 17:0:0:0: [sdb] Write Protect is off Oct 25 22:30:22 zaphod kernel: sd 17:0:0:0: [sdb] Assuming drive cache: write through Oct 25 22:30:22 zaphod kernel: sdb: sdb1 Oct 25 22:30:22 zaphod kernel: FAT: invalid media value (0x01) Oct 25 22:30:22 zaphod kernel: VFS: Can't find a valid FAT filesystem on dev sdb. 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. 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? Thanks for any help, diederick -- http://www.diederickdevries.net/
On 10/25/07, Diederick de Vries wrote:
Hi all,
I have a bit of a mystery on my hands with mounting an sdcard in my printer. After I turn on the printer, the log says:
Oct 25 22:16:11 zaphod kernel: usb 2-1: new full speed USB device using uhci_hcd and address 7 Oct 25 22:16:11 zaphod kernel: usb 2-1: configuration #1 chosen from 1 choice Oct 25 22:16:11 zaphod kernel: scsi13 : SCSI emulation for USB Mass Storage devices
Then I insert the card. The log now says:
Oct 25 22:16:16 zaphod kernel: scsi 13:0:0:0: Direct-Access HP PSC 2355 1.00 PQ: 0 ANSI: 2 Oct 25 22:16:16 zaphod kernel: sd 13:0:0:0: [sdb] Attached SCSI removable disk
Then, when I do
# ls /dev/sdb*
I only get:
/dev/sdb
So that's the card only, no filesystem. I know it has one partition, formatted as vfat. Then I do this:
# sudo mount -t /dev/sdb /mnt/sdcard
It responds with:
mount: wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or other error In some cases useful info is found in syslog - try dmesg | tail or so
instead of telling me I should be mounting a filesystem and not the medium itself. At the same time, this is added to the log:
Oct 25 22:30:22 zaphod sudo: diederick : TTY=pts/5 ; PWD=/dev ; USER=root ; COMMAND=/bin/mount -t vfat /dev/sdb /mnt/sdcard/ Oct 25 22:30:22 zaphod kernel: sd 17:0:0:0: [sdb] 3993600 512-byte hardware sectors (2045 MB) Oct 25 22:30:22 zaphod kernel: sd 17:0:0:0: [sdb] Write Protect is off Oct 25 22:30:22 zaphod kernel: sd 17:0:0:0: [sdb] Assuming drive cache: write through Oct 25 22:30:22 zaphod kernel: sd 17:0:0:0: [sdb] 3993600 512-byte hardware sectors (2045 MB) Oct 25 22:30:22 zaphod kernel: sd 17:0:0:0: [sdb] Write Protect is off Oct 25 22:30:22 zaphod kernel: sd 17:0:0:0: [sdb] Assuming drive cache: write through Oct 25 22:30:22 zaphod kernel: sdb: sdb1 Oct 25 22:30:22 zaphod kernel: FAT: invalid media value (0x01) Oct 25 22:30:22 zaphod kernel: VFS: Can't find a valid FAT filesystem on dev sdb.
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.
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?
Thanks for any help,
diederick
-- http://www.diederickdevries.net/ _______________________________________________ CRUX mailing list CRUX@lists.crux.nu http://lists.crux.nu/mailman/listinfo/crux
maybe you don't have the vfat compiled in.. or you don't have the module loaded. just a guess. good luck. (haven't poked around crux in a while... :( need to get my own system again soon) Dennis -- Windows 9x: noun, Updated 32-bit add-on to the 16-bit GUI of an 8-bit OS, coded for a 4-bit CPU by a 2-bit company that can't stand 1-bit of competition.
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
El Jue 25 Oct 2007, Diederick de Vries escribió:
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?
I have a N-in-1 card reader and I use it frequently with a CF card. I opted for running hald at boot time, and whenever I insert a CF card, pendrive or USB disk, KDE pops up a window to browse the files. I can also browse it using the media:/ URI scheme. All you have to do is install hal, dbus, dbus-qt3 and KDE, then run hald and dbus at boot time. If you don't need the graphic part, try using only hald, and see if your /dev/sdX devices are created. Regards, -- Alan Mizrahi
Op Friday 26 October 2007 schreef Alan Mizrahi:
El Jue 25 Oct 2007, Diederick de Vries escribió:
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?
I have a N-in-1 card reader and I use it frequently with a CF card.
I opted for running hald at boot time, and whenever I insert a CF card, pendrive or USB disk, KDE pops up a window to browse the files. I can also browse it using the media:/ URI scheme.
All you have to do is install hal, dbus, dbus-qt3 and KDE, then run hald and dbus at boot time.
As Johannes Winkelmann also suggested, starting hal solved it. sdb1 is now created when I insert the card. Thanks both of you. Diederick -- http://www.diederickdevries.net/
Hi, I have no time to go through the whole thread, but I would like to share my udev setting for USBCARD reader. After adding it to udev rules file mu card were mounted as sda1. Moreover, I could copy from one card to other (I'm not sure about it). BUS=="usb", SYSFS{product}=="USB 2.0 Card",SYSFS{manufacturer}=="Genesys ", NAME{all_partitions}="usbcard" I'm adding setting form ma Camera and MP3Player. Can be useful for some. # Photo Camera BUS=="scsi", KERNEL=="sd*",SYSFS{vendor}=="FUJIFILM", NAME="%k",SYMLINK="fuji" # MP3 Player BUS=="scsi", KERNEL=="sd*",SYSFS{model}=="NOMAD MuVo TX ", NAME="%k",SYMLINK="mp3grajek" Cheers, Wawrzek -- Wawrzyniec Niewodniczański (in some countries know as Larry) vel LarryN E-MAIL: wawrzyniec.niewodniczanski@pwr.wroc.pl PhD student @ JID: larryn@chrome.pl Wroclaw University of Technology TEL: +48(071)320-2894
participants (5)
-
Alan Mizrahi
-
Dennis
-
Diederick de Vries
-
Johannes Winkelmann
-
Wawrzyniec Niewodniczański