Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
USB "N in 1" cardreader working smoothly
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
letalis
n00b
n00b


Joined: 25 Jul 2004
Posts: 5
Location: Sweden

PostPosted: Sun Jul 25, 2004 11:09 pm    Post subject: USB "N in 1" cardreader working smoothly Reply with quote

I had a hard time finding a good solution to this before so here it goes.
Note: This solution requires you to run udev and to have set up your kernel with support for scsi, usb, usb-storage. In summary: you should have all drivers needed installed.

The problems are:

  1. The cardreader does not send any event when a new card is inserted and therefore no device node is created by udev.
  2. Since usb-storage devices show up as scsi-drives it is hard to distinguish which slot is which device.


Solution
My solution is to add mappings in /etc/udev/rules.d/ that create the needed devices, they appear at the same place each time and can therefore easily be added to /etc/fstab.

First thing I did was to create the file /etc/udev/rules.d/10-local.rules (after consulting http://www.reactivated.net/udevrules.php about how udev rulewriting works).

This was what I put in /etc/udev/ruled.d/10-local.rules:
Code:

BUS="scsi", SYSFS{vendor}="USB2.0  ", SYSFS{model}="SMARTMEDIA/XD", NAME{all_partitions}="cardreader/xd"

BUS="scsi", SYSFS{vendor}="USB2.0  ", SYSFS{model}="CompactFlashCard", NAME{all_partitions}="cardreader/cf"


The BUS="scsi" part is because of usb-storage uses scsi for the world to talk to the usb devices, the SYSFS{*} parts are device dependent and are used to identify my current cardreader. You should look in /sys or use the devinfo-tool provided in the udev package (all this is properly described in http://www.reactivated.net/udevrules.php).

NAME{all_partitions}="cardreader/cf" is the trick that makes this a good solution. The {all_partitions} tells udev to create all possible device nodes for a particular device, with the "cardreader/cf" this means that we will get all devices from "/dev/cardreader/cf1" to "/dev/cardreader/cf15".

In /etc/fstab we can simply point a mountpoint at /dev/cardreader/cf1 and have the card mountable in any way we want.

Hopes this helped at least someone.
Back to top
View user's profile Send private message
nielchiano
Veteran
Veteran


Joined: 11 Nov 2003
Posts: 1283
Location: 50N 3E

PostPosted: Thu Jul 29, 2004 10:01 pm    Post subject: Reply with quote

not related to the original post, but might be interesting for other people to get their N-in-1-drive working:

if you only get 1 drive of the N to work, try to enable the folowing kernel option: (under SCSI)
Probe all LUNs on each SCSI device
Back to top
View user's profile Send private message
dr_mox
n00b
n00b


Joined: 22 Dec 2003
Posts: 62
Location: Bath, England

PostPosted: Fri Sep 03, 2004 9:13 pm    Post subject: Reply with quote

Fantastic - worked a treat! Cheers for the tip letalis!

Moxy
Back to top
View user's profile Send private message
Dgege
n00b
n00b


Joined: 14 Jun 2004
Posts: 59

PostPosted: Fri Sep 03, 2004 10:14 pm    Post subject: THANK YOU !! Reply with quote

Finally, someone answered my question ! I keep asking ppl why the devices dont show up automagically when I insert a card ! I have to refresh it (through hdparm or fdisk for example)
Thank you, and I'll try it ASAP, when I get home.

Thanks again !

Georges
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum