对于 USB SD 读卡器,只有在 USB 读卡器插入之前插入 SD 卡才会显示

对于 USB SD 读卡器,只有在 USB 读卡器插入之前插入 SD 卡才会显示

我在 RaspberryPi Zero 2 W 上的3.17.0内核上运行 Alpine Linux 。5.15.79-0-rpi

我有一个 USB 读卡器和一张 SD 卡。

当我将 SD 卡插入读卡器,然后将读卡器插入 USB 插槽时,它会自动安装,我可以访问卡中的内容。

当以这种方式插入时,dmesg显示它安装为sda1

[ 1425.822741] Indeed it is in host mode hprt0 = 00021501
[ 1425.996620] usb 1-1: new high-speed USB device number 4 using dwc_otg
[ 1425.996871] Indeed it is in host mode hprt0 = 00001101
[ 1426.183766] usb 1-1: New USB device found, idVendor=aaaa, idProduct=8816, bcdDevice=13.08
[ 1426.183796] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1426.183817] usb 1-1: Product: MXT USB Device
[ 1426.183835] usb 1-1: Manufacturer: MXTronics
[ 1426.183853] usb 1-1: SerialNumber: 150101v01
[ 1426.186055] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 1426.187527] scsi host0: usb-storage 1-1:1.0
[ 1427.235838] scsi 0:0:0:0: Direct-Access     MXT-USB  Storage Device   1501 PQ: 0 ANSI: 0 CCS
[ 1427.241320] sd 0:0:0:0: [sda] 62333952 512-byte logical blocks: (31.9 GB/29.7 GiB)
[ 1427.241930] sd 0:0:0:0: [sda] Write Protect is off
[ 1427.241968] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[ 1427.242402] sd 0:0:0:0: [sda] No Caching mode page found
[ 1427.242429] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 1427.251302]  sda: sda1
[ 1427.253944] sd 0:0:0:0: [sda] Attached SCSI removable disk

但是,当读卡器在没有 SD 卡的情况下插入时,并且我随后将其插入,它无法安装。sda1根本不显示,而且我似乎无法手动安装它。

当以这种方式插入时,dmesg显示:

[ 1590.567395] Indeed it is in host mode hprt0 = 00021501
[ 1590.741262] usb 1-1: new high-speed USB device number 5 using dwc_otg
[ 1590.741495] Indeed it is in host mode hprt0 = 00001101
[ 1590.928339] usb 1-1: New USB device found, idVendor=aaaa, idProduct=8816, bcdDevice=13.08
[ 1590.928368] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1590.928389] usb 1-1: Product: MXT USB Device
[ 1590.928408] usb 1-1: Manufacturer: MXTronics
[ 1590.928426] usb 1-1: SerialNumber: 150101v01
[ 1590.930159] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 1590.931758] scsi host0: usb-storage 1-1:1.0
[ 1591.972410] scsi 0:0:0:0: Direct-Access     MXT-USB  Storage Device   1501 PQ: 0 ANSI: 0 CCS
[ 1591.975152] sd 0:0:0:0: [sda] Media removed, stopped polling
[ 1591.979599] sd 0:0:0:0: [sda] Attached SCSI removable disk

仅插入或取出 SD 卡时, 中不会显示更多消息dmesg

读卡器显示在lsusb

Bus 001 Device 005: ID aaaa:8816 MXTronics MXT USB Device
Bus 001 Device 001: ID 1d6b:0002 Linux 5.15.79-0-rpi dwc_otg_hcd DWC OTG Controller

但是,下面没有显示任何与 SD 卡相关的内容lsblk

NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
loop0         7:0    0 27.1M  1 loop /.modloop
sda           8:0    1    0B  0 disk 
mmcblk0     179:0    0 14.8G  0 disk 
├─mmcblk0p1 179:1    0  200M  0 part /media/mmcblk0p1
└─mmcblk0p2 179:2    0 14.6G  0 part /media/mmcblk0p2

此时我有点不确定问题可能出在哪里。一些论坛帖子说更换读卡器有效,但我尝试了可用的三种不同的 USB 读卡器,这三种读卡器都有相同的问题。

我还看到一些帖子谈论安装不同的模块,但这似乎不太可能,因为只有当我同时将读卡器和卡插入在一起时,卡才能成功安装。

重要的一点似乎是那条Media removed, stopped polling线。有一篇文章谈到CONFIG_HOTPLUG_PCI_*,但我不相信USB读卡器是PCI设备?

相关内容