linux - 如何在uclinux中访问USB大容量存储设备...?

标签 linux linux-device-driver embedded-linux uclinux

我有内核日志,它说有关 USB,但如何访问它。/dev 中没有设备注册..?如何访问这个..? 并配置和 anabledin 内核

在“设备驱动程序”下

在“USB 支持”下 启用“USB 海量存储支持” (可选)启用“USB 海量存储详细调试” 在“SCSI 设备支持 -->”下 启用“SCSI 磁盘支持”

usb 1-2: new full speed USB device using lpc178x-ohci and address 2         
usb 1-2: New USB device found, idVendor=8564, idProduct=1000                    
usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3               
usb 1-2: Product: Mass Storage Device                                           
usb 1-2: Manufacturer: JetFlash                                                 
usb 1-2: SerialNumber: 74O2LC2HD514SCME 

最佳答案

@Amar,在内核日志中,将找到有关插入的 USB 大容量存储设备在文件系统中附加到何处的信息,例如:它可以是 sda 或 sdb 或 sdc。检查并使用mount命令挂载USB大容量存储sudo mount /dev/sd* <Path where you want to mount USB device>然后您就可以访问 USB 大容量存储设备了。以下是有关 USB 大容量存储连接位置的内核日志信息

[85508.500115] usb 1-1: new high speed USB device using ehci_hcd and address 3
[85509.110370] usb 1-1: configuration #1 chosen from 1 choice
[85509.112895] scsi4 : SCSI emulation for USB Mass Storage devices
[85509.113486] usb-storage: device found at 3
[85509.113487] usb-storage: waiting for device to settle before scanning
[85514.128615] usb-storage: device scan complete
[85514.137855] scsi 4:0:0:0: Direct-Access Generic- Compact Flash 1.01 PQ: 0 ANSI: 0
[85514.146766] scsi 4:0:0:1: Direct-Access Multiple Flash Reader  1.05 PQ: 0 ANSI: 0
[85514.148945] sd 4:0:0:0: Attached scsi generic sg2 type 0
[85514.149018] sd 4:0:0:1: Attached scsi generic sg3 type 0
[85514.549761] sd 4:0:0:0: [sdb] Attached SCSI removable disk
[85514.558770] sd 4:0:0:1: [sdc] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
[85514.586964] sd 4:0:0:1: [sdc] Write Protect is off
[85514.586966] sd 4:0:0:1: [sdc] Mode Sense: 03 00 00 00
[85514.586968] sd 4:0:0:1: [sdc] Assuming drive cache: write through
[85514.711875] sd 4:0:0:1: [sdc] Assuming drive cache: write through
[85514.711880]  sdc: sdc1 sdc2 sdc3 sdc4
[85514.808220] sd 4:0:0:1: [sdc] Assuming drive cache: write through
[85514.808224] sd 4:0:0:1: [sdc] Attached SCSI removable disk

在这种情况下,挂载/dev/sdc1 或/dev/sdc2 或/dev/sdc3 或/dev/sdc4 分区 取决于您感兴趣的分区。

关于linux - 如何在uclinux中访问USB大容量存储设备...?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18826757/

相关文章:

linux - 在使用两个文件时在 grep 中使用正则表达式

linux - 在不使用 sed 或 awk 的情况下从文件中删除特定行

linux - 如何分析lpt测试用例的测试结果

c - 嵌入式 Linux C 代码,用于从 USB 驱动器执行 cp 到主机上的目录,保持目录结构完整

c++ - 取消设置 glXMakeContextCurrent 时进程崩溃

linux - 是否可以为 Mathematica 运行使用自定义别名?

c - 在 linux 上用 C 语言打开系统调用

linux - cdev_add() 在 117 上向 major 成功注册后,字符设备出现在哪里。

linux - 有时在 Raspbian Buster、Raspberry Pi 4 中重新启动时未加载蓝牙模块

embedded-linux - Yocto Jethro : no package provider for gdbserver