我正在嘗試在運行 Raspbian 的 Raspberry Pi 4 上連接 USB DVD/RW 光碟機。
$uname -a
Linux ras4 4.19.93-v7l+ #1290 SMP Fri Jan 10 16:45:11 GMT 2020 armv7l GNU/Linux
驅動器完全工作;我已經在 Windows 上對其進行了測試,幾年前它在 Bananian 上運行(作為驅動器 /dev/sr0)。
當我將它附加到我的 Raspberry 時,以下條目將添加到系統日誌中:
Apr 13 00:11:34 ras4 kernel: [6312011.699514] usb 1-1.2.4.2: new high-speed USB device number 79 using xhci_hcd
Apr 13 00:11:36 ras4 vhusbdarm[669]: Found High speed device [152e:1640] "HLDS Inc, SuperMulti RW " at address 11242
Apr 13 00:11:36 ras4 kernel: [6312014.270562] usb 1-1.2.4.2: New USB device found, idVendor=152e, idProduct=1640, bcdDevice= 1.59
Apr 13 00:11:36 ras4 kernel: [6312014.270581] usb 1-1.2.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Apr 13 00:11:36 ras4 kernel: [6312014.270596] usb 1-1.2.4.2: Product: SuperMulti RW
Apr 13 00:11:36 ras4 kernel: [6312014.270608] usb 1-1.2.4.2: Manufacturer: HLDS Inc
Apr 13 00:11:36 ras4 kernel: [6312014.270621] usb 1-1.2.4.2: SerialNumber: 00101016400014AB5
Apr 13 00:11:36 ras4 kernel: [6312014.272784] usb-storage 1-1.2.4.2:1.0: USB Mass Storage device detected
Apr 13 00:11:36 ras4 kernel: [6312014.273308] scsi host1: usb-storage 1-1.2.4.2:1.0
Apr 13 00:11:36 ras4 mtp-probe: checking bus 1, device 79: "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2.4/1-1.2.4.2"
Apr 13 00:11:36 ras4 mtp-probe: bus: 1, device: 79 was not an MTP device
Apr 13 00:11:36 ras4 mtp-probe: checking bus 1, device 79: "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2.4/1-1.2.4.2"
Apr 13 00:11:36 ras4 mtp-probe: bus: 1, device: 79 was not an MTP device
Apr 13 00:11:37 ras4 kernel: [6312015.301669] scsi 1:0:0:0: CD-ROM HL-DT-ST DVDRAM GE20NU10 EE06 PQ: 0 ANSI: 0
Apr 13 00:11:37 ras4 kernel: [6312015.302557] scsi 1:0:0:0: Attached scsi generic sg1 type 5
沒有可用的裝置 /dev/sr* 或 /dev/cdrom。系統日誌不包含行“Attached scsi CD-ROM sr0”
嘗試掛載 /dev/sg1 失敗,並顯示訊息“不是區塊裝置”,並且 lsblk 未列出它:
$lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465,8G 0 disk
├─sda1 8:1 0 256M 0 part
└─sda2 8:2 0 465,5G 0 part /
mmcblk0 179:0 0 29,7G 0 disk
└─mmcblk0p1 179:1 0 29,7G 0 part /boot
我能做些什麼?難道核心不支援這個設備嗎?
答案1
我已經找到問題了。
由於某種原因,無法載入核心模組“sr_mod”。可能是我的內核出了問題。
$ modprobe sr_mod.ko
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.19.93-v7l+/modules.dep .bin'
modprobe: FATAL: Module sr_mod not found in directory /lib/modules/4.19.93-v7l+
奇怪的是 sr_mod.so 實際上是存在的:
$ ls /lib/modules/4.19.97*/kernel/drivers/scsi/sr_mod.ko
-rw-r--r-- 1 root root 28K Feb 3 13:50 /lib/modules/4.19.97+/kernel/drivers/scsi/sr_mod.ko
-rw-r--r-- 1 root root 30K Feb 3 13:50 /lib/modules/4.19.97-v7+/kernel/drivers/scsi/sr_mod.ko
-rw-r--r-- 1 root root 30K Feb 3 13:50 /lib/modules/4.19.97-v7l+/kernel/drivers/scsi/sr_mod.ko
-rw-r--r-- 1 root root 37K Feb 3 13:50 /lib/modules/4.19.97-v8+/kernel/drivers/scsi/sr_mod.ko
$ uname -a
Linux ras4 4.19.93-v7l+ #1290 SMP Fri Jan 10 16:45:11 GMT 2020 armv7l GNU/Linux
解決辦法是重新安裝核心並重新啟動系統:
$ apt install --reinstall raspberrypi-bootloader raspberrypi-kernel
$ reboot
重新啟動後,模組 sr_mod 會自動加載,/dev/sr0 將變成可用。