A have a brand new 16GB class 10 SD card and produce a very strange behavior.
After I attached the the card with an USB SD-Card reader, the device appeared as /dev/sdb. I tried to copy a 2GB raw image with dd
into, but it's immediately returns: "No more space left on device".
The block device shows: there is only 10M space on it.
ls -lah /dev/sdb
-rw-r--r-- 1 root root 10M máj 16 23:16 /dev/sdb
fdisk shows the same size:
fdisk -l /dev/sdb
Disk /dev/sdb: 10 MiB, 10485760 bytes, 20480 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
Disklabel type: dos
Disk identifier: 0x84f9d19f
I've tried the SD-card with another reader, but looks like it's not a card reader issue, the "size" of the SD card is 10M with every single reader.
cat /proc/partitions
major minor #blocks name
...
8 16 15558144 sdb
...
The interesting part is: the kernel looks like actually knows the right size of SD card.
cat /sys/block/sdb/size
31116288 # numbers of 512 byte blocks => 15.93 GB
And seems like it's properly recognized.
May 16 22:58:07 DDSI-Laptop kernel: [258762.883672] usb 1-3: New USB device found, idVendor=14cd, idProduct=125c
May 16 22:58:07 DDSI-Laptop kernel: [258762.883674] usb 1-3: New USB device strings: Mfr=1, Product=3, SerialNumber=2
May 16 22:58:07 DDSI-Laptop kernel: [258762.883675] usb 1-3: Product: Mass Storage Device
May 16 22:58:07 DDSI-Laptop kernel: [258762.883676] usb 1-3: Manufacturer: Generic
May 16 22:58:07 DDSI-Laptop kernel: [258762.883677] usb 1-3: SerialNumber: 125C20100726
May 16 22:58:07 DDSI-Laptop kernel: [258762.883972] usb-storage 1-3:1.0: USB Mass Storage device detected
May 16 22:58:07 DDSI-Laptop kernel: [258762.884114] scsi host52: usb-storage 1-3:1.0
May 16 22:58:07 DDSI-Laptop mtp-probe: checking bus 1, device 30: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-3"
May 16 22:58:07 DDSI-Laptop mtp-probe: bus: 1, device: 30 was not an MTP device
May 16 22:58:08 DDSI-Laptop kernel: [258763.881813] scsi 52:0:0:0: Direct-Access Mass Storage Device PQ: 0 ANSI: 0 CCS
May 16 22:58:08 DDSI-Laptop kernel: [258763.882008] sd 52:0:0:0: Attached scsi generic sg1 type 0
May 16 22:58:08 DDSI-Laptop kernel: [258763.883073] sd 52:0:0:0: [sdb] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
May 16 22:58:08 DDSI-Laptop kernel: [258763.883195] sd 52:0:0:0: [sdb] Write Protect is off
May 16 22:58:08 DDSI-Laptop kernel: [258763.883198] sd 52:0:0:0: [sdb] Mode Sense: 03 00 00 00
May 16 22:58:08 DDSI-Laptop kernel: [258763.883312] sd 52:0:0:0: [sdb] No Caching mode page found
May 16 22:58:08 DDSI-Laptop kernel: [258763.883315] sd 52:0:0:0: [sdb] Assuming drive cache: write through
What cause the difference?