Fedora

無法在 Fedora 28 上訪問/(自動)安裝 SD 卡

  • October 27, 2019

我正在嘗試訪問 Fedora 28 上的 SD 卡,但沒有任何成功。系統資訊如下:

$ lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: Fedora
Description:    Fedora release 28 (Twenty Eight)
Release:    28
Codename:   TwentyEight

我無法使用兩個不同的讀卡器訪問不同的 SD 卡。儘管在 macOS 和 Windows 上都可以訪問,但它們都沒有顯示在 Nautilus 文件瀏覽器、桌面或其他地方明顯。

lsusb系統根據輸出辨識讀卡器:

$ lsusb -v
# some other USB devices
Bus 001 Device 005: ID 058f:6362 Alcor Micro Corp. Flash Card Reader/Writer
Device Descriptor:
bLength                18
bDescriptorType         1
bcdUSB               2.00
bDeviceClass            0 
bDeviceSubClass         0 
bDeviceProtocol         0 
bMaxPacketSize0        64
idVendor           0x058f Alcor Micro Corp.
idProduct          0x6362 Flash Card Reader/Writer
bcdDevice            1.29
iManufacturer           1 
iProduct                2 
iSerial                 3 
bNumConfigurations      1
Configuration Descriptor:
   bLength                 9
   bDescriptorType         2
   wTotalLength           32
   bNumInterfaces          1
   bConfigurationValue     1
   iConfiguration          0 
   bmAttributes         0x80
   (Bus Powered)
   MaxPower              250mA
   Interface Descriptor:
   bLength                 9
   bDescriptorType         4
   bInterfaceNumber        0
   bAlternateSetting       0
   bNumEndpoints           2
   bInterfaceClass         8 Mass Storage
   bInterfaceSubClass      6 SCSI
   bInterfaceProtocol     80 Bulk-Only
   iInterface              0 
   Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x01  EP 1 OUT
       bmAttributes            2
       Transfer Type            Bulk
       Synch Type               None
       Usage Type               Data
       wMaxPacketSize     0x0200  1x 512 bytes
       bInterval               0
   Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x82  EP 2 IN
       bmAttributes            2
       Transfer Type            Bulk
       Synch Type               None
       Usage Type               Data
       wMaxPacketSize     0x0200  1x 512 bytes
       bInterval               0

# some other USB devices

Bus 001 Device 006: ID 0dda:2027 Integrated Circuit Solution, Inc. USB 2.0 Card Reader
Device Descriptor:
bLength                18
bDescriptorType         1
bcdUSB               2.00
bDeviceClass            0 
bDeviceSubClass         0 
bDeviceProtocol         0 
bMaxPacketSize0        64
idVendor           0x0dda Integrated Circuit Solution, Inc.
idProduct          0x2027 USB 2.0 Card Reader
bcdDevice            1.6e
iManufacturer           1 
iProduct                2 
iSerial                 3 
bNumConfigurations      1
Configuration Descriptor:
   bLength                 9
   bDescriptorType         2
   wTotalLength           32
   bNumInterfaces          1
   bConfigurationValue     1
   iConfiguration          4 
   bmAttributes         0x80
   (Bus Powered)
   MaxPower              500mA
   Interface Descriptor:
   bLength                 9
   bDescriptorType         4
   bInterfaceNumber        0
   bAlternateSetting       0
   bNumEndpoints           2
   bInterfaceClass         8 Mass Storage
   bInterfaceSubClass      6 SCSI
   bInterfaceProtocol     80 Bulk-Only
   iInterface              5 
   Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x82  EP 2 IN
       bmAttributes            2
       Transfer Type            Bulk
       Synch Type               None
       Usage Type               Data
       wMaxPacketSize     0x0200  1x 512 bytes
       bInterval               0
   Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x01  EP 1 OUT
       bmAttributes            2
       Transfer Type            Bulk
       Synch Type               None
       Usage Type               Data
       wMaxPacketSize     0x0200  1x 512 bytes
       bInterval               0

# some other USB devices

然後我在插入和拔出卡時查看了 udev 事件:

$ udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[701.434565] change   /devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/host4/target4:0:0/4:0:0:2/block/sde (block)
UDEV  [714.263816] change   /devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/host4/target4:0:0/4:0:0:2/block/sde (block)
KERNEL[748.477184] change   /devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/host4/target4:0:0/4:0:0:2/block/sde (block)
UDEV  [761.338940] change   /devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/host4/target4:0:0/4:0:0:2/block/sde (block)

此外,我還查看了核心消息:

$ dmesg
[  603.846840] usb-storage 1-3:1.0: USB Mass Storage device detected
[  603.847749] scsi host4: usb-storage 1-3:1.0
[  605.703531] scsi 4:0:0:0: Direct-Access     Generic                CF 1.6E PQ: 0 ANSI: 0 CCS
[  605.704982] scsi 4:0:0:1: Direct-Access     Generic                MS 1.6E PQ: 0 ANSI: 0 CCS
[  606.509034] scsi 4:0:0:2: Direct-Access     Generic            MMC/SD 1.6E PQ: 0 ANSI: 0 CCS
[  606.510387] scsi 4:0:0:3: Direct-Access     Generic                SM 1.6E PQ: 0 ANSI: 0 CCS
[  606.511519] sd 4:0:0:0: Attached scsi generic sg4 type 0
[  606.511943] sd 4:0:0:1: Attached scsi generic sg5 type 0
[  606.512177] sd 4:0:0:2: Attached scsi generic sg6 type 0
[  606.512408] sd 4:0:0:3: Attached scsi generic sg7 type 0
[  608.924586] sd 4:0:0:1: [sdd] Attached SCSI removable disk
[  629.830776] sd 4:0:0:2: [sde] Attached SCSI removable disk
[  633.048754] sd 4:0:0:3: [sdf] Attached SCSI removable disk
[  639.490479] sd 4:0:0:0: [sdc] Attached SCSI removable disk

的輸出dmesgudevadm monitor都告訴卡片應該顯示為sde。但是,fdisk -l沒有列出sde。除此之外,嘗試手動安裝設備會引發錯誤:

$ mount -t auto /dev/sde /mnt/
mount: /mnt: no medium found on /dev/sde.

我不確定是否正確載入了所需的驅動程序模組,因為輸出中沒有mmc0-like 條目dmesg(正如我以前從基於 Debian 的系統中知道的那樣)。lsmod也沒有列出mmc0核心模組:

$ lsmod | grep mm
rtl8192c_common        61440  1 rtl8192cu
rtlwifi                98304  3 rtl8192c_common,rtl_usb,rtl8192cu

唯一mmc似乎可用但未載入的類似模組是mmc_blockmmc_core

$ modprobe mm  # listing suggestions using tab auto-completion
mma7660    mmc_block  mmc_core   mms114

我該如何解決這個問題或至少縮小範圍?

總而言之,我測試的兩個讀卡器都有故障。但是,如果您可以消除與硬體相關的問題,請參考此答案。

在此過程中嘗試mount這樣做還為時過早。此消息表明檢測到硬體:

[  629.830776] sd 4:0:0:2: [sde] Attached SCSI removable disk

但是你不能掛載一個設備,除非它上面有一個可掛載的文件系統。使用lsblkblkid查看系統是否辨識 SD 設備。

以下是輸出的外觀以供參考:

lsblk

$ lsblk
NAME             MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                8:0    0 39.1G  0 disk
├─sda1             8:1    0  512M  0 part /boot
├─sda2             8:2    0  500M  0 part
└─sda3             8:3    0 38.1G  0 part
 ├─vg00-lv_root 253:0    0 36.1G  0 lvm  /
 └─vg00-lv_swap 253:1    0    2G  0 lvm  [SWAP]

blkid

$ blkid
/dev/sda1: UUID="0cae38ac-44ea-4a16-9157-a8cbbf50e91b" TYPE="ext4"
/dev/sda2: UUID="013c42ea-aa00-4713-926a-aca57c0bd552" TYPE="xfs"
/dev/sda3: UUID="sgVDOh-NI7x-l4sY-9fJv-uAlW-WfYY-YBoPBQ" TYPE="LVM2_member"
/dev/mapper/vg00-lv_root: UUID="fa4accee-2965-4bc6-85aa-3ed4d0d2ae86" TYPE="ext4"
/dev/mapper/vg00-lv_swap: UUID="998f50cb-a693-411c-aca3-33824ea5a204" TYPE="swap"

作為最後的建議,您可以嘗試安裝/重新安裝udisks2。這在標題為:Ubuntu 16.04 does not detect sd card reader的 AU Q&A 中有描述,但我過去在 Fedora/CentOS 上也遇到過這個問題。

$ sudo yum reinstall udisks2

-or-

$ sudo dnf reinstall udisks2

引用自:https://unix.stackexchange.com/questions/456623