This is very long and can be confusing, I may make mistakes but will correct as I see or here input.
Most Cardreaders mount each slot as a seperate device. Not all, but most I have seen.
Lets verify a few things first from a clean boot and no USB devices plugged in.
Type ' cat /proc/bus/usb/devices ' will show your USB Ports and what they are. The above output like ' cat /proc/bus/usb/001/001 ' or what ever is some generic stuff.
Example of my ' cat /proc/bus/usb/devices '
Code:
[crusher58@lcomp58 ~]$ cat /proc/bus/usb/devices
T: Bus=06 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.10-rc2 uhci_hcd
S: Product=UHCI Host Controller
S: SerialNumber=0000:02:05.1
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms
T: Bus=05 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.10-rc2 uhci_hcd
S: Product=UHCI Host Controller
S: SerialNumber=0000:02:05.0
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms
T: Bus=04 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.10-rc2 uhci_hcd
S: Product=UHCI Host Controller
S: SerialNumber=0000:00:1d.2
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms
T: Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.10-rc2 uhci_hcd
S: Product=UHCI Host Controller
S: SerialNumber=0000:00:1d.1
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms
T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.10-rc2 uhci_hcd
S: Product=UHCI Host Controller
S: SerialNumber=0000:00:1d.0
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms
T: Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=090a ProdID=1046 Rev= 2.01
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=256mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=83(I) Atr=03(Int.) MxPS= 8 Ivl=255ms
T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 4
B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.10-rc2 ehci_hcd
S: Product=EHCI Host Controller
S: SerialNumber=0000:02:05.2
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=256ms
Now with no devices plugged in type ' cat /proc/scsi/scsi '. There should be nothing.
Now I plug in my mp3 player which is also a sdcard reader. This is my output from ' cat /proc/scsi/scsi. It is identified as Newtrend
Code:
[crusher58@lcomp58 ~]$ cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: NEWTREND Model: MMC READER BULK Rev: 2.01
Type: Direct-Access ANSI SCSI revision: 02
Now when I plugin my 3 slot USB card reader with no media cards in it, the output of ' cat /proc/scsi/scsi. This the same output as above sense there is no media present.
Code:
[crusher58@lcomp58 ~]$ cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: NEWTREND Model: MMC READER BULK Rev: 2.01
Type: Direct-Access ANSI SCSI revision: 02
Now I plugin my compact flash media card in and I get the following output from ' cat /proc/scsi/scsi '. It is idenitfied as General Model Flash Disk Drive. It is a 3 in 1 media USB mediareader
Code:
[crusher58@lcomp58 ~]$ cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: NEWTREND Model: MMC READER BULK Rev: 2.01
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: General Model: Flash Disk Drive Rev: 2.05
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 01
Vendor: General Model: Flash Disk Drive Rev: 2.05
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 02
Vendor: General Model: Flash Disk Drive Rev: 2.05
Type: Direct-Access ANSI SCSI revision: 02
Looking at the above output you can see the mp3 device is scsi0 which will map as /dev/sda and since there is only one partition then it is /dev/sda1. Mount command for me would be ' mount -t vfat /dev/sda1 /media/sda1. If I had two partitions on it I would also mount the second partition as ' mount -t vfat /dev/sda2 /media/sda2
Now looking at the above again the cardreader is on scsi1. It shows three luns attached to scsi1. Luns is another story but if you did not have multilun support in the kernel then you would only see one lun. If I mount using ' mount -t vfat /dev/sdb1 /media/sdb1 ' it does not mount. It says there is no media present. So I try ' mount -t vfat /dev/sdc1 /media/sdc1 ' and it mounts. So for me /dev/hdc is the compact flash slot for me and apparently /dev/sdb is one of the other slots.
Now I insert a sdcard in the cardreader and try ' mount -t vfat /dev/sdb1 /media/sdb1 '. It does not mount. So that means that /dev/sdb is neither the compact flash or sdcard slot. I try mounting /dev/sdd1 ' mount -t vfat /dev/sdd1 /media/sdd1 ' and sdcard mounts fine.
So here is the following from my system.
/dev/sda is my mp3 player
/dev/sdb is the smartmedia slot. No way of testing for me since I have no smartmedia cards, but should work fine.
/dev/sdc is the compact flash slot
/dev/sdd is the sdcard slot
All of the above works this way for me with lun support in the kernel. Now for you if you have no other usb devices plugged in then you would start your way from /dev/sda to /dev/sdd.
Okay if it is one of the rare devices that does not require multilun support then you mount each slot as the following.
mount -t vfat /dev/sda1 /dev/sda1
mount -t vfat /dev/sda2 /dev/sda2
mount -t vfat /dev/sda3 /dev/sda3
mount -t vfat /dev/sda4 /dev/sda4
Here is Example of my fstab file.
Code:
# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/hda8 / ext3 defaults 1 1
/dev/hda2 /boot ext3 defaults 1 2
/dev/hda12 /cdrw ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda5 /dvdrw ext3 defaults 1 2
/dev/hda10 /home ext3 defaults 1 2
none /proc proc defaults 0 0
/dev/hda3 /storage1 ext3 defaults 1 2
none /sys sysfs defaults 0 0
/dev/hda9 /usr ext3 defaults 1 2
/dev/hda6 /var ext3 defaults 1 2
/dev/hda7 /vfat vfat defaults 0 0
/dev/hda11 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom iso9660,udf noauto,owner,rw 0 0
/dev/cdrom1 /mnt/cdrom1 iso9660,ufs noauto,owner,rw 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
/dev/sda1 /mnt/sda1 auto umask=222,users,noauto,owner,rw 0 0
/dev/sdb1 /mnt/sdb1 auto umask=222,users,noauto,owner,rw 0 0
/dev/sdc1 /mnt/sdc1 auto umask=222,users,noauto,owner,rw 0 0
/dev/sdd1 /mnt/sdd1 auto umask=222,users,noauto,owner,rw 0 0
/dev/sde1 /mnt/sde1 auto umask=222,users,noauto,owner,rw 0 0
/dev/sdf1 /mnt/sdf1 auto umask=222,users,noauto,owner,rw 0 0
/dev/sdg1 /mnt/sdg1 auto umask=222,users,noauto,owner,rw 0 0
192.168.1.18:/storage1 /mnt/lcomp18_storage1 nfs umask=222,users,noauto,owner,rw 0 0
192.168.1.18:/storage3 /mnt/lcomp18_storage3 nfs umask=222,users,noauto,owner,rw 0 0
Then I created mount device Icons on my KDE desktop and mapped them to each /dev. Now all I have to do is start from the bottom and increment till it mounts. But I know where my devices are and which one to mount with 95% of the time.
You can get info on what media is what and which /dev it is at by running ' fdisk -l ' Example of my ' fdisk -l ' with the mp3 and cardreader with compact flash and sdcard plugged in.
Code:
[root@lcomp58 crusher58]# fdisk -l
bash: fdisk: command not found
[root@lcomp58 crusher58]# /sbin/fdisk -l
Disk /dev/hda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 917 7365771 7 HPFS/NTFS
/dev/hda2 918 942 200812+ 83 Linux
/dev/hda3 943 1962 8193150 83 Linux
/dev/hda4 1963 7296 42845355 f W95 Ext'd (LBA)
/dev/hda5 1963 2599 5116671 83 Linux
/dev/hda6 2600 3236 5116671 83 Linux
/dev/hda7 3237 3618 3068383+ c W95 FAT32 (LBA)
/dev/hda8 3619 4128 4096543+ 83 Linux
/dev/hda9 4129 5658 12289693+ 83 Linux
/dev/hda10 5659 5913 2048256 83 Linux
/dev/hda11 5914 6044 1052226 82 Linux swap
/dev/hda12 6045 6159 923706 83 Linux
Disk /dev/sda: 125 MB, 125960192 bytes
8 heads, 32 sectors/track, 961 cylinders
Units = cylinders of 256 * 512 = 131072 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 961 122959+ b W95 FAT32
Disk /dev/sdc: 31 MB, 31129600 bytes
4 heads, 32 sectors/track, 475 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 475 30374+ 4 FAT16 <32M
Disk /dev/sdd: 8 MB, 8028160 bytes
2 heads, 32 sectors/track, 245 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 * 1 244 7792 1 FAT12
[root@lcomp58 crusher58]#
Some info as you play.
When you unplug a device the /proc/scsi/scsi sometimes does not erase the link to scsi0 or whatever for a period of time. So if you unplug the device as scsi0 then plug it right back in it will be scs1. But the mount point for it does not change. If it mounted on /dev/sda, unplugit then plug back in, it will still mount at /dev/sda.
So /dev/sda is first scsi/usb/firewire/whatever media device you plugin and so on. So if you plug in a usb harddrive first then your cardreader then your media slots will be one dev higher.
Another example I plug in my mp3 player ( /dev/sda )and then my card reader ( /dev/sdb, /dev/sdc, /dev/sdd ). All works fine. So I shutdown for the night and start up again tomorrow but I leave the mp3 and card reader plugged in. Depending if I had plugged my mp3 in USB port 1 and the cardreader in USB port 0 then my mp3 player will be /dev/sdd instead of /dev/sda since port 0 reads devices first then port 1 and so on. So mp3 will be /dev/sdd and cardreader will be /dev/sda, /dev/sdb, /dev/sdc. Believe me this can cause major confusion for the beginner.
Now with the usage of udev, you can define a usb device to always be a specific /dev. Lots of info on the net and here for this type of setup.
Brian1