# Missing dev entries for usb/sd-cards

## cbaabc

Hello,

i try to mount my usb-stick and a sd-card. Both is currently impossible and i think its because of the same reason. I try to describe it with the usb mounting:

If i plug in my usb-stick into any usb-port, in /dev/ there is an entry "sdc" created, but not the partition (sdc1) which is on the stick.

With the KDE Partition Manager i deleted the partition on the stick and created it new. After that there was a /dev/sdc1 entry, but after removing and plugging in the stick it was gone again. As i'm new to gentoo, i don't know, what to do. I searched via google for the past days but wasn't able to find a solution.

I'm grateful for any tips to solve my problem.

(Same for sd-cards)

Following outputs may be helpful:

```
# ls -l /dev/sd*

brw-rw---- 1 root disk 8,  0 Aug  6 14:59 /dev/sda

brw-rw---- 1 root disk 8,  1 Aug  6 14:55 /dev/sda1

brw-rw---- 1 root disk 8,  2 Aug  6 14:54 /dev/sda2

brw-rw---- 1 root disk 8,  3 Aug  6 14:54 /dev/sda3

brw-rw---- 1 root disk 8,  4 Aug  6 14:55 /dev/sda4

brw-rw---- 1 root disk 8,  5 Aug  6 14:54 /dev/sda5

brw-rw---- 1 root disk 8, 16 Aug  6 14:59 /dev/sdb

brw-rw---- 1 root disk 8, 32 Aug  6 14:59 /dev/sdc
```

sda is my harddrive, sdb my card reader and sdc the usb-stick

```
# fdisk -l /dev/sdc

Disk /dev/sdc: 2115 MB, 2115502080 bytes

66 heads, 62 sectors/track, 1009 cylinders, total 4131840 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x0008dfc6

   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1              62     4128827     2064383    b  W95 FAT32
```

```
# mount -t vfat /dev/sdc /mnt/usb/

mount: wrong fs type, bad option, bad superblock on /dev/sdc,

       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try

       dmesg | tail  or so
```

```
# dmesg | tail

[  291.894471] sd 4:0:0:0: [sdc] Write Protect is off

[  291.894474] sd 4:0:0:0: [sdc] Mode Sense: 0b 00 00 08

[  291.894476] sd 4:0:0:0: [sdc] Assuming drive cache: write through

[  291.896986] sd 4:0:0:0: [sdc] Assuming drive cache: write through

[  291.896991]  sdc: unknown partition table

[  291.900604] sd 4:0:0:0: [sdc] Assuming drive cache: write through

[  291.900608] sd 4:0:0:0: [sdc] Attached SCSI removable disk

[  995.323347] CE: hpet increased min_delta_ns to 7500 nsec

[ 1241.625029] FAT: invalid media value (0x00)

[ 1241.625031] VFS: Can't find a valid FAT filesystem on dev sdc.
```

```
# udevadm monitor

monitor will print the received events for:

UDEV - the event which udev sends out after rule processing

KERNEL - the kernel uevent

KERNEL[1281100589.004636] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4 (usb)

KERNEL[1281100589.004663] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0 (usb)

KERNEL[1281100589.004756] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5 (scsi)

KERNEL[1281100589.004772] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/scsi_host/host5 (scsi_host)

UDEV  [1281100589.006134] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4 (usb)

UDEV  [1281100589.007193] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0 (usb)

UDEV  [1281100589.007413] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5 (scsi)

UDEV  [1281100589.007975] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/scsi_host/host5 (scsi_host)

KERNEL[1281100590.005973] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0 (scsi)

KERNEL[1281100590.006005] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0/5:0:0:0 (scsi)

KERNEL[1281100590.006024] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0/5:0:0:0/scsi_disk/5:0:0:0 (scsi_disk)

KERNEL[1281100590.006042] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0/5:0:0:0/scsi_device/5:0:0:0 (scsi_device)

KERNEL[1281100590.006166] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0/5:0:0:0/scsi_generic/sg3 (scsi_generic)

KERNEL[1281100590.006183] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0/5:0:0:0/bsg/5:0:0:0 (bsg)

UDEV  [1281100590.006326] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0 (scsi)

UDEV  [1281100590.007158] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0/5:0:0:0 (scsi)

UDEV  [1281100590.007175] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0/5:0:0:0/scsi_device/5:0:0:0 (scsi_device)

UDEV  [1281100590.007188] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0/5:0:0:0/scsi_disk/5:0:0:0 (scsi_disk)

UDEV  [1281100590.008777] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0/5:0:0:0/scsi_generic/sg3 (scsi_generic)

UDEV  [1281100590.009511] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0/5:0:0:0/bsg/5:0:0:0 (bsg)

KERNEL[1281100590.011355] change   /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0/5:0:0:0 (scsi)

UDEV  [1281100590.011688] change   /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0/5:0:0:0 (scsi)

KERNEL[1281100590.015846] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0/5:0:0:0/block/sdc (block)

KERNEL[1281100590.016331] add      /devices/virtual/bdi/8:32 (bdi)

UDEV  [1281100590.016532] add      /devices/virtual/bdi/8:32 (bdi)

UDEV  [1281100590.070539] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0/5:0:0:0/block/sdc (block)
```

If other information is needed, i will provide them. Thanks in advance.

----------

## krinn

(Same for sd-cards)

no, your sd-cards are named after sg* and not sd* only if a card is insert sd* will be populated

and you can see it in dmesg or udevadm you just show us.

```
UDEV  [1281100590.008777] add      /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4:1.0/host5/target5:0:0/5:0:0:0/scsi_generic/sg3 (scsi_generic) 
```

for the usb stick:

```
/dev/sdc1              62     4128827     2064383    b  W95 FAT32

```

dunno how the kde partition manager works, but a partition starting at 62 is not something usual.

remove it and create it with fdisk in order to build something valid (a starting partition at 62 isn't invalid, but i really doubt you wish that and it's not useful on an usb stick, so i just consider this as a clue of a problem. I don't know really what it is, but you have one and that starting position doesn't seems logic and/or wanted by you i suppose).

and to mount it where it will works it will be 

mount -t vfat /dev/sdc1 /mnt/usb/

----------

## cbaabc

didn't know about sd-cards and sg*, so sorry about that.

i created the partition new with fdisk:

```
# fdisk -l /dev/sdc 

Disk /dev/sdc: 2115 MB, 2115502080 bytes

49 heads, 36 sectors/track, 2342 cylinders, total 4131840 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x0008dfc6

   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1            2048     4131839     2064896   83  Linux
```

 *krinn wrote:*   

> 
> 
> and to mount it where it will works it will be 
> 
> mount -t vfat /dev/sdc1 /mnt/usb/

 

still this doesn't work, as there is no /dev/sdc1:

```
# mount -t vfat /dev/sdc1 /mnt/usb/

mount: special device /dev/sdc1 does not exist
```

I have no idea, why it isn't created inside of dev, when i plug in the stick, thus i'm kinda lost

EDIT: just seeing, that the system is now linux and not dos, still the problem remains

EDIT2: changed the partition type, but still no /dev/sdc1

----------

## krinn

 *cbaabc wrote:*   

> 
> 
>    Device Boot      Start         End      Blocks   Id  System
> 
> /dev/sdc1            2048     4131839     2064896   83  Linux[/code]
> ...

 

 :Smile:  again, still strange for me but anyway, let's just say this is ok

did you format it ? Maybe your create the partition and just leave it as-is no?

----------

## cbaabc

It is formated and other pcs (windows) can access it normally. It's not only this one usb-stick, but every usb mass storage i tried till now. Non of them can be accessed via my gentoo system. fdisk always finds all partitions, but only /dev/sdc will be created. No sdc1, sdc2, etc for any of the partitions on the particularly device.

Maybe it has something to do with:

```
# dmesg | tail

[15344.308598] scsi 10:0:0:0: Direct-Access     USB      Flash Disk       5.00 PQ: 0 ANSI: 2

[15344.308789] sd 10:0:0:0: Attached scsi generic sg3 type 0

[15344.310788] sd 10:0:0:0: [sdc] 4131840 512-byte logical blocks: (2.11 GB/1.96 GiB)

[15344.311420] sd 10:0:0:0: [sdc] Write Protect is off

[15344.311424] sd 10:0:0:0: [sdc] Mode Sense: 0b 00 00 08

[15344.311427] sd 10:0:0:0: [sdc] Assuming drive cache: write through

[15344.313410] sd 10:0:0:0: [sdc] Assuming drive cache: write through

[15344.313415]  sdc: unknown partition table

[15344.316409] sd 10:0:0:0: [sdc] Assuming drive cache: write through

[15344.316412] sd 10:0:0:0: [sdc] Attached SCSI removable disk
```

The system can't read the partition table, but i don't know why (and if this is even the problem).

----------

## eccerr0r

It's fine for a partition to start not at cylinder 1...  I've seen a lot of flash media cards done this way...

Though this might be silly do you have MSDOS/PCBIOS partition support built into the kernel?

----------

## dmpogo

Just experienced this as well. One usbstick came up as /dev/sdb   only, no partitions shown, tried the other one  - it  showed all the partitions all right. Will be investigating it later.

----------

## dmpogo

 *krinn wrote:*   

>  *cbaabc wrote:*   
> 
>    Device Boot      Start         End      Blocks   Id  System
> 
> /dev/sdc1            2048     4131839     2064896   83  Linux[/code]
> ...

 

this is a standard block start number (1 MB offset)  how Windows 7 and Mac OS X format the harddrives now.

Previously the standard was to start at block 63.   Lower blocks is where boot sector lives, but this does not mesh well with

neither with new 4k block harddrives, nor with SSD's

----------

## eccerr0r

 *dmpogo wrote:*   

> Just experienced this as well. One usbstick came up as /dev/sdb   only, no partitions shown, tried the other one  - it  showed all the partitions all right. Will be investigating it later.

 

I'm not sure of how Windows handles it but it works in Linux if you don't partition the disk and just use the whole disk as a "partition".  My Nokia phone looks like this to Linux... it's the only one so far.  All of my USB flash disks, as well as SD/SM/CF cards have proper partitioning.

----------

## krinn

 *eccerr0r wrote:*   

> 
> 
> Though this might be silly do you have MSDOS/PCBIOS partition support built into the kernel?

 

agree with eccerr0r, if all usb sticks doesn't work, must be some kernel weirdness so.

----------

## dmpogo

 *eccerr0r wrote:*   

>  *dmpogo wrote:*   Just experienced this as well. One usbstick came up as /dev/sdb   only, no partitions shown, tried the other one  - it  showed all the partitions all right. Will be investigating it later. 
> 
> I'm not sure of how Windows handles it but it works in Linux if you don't partition the disk and just use the whole disk as a "partition".  My Nokia phone looks like this to Linux... it's the only one so far.  All of my USB flash disks, as well as SD/SM/CF cards have proper partitioning.

 

This was a stick that has data on it, so I was not attempting to partition it, just read of the data.  I was not able to mount /dev/sdb as is, but I'll try again.

I had similar issue ones with SD card, but it was solved when I checked that 'Probe All LUNs'  is set in the kernel (actually I temorarlly increased maximum lun in /sys file).  This is a know issed with SDs in multicard reader,  but it did manifest itself in the way that only /dev/sdg was shown but not the partitions, if I remember correctly.

I wonder if the USB stick I had is the one that under Windows appear as multiple  devices, and it is again "Probe All LUNs" issue.

Thinking about it, I can check it now !

----------

## eccerr0r

Strange, never seen any single memory devices show up as multiple LUNs, just heard of multi-card USB memory readers (that support more than one type of flash memory) can show up as multiple LUNs.

The two multi-card readers I have - each slot show up as an individual drive.

I should just see what happens if I stick my phone on a windows machine, should answer real quick how it responds to partitionless media...

except I don't have the micro usb cable with me right now... grr.

----------

## dmpogo

Well, I looked at my case in more detail.  Interesting.  The usb key insertion creates /dev/sdh only. 

fdisk gives:

```

......

This doesn't look like a partition table

Probably you selected the wrong device.

   Device Boot      Start         End      Blocks   Id  System

/dev/sdh1   ?      101215      249694   570754815+  72  Unknown

/dev/sdh2   ?       21942      273767   968014120   65  Novell Netware 386

/dev/sdh3   ?      243221      495046   968014096   79  Unknown

/dev/sdh4   ?      375349      375356       27749+   d  Unknown

```

mount however mounts /dev/sdh   (without any partition number) just fine. File system is FAT32. I guess I failed it mount on a first try (on another machine) because

of some user error.

The usb key  does not have factory formatting. It was reformated after some partition corruption, and the owner thinks under Vista.Last edited by dmpogo on Fri Aug 06, 2010 9:21 pm; edited 2 times in total

----------

## dmpogo

 *eccerr0r wrote:*   

> Strange, never seen any single memory devices show up as multiple LUNs, just heard of multi-card USB memory readers (that support more than one type of flash memory) can show up as multiple LUNs.
> 
> 

 

Did not you have usbkeys  for which Sаfеly Remove Hardware in Windows shows several devices that can be stopped ?

However, it was a guess, which did not play out in my case.   That's not an issue with my stick.

 *Quote:*   

> 
> 
> The two multi-card readers I have - each slot show up as an individual drive.
> 
> 

 

Right, for this work Probe All Luns is needed, and I did not have itLast edited by dmpogo on Sat Aug 07, 2010 2:28 am; edited 1 time in total

----------

## cbaabc

 *krinn wrote:*   

>  *eccerr0r wrote:*   
> 
> Though this might be silly do you have MSDOS/PCBIOS partition support built into the kernel? 
> 
> agree with eccerr0r, if all usb sticks doesn't work, must be some kernel weirdness so.

 

Partition Types->

PC BIOS (MSDOS partition tables) support 

was indeed missing and is now enabled. Still no change anywhere. Everything is just like before. 

Anything else i might be missing in my kernel config? (needed file formats are enabled)

----------

## krinn

well, can get kernel version you use ?

----------

## eccerr0r

 *cbaabc wrote:*   

> Partition Types->
> 
> PC BIOS (MSDOS partition tables) support 
> 
> was indeed missing and is now enabled. Still no change anywhere. Everything is just like before. 
> ...

 

Make sure you're running the right kernel.  What does it say now when the USB flash media is attached?  Still gives you "unknown partition table?"

Double check your "uname -a" to make sure you're running the new kernel...

----------

## cbaabc

kernel version: 2.6.35-rc6-git1

uname -a says i'm indeed running it.

dmesg still says, sdc: unknown partition table

on another note: i tried another stick again, and now it works with:

```
# mount /dev/sdc /mnt/usb
```

dmesg for that second stick:

```
[11250.989520] scsi 11:0:0:0: Direct-Access     FLASH    Drive AU_USB20   8.07 PQ: 0 ANSI: 2

[11250.989688] sd 11:0:0:0: Attached scsi generic sg3 type 0

[11250.993575] sd 11:0:0:0: [sdc] 7938048 512-byte logical blocks: (4.06 GB/3.78 GiB)

[11250.995001] sd 11:0:0:0: [sdc] Write Protect is off

[11250.995005] sd 11:0:0:0: [sdc] Mode Sense: 03 00 00 00

[11250.995007] sd 11:0:0:0: [sdc] Assuming drive cache: write through

[11250.997645] sd 11:0:0:0: [sdc] Assuming drive cache: write through

[11250.997651]  sdc: unknown partition table

[11251.461335] sd 11:0:0:0: [sdc] Assuming drive cache: write through

[11251.461338] sd 11:0:0:0: [sdc] Attached SCSI removable disk

[11251.779347] ehci_hcd 0000:00:06.1: port 4 high speed

[11251.779352] ehci_hcd 0000:00:06.1: GetStatus port 4 status 001005 POWER sig=se0 PE CONNECT

[11251.830088] usb 2-4: reset high speed USB device using ehci_hcd and address 14

[11251.881328] ehci_hcd 0000:00:06.1: port 4 high speed

[11251.881332] ehci_hcd 0000:00:06.1: GetStatus port 4 status 001005 POWER sig=se0 PE CONNECT

[11252.676313] ehci_hcd 0000:00:06.1: port 4 high speed

[11252.676319] ehci_hcd 0000:00:06.1: GetStatus port 4 status 001005 POWER sig=se0 PE CONNECT

[11252.727103] usb 2-4: reset high speed USB device using ehci_hcd and address 14

[11252.778344] ehci_hcd 0000:00:06.1: port 4 high speed

[11252.778348] ehci_hcd 0000:00:06.1: GetStatus port 4 status 001005 POWER sig=se0 PE CONNECT
```

EDIT: also for that second stick no /dev/sdc1, 2, etc is created

fdisk for the second stick might be helpful

```
# fdisk -l /dev/sdc

Disk /dev/sdc: 4064 MB, 4064280576 bytes

126 heads, 62 sectors/track, 1016 cylinders, total 7938048 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x69737369

This doesn't look like a partition table

Probably you selected the wrong device.

   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1   ?  1869771365  2038460886    84344761   69  Unknown

/dev/sdc2   ?  1701519481  3571400945   934940732+  73  Unknown

/dev/sdc3   ?        2573        2573           0   74  Unknown

/dev/sdc4      2885681152  2885733566       26207+   0  Empty

Partition table entries are not in disk order
```

[/code]

----------

## dmpogo

cbaabc:

I see with some sticks I have exactly what you have with that second stick. Note that the partition codes fdisk give are all unexistent

----------

## eccerr0r

Curiosity: are you even running a PC or is this a Macintosh or something?  I can't believe how far you got without having PC/MSDOS BIOS partition tables disabled on a PC.

Perhaps there's a kernel bug here if it's a non-PC... not sure though, and can't really believe this is the case...

----------

## cbaabc

i have indeed a macbook

----------

## tuam

```
# fdisk -l /dev/sdc

Disk /dev/sdc: 4064 MB, 4064280576 bytes

126 heads, 62 sectors/track, 1016 cylinders, total 7938048 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x69737369

This doesn't look like a partition table

Probably you selected the wrong device.

   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1   ?  1869771365  2038460886    84344761   69  Unknown

/dev/sdc2   ?  1701519481  3571400945   934940732+  73  Unknown

/dev/sdc3   ?        2573        2573           0   74  Unknown

/dev/sdc4      2885681152  2885733566       26207+   0  Empty

Partition table entries are not in disk order
```

This stick has no partitions, but is one single big filesystem (like a floppy used to be). This case should be different from your partitioned stick.

FF,

Daniel

----------

## dmpogo

 *tuam wrote:*   

> 
> 
> This stick has no partitions, but is one single big filesystem (like a floppy used to be). This case should be different from your partitioned stick.
> 
> FF,
> ...

 

Thanks to this thread I was reminded that one can put filesystem on a disk without partitioning it first !  Indeed even in Windows when it shows

you first an unpartiotioned drive, you can choose to install Windows without any partitioning

----------

