我有一部大约两年前买的手机。刚买这部手机时,内置的微型 SD 卡识别毫无问题。我所要做的就是使用 USB 数据线连接手机,然后选择大容量储存在电话中从提供的列表中(其他人摄像头和通信端口)。
今天我发现,当我连接手机时,它根本无法被识别。
以下条目位于/var/log/syslog
Apr 14 16:07:01 HomeDell kernel: [ 6661.524019] usb 5-2: new full-speed USB device number 11 using uhci_hcd
Apr 14 16:07:01 HomeDell kernel: [ 6661.700045] usb 5-2: New USB device found, idVendor=0e8d, idProduct=0002
Apr 14 16:07:01 HomeDell kernel: [ 6661.700054] usb 5-2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
Apr 14 16:07:01 HomeDell kernel: [ 6661.700058] usb 5-2: Product: MT6235
Apr 14 16:07:01 HomeDell kernel: [ 6661.700062] usb 5-2: Manufacturer: MediaTek Inc
Apr 14 16:07:01 HomeDell kernel: [ 6661.700065] usb 5-2: SerialNumber: 53223730122274f
Apr 14 16:07:01 HomeDell kernel: [ 6661.706198] usb-storage 5-2:1.0: USB Mass Storage device detected
Apr 14 16:07:01 HomeDell kernel: [ 6661.706374] scsi host6: usb-storage 5-2:1.0
Apr 14 16:07:01 HomeDell mtp-probe: checking bus 5, device 11: "/sys/devices/pci0000:00/0000:00:1d.3/usb5/5-2"
Apr 14 16:07:01 HomeDell mtp-probe: bus: 5, device: 11 was not an MTP device
Apr 14 16:07:02 HomeDell systemd[1]: Starting USB_ModeSwitch_5-2...
Apr 14 16:07:02 HomeDell usb_modeswitch_dispatcher[8361]: Could not read attribute: No such file or directory
Apr 14 16:07:02 HomeDell kernel: [ 6662.709045] scsi 6:0:0:0: Direct-Access MEDIATEK FLASH DISK 6235 PQ: 0 ANSI: 0 CCS
Apr 14 16:07:02 HomeDell kernel: [ 6662.712064] scsi 6:0:0:1: Direct-Access MEDIATEK FLASH DISK 6235 PQ: 0 ANSI: 0 CCS
Apr 14 16:07:02 HomeDell kernel: [ 6662.712853] sd 6:0:0:0: Attached scsi generic sg1 type 0
Apr 14 16:07:02 HomeDell kernel: [ 6662.713613] sd 6:0:0:1: Attached scsi generic sg2 type 0
Apr 14 16:07:03 HomeDell kernel: [ 6662.721057] sd 6:0:0:0: [sdb] 15628288 512-byte logical blocks: (8.00 GB/7.45 GiB)
Apr 14 16:07:03 HomeDell kernel: [ 6662.726540] sd 6:0:0:1: [sdc] 180000 512-byte logical blocks: (92.1 MB/87.8 MiB)
Apr 14 16:07:03 HomeDell kernel: [ 6662.729063] sd 6:0:0:0: [sdb] Write Protect is off
Apr 14 16:07:03 HomeDell kernel: [ 6662.729076] sd 6:0:0:0: [sdb] Mode Sense: 03 00 00 00
Apr 14 16:07:03 HomeDell kernel: [ 6662.732104] sd 6:0:0:1: [sdc] Write Protect is off
Apr 14 16:07:03 HomeDell kernel: [ 6662.732118] sd 6:0:0:1: [sdc] Mode Sense: 03 00 00 00
Apr 14 16:07:03 HomeDell kernel: [ 6662.735065] sd 6:0:0:0: [sdb] No Caching mode page found
Apr 14 16:07:03 HomeDell kernel: [ 6662.735078] sd 6:0:0:0: [sdb] Assuming drive cache: write through
Apr 14 16:07:03 HomeDell kernel: [ 6662.738053] sd 6:0:0:1: [sdc] No Caching mode page found
Apr 14 16:07:03 HomeDell kernel: [ 6662.738067] sd 6:0:0:1: [sdc] Assuming drive cache: write through
Apr 14 16:07:03 HomeDell kernel: [ 6662.777499] sdb: sdb1
Apr 14 16:07:03 HomeDell kernel: [ 6662.786102] sdc:
Apr 14 16:07:03 HomeDell kernel: [ 6662.821056] sd 6:0:0:0: [sdb] Attached SCSI removable disk
Apr 14 16:07:03 HomeDell kernel: [ 6662.824163] sd 6:0:0:1: [sdc] Attached SCSI removable disk
Apr 14 16:07:02 HomeDell usb_modeswitch_dispatcher[8361]: message repeated 2 times: [ Could not read attribute: No such file or directory]
Apr 14 16:07:03 HomeDell usb_modeswitch: switch device 0e8d:0002 on 005/011
Apr 14 16:07:03 HomeDell systemd-udevd[8373]: inotify_add_watch(9, /dev/sdb, 10) failed: No such file or directory
Apr 14 16:07:03 HomeDell systemd-udevd[8376]: inotify_add_watch(9, /dev/sdc, 10) failed: No such file or directory
Apr 14 16:07:03 HomeDell systemd-udevd[8373]: inotify_add_watch(9, /dev/sdb1, 10) failed: No such file or directory
Apr 14 16:07:04 HomeDell usb_modeswitch[8361]: usb_modeswitch: switched to 0e8d:0002 on 5/11
Apr 14 16:07:05 HomeDell usb_modeswitch_dispatcher[8361]: Unable to open bind list file: No such file or directory
Apr 14 16:07:05 HomeDell usb_modeswitch[8361]: usb_modeswitch: add device ID 0e8d:0002 to driver option
Apr 14 16:07:05 HomeDell usb_modeswitch[8361]: usb_modeswitch: please report the device ID to the Linux USB developers!
Apr 14 16:07:06 HomeDell colord-sane: io/hpmud/pp.c 627: unable to read device-id ret=-1
Apr 14 16:07:12 HomeDell systemd[1]: Started USB_ModeSwitch_5-2.
以下几点可能相关。
- 这是一款廉价的品牌手机。
- 这是一款非Android手机。
- 手机和内部存储在 Windows 8 中可以毫无问题地识别。
- 以前和现在的内置 SD 卡不一样。我的手机大约一年多没有装 SD 卡了。今天,我给手机插了一张新 SD 卡(Transcend MicroSDHC Class 10 8GB)。
当手机连接时,会出现一个菜单,提供“大容量存储”、“网络摄像头”和“COM 端口”选项。如果选择第二个或第三个,则lsusb
发出命令时会出现以下内容。
总线 005 设备 009:ID 0e8d:0003 联发科技 MT6227 手机
但是,如果选择第一个选项(大容量存储),则 lsusb
输出为,
总线 005 设备 019:ID 0e8d:0002 MediaTek Inc.
更新 1
- Ubuntu 15.10(但我在 Ubuntu 16.04 中测试时也出现了同样的失败)。
- 内核:4.2.8-040208-generic。
- 手机:Symphony X120(如上所示,
lsusb
称其为联发科技 MT6227 手机。
答案1
解决的关键是 usb-modeswitch 错误。
usb-modeswitch 被引入作为处理具有不同模式的设备的一种手段,最常见的例子是 USB 上网本,它在首次插入时具有类似驱动器的属性以访问 Windows 驱动程序。安装后,驱动程序将设备的模式切换为 UMTS 或 LTE 调制解调器模式。
OP 的手机需要相同的程序来访问存储。
通常,USB 模式切换是相当自动的,但在这种情况下,周围存在具有冲突的 USB ID 的设备,阻碍了全自动解决方案。
自该设备的问题已经已知;只需注释掉该行
ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="0002", RUN+="usb_modeswitch \'%b/%k\'"
,/lib/udev/rules.d/40-usb_modeswitch.rules
它就可以工作了。
现在,您已经向 PC 明确了您的设备到底是什么。唯一的缺点是,如果您遇到一个 ID 冲突的 USB 设备,它们将被视为您的手机,并抛出错误甚至失败。