# Problems with usb-storage: /dev/sda but no /dev/sda1

## kupopo

I'm trying to mount a card reader, and am not finding anything that works.  I have two readers, one of which I know is supported by usb-storage since I used it on my redhat machine.  However, I cannot get anywhere with gentoo.

This is what happens.  I plug the device in, usb-stoage and all that stuff recognizes the drive and makes /dev/sda and /dev/scsi/.../disc and generic, but it doesn't find any partitions.  Yet I've tried with two cards that both read before and definitely have partitions.

hdparm and fdisk can't do anything with /dev/sda:

```
Unable to open /dev/sda
```

but everything shows up fine in usbview

```
T:  Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  3 Spd=12  MxCh= 0

D:  Ver= 1.10 Cls=ff(vend.) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1

P:  Vendor=55aa ProdID=a103 Rev= 1.01

S:  Manufacturer=SanDisk

S:  Product=ImageMate USB SmartMedia

S:  SerialNumber=9131BC3231

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA

I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)

E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

T:  Bus=01 Lev=01 Prnt=01 Port=04 Cnt=01 Dev#=  2 Spd=480 MxCh= 0

D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=07cc ProdID=0501 Rev=91.38

S:  Manufacturer=USB2.0

S:  Product=CardReader

S:  SerialNumber=1234609

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA

I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
```

I'm using vanilla 2.6.6 (2.6.7 doesn't work with my nvidia) with all the usb and scsi modules I need compiled into the kernel.

Thanks,

-steve

edit: I'm not running udev

----------

## Aelus

the faq at www.linux-usb.org answers this

 *Quote:*   

> 
> 
> Q: Why do I only see one device from my multipurpose storage device?
> 
> A:Some distributions (notably Red Hat) turn off the kernel option CONFIG_SCSI_MULTI_LUN. This prevents usb-storage from automatically detecting all the devices in your removable storage device. You can either recompile your kernel with this option enabled or (if your distribution supports this) add the following line to /etc/modules.conf;
> ...

 

Aelus

----------

## mike4148

If that doesn't solve your problem, make sure that you have support compiled in to the kernel for the type of partition table the medium has.

In particular, you're probably going to want "PC BIOS (MSDOS partition tables) support" (CONFIG_MSDOS_PARTITION) and "Windows Logical Disk Manager (Dynamic Disk) support" (CONFIG_LDM_PARTITION).

If that doesn't work, try mounting the device. I don't know whether all USB media act like hard drives with partition tables; it's possible that some storage device behaves more like a floppy.

----------

## kupopo

Mike,

Thanks a lot for the suggestion.  I know for a fact that this device mounts like a hard drive, but I just checked my config and I didn't even look at the advanced partition types before.  It turns out they were all disabled, so I'm gonna rebuild when I get a chance tonight.  This is maybe something that should be in the FAQs that I haven't seen anywhere...?

Thanks,

-steve

----------

## kupopo

Well that didn't seem the make a difference.  Apparently the only way I can use my memory cards is to boot the LiveCD.

----------

## Steven Robertson

When I was using devfs, I had to use a tool from the sg3_utils package every time a flash drive was inserted.  As root, after merging sg3_utils, try running

# sg_map

and see if it creates /dev/sda1.  I now use udev, and it seems to automatically manage the creation of the /dev/sda1 from /dev/sg0.

HTH.

----------

## BonezTheGoon

Please see this excellent post for more details and a solution . . .

https://forums.gentoo.org/viewtopic.php?p=277286#277286

Regards,

BonezTheGoon

----------

## hunky

I'm struggling with this. Reading all the posts I'm coming across as well as decibels tut and the reactivated webpage stuff.

dmesg shows sda and sg0, but no sda1 is created, despite trying touch and fdisk on sda as suggested by some.

I've got gentoo-dev-sources-2.6.7-r11. Got a transcend card reader that works great in Suse which I used to have. Using udev, but haven't gone that route solely - still have devfs in the kernel and all.

based on: 

```
udevinfo -a -p /sys/block/sda/
```

```
  looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-1/1-1:1.0/host2/2:0:0:0':

    BUS="scsi"

    ID="2:0:0:0"

    SYSFS{detach_state}="0"

    SYSFS{device_blocked}="0"

    SYSFS{max_sectors}="240"

    SYSFS{model}="Reader(SM)      "

    SYSFS{queue_depth}="1"

    SYSFS{rev}="2003"

    SYSFS{scsi_level}="3"

    SYSFS{state}="running"

    SYSFS{timeout}="30"

    SYSFS{type}="0"

    SYSFS{vendor}="USB 2.0 "

```

I made a 10-local.rules file with:

```
#Transcend card reader for SD media

BUS="scsi", SYSFS{model}="Reader(SM)" NAME="%k" SYMLINK="sdcard"
```

 and a link magically appears under /dev for sdcard- linked to sda, when I plug in the cardreader.

Guess I can try a couple other kernels?

cheers, Hunky

----------

## oumpah-pah

I'm not sure this answers your problem, but I found this on the writing udev rules site :

 *Quote:*   

> Another difficult situation is having a multiple-slot USB-storage card reader. These types of device generally do not inform the host when new cards are plugged in or out, so plugging a card into an unused slot while the reader is plugged in will not create the extra device node needed for mounting!
> 
> This problem also applies to other USB disks - e.g. if you create a new partition, the new partition node will not appear until you re-plug the device.
> 
> udev provides a solution here - it is able to create nodes for all partitions of a block device. For every rule that you specify, the block device will have all 16 partition nodes created. To achieve this, you can simply modify the NAME key, as shown below:
> ...

 

----------

## hunky

Thanks for that, but I may have a more basic problem. I turned on hotplug debug and got in /var/log/messages quite a few lines of stuff with this being a small snippet:(linux-ant being hostname)

```
Aug 21 10:55:26 linux-ant usb 1-1: USB disconnect, address 3

Aug 21 10:55:26 linux-ant default.hotplug[7825]: arguments (block) env (OLDPWD=/ DEVPATH=/block/sda PATH=/bin:/sbin:/usr/sbin:/usr/bin ACTION=remove PWD=/etc/hotplug HOME=/ SHLVL=2 DEBUG=yes SEQNUM=352 _=/bin/env)

Aug 21 10:55:26 linux-ant default.hotplug[7826]: arguments (scsi_device) env (OLDPWD=/ DEVPATH=/class/scsi_device/1:0:0:0 PATH=/bin:/sbin:/usr/sbin:/usr/bin ACTION=remove PWD=/etc/hotplug HOME=/ SHLVL=2 DEBUG=yes SEQNUM=351 _=/bin/env)

Aug 21 10:55:26 linux-ant default.hotplug[7836]: arguments (scsi_generic) env (OLDPWD=/ DEVPATH=/class/scsi_generic/sg1 PATH=/bin:/sbin:/usr/sbin:/usr/bin ACTION=remove PWD=/etc/hotplug HOME=/ SHLVL=2 DEBUG=yes SEQNUM=354 _=/bin/env)

Aug 21 10:55:26 linux-ant default.hotplug[7830]: arguments (scsi) env (OLDPWD=/ DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-1/1-1:1.0/host1/1:0:0:0 PATH=/bin:/sbin:/usr/sbin:/usr/bin ACTION=remove PWD=/etc/hotplug HOME=/ SHLVL=2 DEBUG=yes SEQNUM=353 _=/bin/env)

Aug 21 10:55:26 linux-ant default.hotplug[7822]: arguments (scsi_generic) env (OLDPWD=/ DEVPATH=/class/scsi_generic/sg0 PATH=/bin:/sbin:/usr/sbin:/usr/bin ACTION=remove PWD=/etc/hotplug HOME=/ SHLVL=2 DEBUG=yes SEQNUM=350 _=/bin/env)

Aug 21 10:55:26 linux-ant default.hotplug[7822]: no runnable /etc/hotplug/scsi_generic.agent is installed

Aug 21 10:55:26 linux-ant default.hotplug[7841]: arguments (scsi_device) env (OLDPWD=/ DEVPATH=/class/scsi_device/1:0:0:1 PATH=/bin:/sbin:/usr/sbin:/usr/bin ACTION=remove PWD=/etc/hotplug HOME=/ SHLVL=2 DEBUG=yes SEQNUM=355 _=/bin/env)

Aug 21 10:55:26 linux-ant default.hotplug[7825]: no runnable /etc/hotplug/block.agent is installed

Aug 21 10:55:26 linux-ant default.hotplug[7826]: no runnable /etc/hotplug/scsi_device.agent is installed

Aug 21 10:55:26 linux-ant default.hotplug[7841]: no runnable /etc/hotplug/scsi_device.agent is installed

Aug 21 10:55:26 linux-ant default.hotplug[7871]: arguments (block) env (OLDPWD=/ DEVPATH=/block/sdb PATH=/bin:/sbin:/usr/sbin:/usr/bin ACTION=remove PWD=/etc/hotplug HOME=/ SHLVL=2 DEBUG=yes SEQNUM=356 _=/bin/env)

Aug 21 10:55:26 linux-ant default.hotplug[7877]: arguments (scsi) env (OLDPWD=/ DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-1/1-1:1.0/host1/1:0:0:1 PATH=/bin:/sbin:/usr/sbin:/usr/bin ACTION=remove PWD=/etc/hotplug HOME=/ SHLVL=2 DEBUG=yes SEQNUM=357 _=/bin/env)

Aug 21 10:55:26 linux-ant default.hotplug[7830]: invoke /etc/hotplug/scsi.agent ()

Aug 21 10:55:26 linux-ant scsi.agent[7830]: SCSI remove event not supported

Aug 21 10:55:26 linux-ant default.hotplug[7836]: no runnable /etc/hotplug/scsi_generic.agent is installed

```

So maybe I can google some of this. Or is someone spots the obvious....  cheers, Hunky

----------

