Anonymous 寫:tinyding前輩您好
讀卡機+SD卡結果如下:
#dd if=/dev/sda bs=512 count=1 | od -t x1 -v
dd: reading `/dev/sda': Input/output error
0000000
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.0296041 seconds, 0.0 kB/s
# dmesg | tail -n 10
printk: 1 messages suppressed.
sd 0:0:0:0: [sda] Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK,SUGGEST_RETRY
end_request: I/O error, dev sda, sector 0
Buffer I/O error on device sda, logical block 0
Buffer I/O error on device sda, logical block 1
Buffer I/O error on device sda, logical block 2
Buffer I/O error on device sda, logical block 3
sd 0:0:0:0: [sda] Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK,SUGGEST_RETRY
end_request: I/O error, dev sda, sector 0
Buffer I/O error on device sda, logical block 0
若是使用電腦上內建的SD讀卡機,則SD會被設為/dev/mmcblk0p1
訊息就不相同了:
# dd if=/dev/mmcblk0p1 bs=512 count=1 | od -t x1 -v
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.00373337 seconds, 137 kB/s
0000000 eb 58 90 4d 53 44 4f 53 35 2e 30 00 02 08 20 00
...
0000620 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000640 00 00 00 00 00 00 00 00 00 00 00 00 0d 0a 52 65
0000660 6d 6f 76 65 20 64 69 73 6b 73 20 6f 72 20 6f 74
0000700 68 65 72 20 6d 65 64 69 61 2e ff 0d 0a 44 69 73
0000720 6b 20 65 72 72 6f 72 ff 0d 0a 50 72 65 73 73 20
0000740 61 6e 79 20 6b 65 79 20 74 6f 20 72 65 73 74 61
0000760 72 74 0d 0a 00 00 00 00 00 ac cb d8 00 00 55 aa
0001000
# dmesg | tail -n 10
...
end_request: I/O error, dev sda, sector 0
Buffer I/O error on device sda, logical block 0
usb 4-4: USB disconnect, address 3
mmc0: new SD card at address b368
mmcblk0: mmc0:b368 SDC 993792KiB
mmcblk0: p1
感謝您的幫忙~
由上述的錯誤訊息來看,Debian 系統以及核心是根本不曉得如何正確地驅動這個 /dev/sda 設備,以致連 "dd" 讀取都有問題...
所以,接下來還要麻煩你在 Debian 以及 Ubuntu 系統底下,使用原先的讀卡機並且要置入 SD 卡的狀態下,執行底下的相關命令,以期對比找出問題的徵結點.
lsusb
lshw
我以我的 Motorola A1200 行動電話透過 USB 連接線接上我的 Debian 為例子來加以說明到底要從執行 "lshw" 命令後的眾多訊息擷取那些資料出來...
debian:/dev/shm# lsusb
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 002: ID 22b8:608d Motorola PCS
Bus 001 Device 001: ID 0000:0000
在 Bus 1, Device 2 的地方,接上了一台 Motorola A1200 行動電話的 TransFlash 卡.
debian:/dev/shm# lshw
...
*-usb:0
description: USB Controller
product: VT82xxxxx UHCI USB 1.1 Controller
vendor: VIA Technologies, Inc.
physical id: 10
bus info: pci@0000:00:10.0
version: 81
width: 32 bits
clock: 33MHz
capabilities: pm uhci bus_master cap_list
configuration: driver=uhci_hcd latency=64 module=uhci_hcd
*-usbhost
product: UHCI Host Controller
vendor: Linux 2.6.22-3-686 uhci_hcd
physical id: 1
bus info: usb@1
logical name: usb1
version: 2.06
capabilities: usb-1.10
configuration: maxpower=0mA slots=2 speed=12.0MB/s
*-usb
description: Generic USB device
product: Phone
vendor: Motorola Inc.
physical id: 1
bus info: usb@1:1
logical name: scsi5
version: 0.01
serial: 000000000000
capabilities: usb-2.00 emulated scsi-host
configuration: driver=usb-storage maxpower=500mA speed=12.0MB/s
*-disk
description: SCSI Disk
product: Phone
vendor: Motorola
physical id: 0.0.0
bus info: scsi@5:0.0.0
logical name: /dev/sda
serial: 000000000000
size: 1938MB
capabilities: partitioned partitioned:dos
configuration: ansiversion=4
*-volume
description: FAT16 partition
physical id: 1
bus info: scsi@5:0.0.0,1
logical name: /dev/sda1
capacity: 1937MB
capabilities: primary
*-usb:1
description: USB Controller
product: VT82xxxxx UHCI USB 1.1 Controller
vendor: VIA Technologies, Inc.
physical id: 10.1
bus info: pci@0000:00:10.1
...