12 个解决方案
#1
#2
用lsusb -v可以打印信息的USB文本信息,然后再去解析文本即可。
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0 Unused
bDeviceProtocol 0 Full speed (or root) hub
bMaxPacketSize0 64
idVendor 0x1d6b Linux Foundation
idProduct 0x0002 2.0 root hub
bcdDevice 2.06
iManufacturer 3
iProduct 2
iSerial 1
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 25
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 12
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0 Unused
bDeviceProtocol 0 Full speed (or root) hub
bMaxPacketSize0 64
idVendor 0x1d6b Linux Foundation
idProduct 0x0002 2.0 root hub
bcdDevice 2.06
iManufacturer 3
iProduct 2
iSerial 1
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 25
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 12
#3
# mount -l
/dev/sda6 on / type ext4 (rw) [_CentOS-6.2-i386]
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
/dev/sda1 on /mnt type fuseblk (rw,allow_other,blksize=4096) [system]
/dev/sdb4 on /media/QIANG1 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=0,gid=0,shortname=mixed,dmask=0077,utf8=1,flush) [ QIANG1]
/dev/sdb3 on /media/22B7-0812 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=0,gid=0,shortname=mixed,dmask=0077,utf8=1,flush)
/dev/sdb5 on /media/QIANG2 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=0,gid=0,shortname=mixed,dmask=0077,utf8=1,flush) [ QIANG2]
/dev/sda6 on / type ext4 (rw) [_CentOS-6.2-i386]
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
/dev/sda1 on /mnt type fuseblk (rw,allow_other,blksize=4096) [system]
/dev/sdb4 on /media/QIANG1 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=0,gid=0,shortname=mixed,dmask=0077,utf8=1,flush) [ QIANG1]
/dev/sdb3 on /media/22B7-0812 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=0,gid=0,shortname=mixed,dmask=0077,utf8=1,flush)
/dev/sdb5 on /media/QIANG2 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=0,gid=0,shortname=mixed,dmask=0077,utf8=1,flush) [ QIANG2]
#4
U盘插上后 在/dev 目录下会有个sda1 就是你的U盘 这时候把他mount到rootfs文件系统上就可以了。。到时候到文件系统上操作就等于直接操作/dev/sda1了
#5
# blkid
/dev/sda1: LABEL="system" UUID="C04C4D254C4D1794" TYPE="ntfs"
/dev/sda5: LABEL="work" UUID="7866DDC666DD84F2" TYPE="ntfs"
/dev/sda6: LABEL="_CentOS-6.2-i386" UUID="63458d14-0c2d-4f47-812b-162d97e59f1a" TYPE="ext4"
/dev/sda7: UUID="698b4dde-74eb-4873-b173-0a4952c9c955" TYPE="swap"
/dev/sdb1: UUID="186EDD8F6EDD6652" TYPE="ntfs"
/dev/sdb3: SEC_TYPE="msdos" UUID="22B7-0812" TYPE="vfat"
/dev/sdb4: SEC_TYPE="msdos" LABEL="QIANG1" UUID="36BE-8911" TYPE="vfat"
/dev/sdb5: SEC_TYPE="msdos" LABEL="QIANG2" UUID="E8D6-9462" TYPE="vfat"
blkid在busybox里面就有,要是想用C代码获取卷标,在嵌入式linux下直接看busybox里面的blkid就可以了
/dev/sda1: LABEL="system" UUID="C04C4D254C4D1794" TYPE="ntfs"
/dev/sda5: LABEL="work" UUID="7866DDC666DD84F2" TYPE="ntfs"
/dev/sda6: LABEL="_CentOS-6.2-i386" UUID="63458d14-0c2d-4f47-812b-162d97e59f1a" TYPE="ext4"
/dev/sda7: UUID="698b4dde-74eb-4873-b173-0a4952c9c955" TYPE="swap"
/dev/sdb1: UUID="186EDD8F6EDD6652" TYPE="ntfs"
/dev/sdb3: SEC_TYPE="msdos" UUID="22B7-0812" TYPE="vfat"
/dev/sdb4: SEC_TYPE="msdos" LABEL="QIANG1" UUID="36BE-8911" TYPE="vfat"
/dev/sdb5: SEC_TYPE="msdos" LABEL="QIANG2" UUID="E8D6-9462" TYPE="vfat"
blkid在busybox里面就有,要是想用C代码获取卷标,在嵌入式linux下直接看busybox里面的blkid就可以了
#6
fdisk -l
#7
辛苦各位大牛了,大家的信息对我很有启发,之前忘了说是在嵌入式设备上,我搞的是机顶盒开发
(淹晕的鱼)正是我所需要的东西
(淹晕的鱼)正是我所需要的东西
#8
这个在主机上可以读出U盘的名字
#9
blkid在busybox里面就有,要是想用C代码获取卷标,在嵌入式linux下直接看busybox里面的blkid就可以了
在嵌入式linux下直接看busybox里面的blkid就可以了,5楼的哥们能说得细一些吗???
在嵌入式linux下直接看busybox里面的blkid就可以了,5楼的哥们能说得细一些吗???
#10
在busybox里修改.config下CONFIG_BLKID=y,然后直接用blkid就可以了.代码在busybox/util-linux下blkid.c里面
#11
可找到了文件?建议直接用命令把结果输入文件,再从文件中获取。相对方便些。
#12
#1
#2
用lsusb -v可以打印信息的USB文本信息,然后再去解析文本即可。
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0 Unused
bDeviceProtocol 0 Full speed (or root) hub
bMaxPacketSize0 64
idVendor 0x1d6b Linux Foundation
idProduct 0x0002 2.0 root hub
bcdDevice 2.06
iManufacturer 3
iProduct 2
iSerial 1
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 25
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 12
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0 Unused
bDeviceProtocol 0 Full speed (or root) hub
bMaxPacketSize0 64
idVendor 0x1d6b Linux Foundation
idProduct 0x0002 2.0 root hub
bcdDevice 2.06
iManufacturer 3
iProduct 2
iSerial 1
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 25
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 12
#3
# mount -l
/dev/sda6 on / type ext4 (rw) [_CentOS-6.2-i386]
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
/dev/sda1 on /mnt type fuseblk (rw,allow_other,blksize=4096) [system]
/dev/sdb4 on /media/QIANG1 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=0,gid=0,shortname=mixed,dmask=0077,utf8=1,flush) [ QIANG1]
/dev/sdb3 on /media/22B7-0812 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=0,gid=0,shortname=mixed,dmask=0077,utf8=1,flush)
/dev/sdb5 on /media/QIANG2 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=0,gid=0,shortname=mixed,dmask=0077,utf8=1,flush) [ QIANG2]
/dev/sda6 on / type ext4 (rw) [_CentOS-6.2-i386]
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
/dev/sda1 on /mnt type fuseblk (rw,allow_other,blksize=4096) [system]
/dev/sdb4 on /media/QIANG1 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=0,gid=0,shortname=mixed,dmask=0077,utf8=1,flush) [ QIANG1]
/dev/sdb3 on /media/22B7-0812 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=0,gid=0,shortname=mixed,dmask=0077,utf8=1,flush)
/dev/sdb5 on /media/QIANG2 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=0,gid=0,shortname=mixed,dmask=0077,utf8=1,flush) [ QIANG2]
#4
U盘插上后 在/dev 目录下会有个sda1 就是你的U盘 这时候把他mount到rootfs文件系统上就可以了。。到时候到文件系统上操作就等于直接操作/dev/sda1了
#5
# blkid
/dev/sda1: LABEL="system" UUID="C04C4D254C4D1794" TYPE="ntfs"
/dev/sda5: LABEL="work" UUID="7866DDC666DD84F2" TYPE="ntfs"
/dev/sda6: LABEL="_CentOS-6.2-i386" UUID="63458d14-0c2d-4f47-812b-162d97e59f1a" TYPE="ext4"
/dev/sda7: UUID="698b4dde-74eb-4873-b173-0a4952c9c955" TYPE="swap"
/dev/sdb1: UUID="186EDD8F6EDD6652" TYPE="ntfs"
/dev/sdb3: SEC_TYPE="msdos" UUID="22B7-0812" TYPE="vfat"
/dev/sdb4: SEC_TYPE="msdos" LABEL="QIANG1" UUID="36BE-8911" TYPE="vfat"
/dev/sdb5: SEC_TYPE="msdos" LABEL="QIANG2" UUID="E8D6-9462" TYPE="vfat"
blkid在busybox里面就有,要是想用C代码获取卷标,在嵌入式linux下直接看busybox里面的blkid就可以了
/dev/sda1: LABEL="system" UUID="C04C4D254C4D1794" TYPE="ntfs"
/dev/sda5: LABEL="work" UUID="7866DDC666DD84F2" TYPE="ntfs"
/dev/sda6: LABEL="_CentOS-6.2-i386" UUID="63458d14-0c2d-4f47-812b-162d97e59f1a" TYPE="ext4"
/dev/sda7: UUID="698b4dde-74eb-4873-b173-0a4952c9c955" TYPE="swap"
/dev/sdb1: UUID="186EDD8F6EDD6652" TYPE="ntfs"
/dev/sdb3: SEC_TYPE="msdos" UUID="22B7-0812" TYPE="vfat"
/dev/sdb4: SEC_TYPE="msdos" LABEL="QIANG1" UUID="36BE-8911" TYPE="vfat"
/dev/sdb5: SEC_TYPE="msdos" LABEL="QIANG2" UUID="E8D6-9462" TYPE="vfat"
blkid在busybox里面就有,要是想用C代码获取卷标,在嵌入式linux下直接看busybox里面的blkid就可以了
#6
fdisk -l
#7
辛苦各位大牛了,大家的信息对我很有启发,之前忘了说是在嵌入式设备上,我搞的是机顶盒开发
(淹晕的鱼)正是我所需要的东西
(淹晕的鱼)正是我所需要的东西
#8
这个在主机上可以读出U盘的名字
#9
blkid在busybox里面就有,要是想用C代码获取卷标,在嵌入式linux下直接看busybox里面的blkid就可以了
在嵌入式linux下直接看busybox里面的blkid就可以了,5楼的哥们能说得细一些吗???
在嵌入式linux下直接看busybox里面的blkid就可以了,5楼的哥们能说得细一些吗???
#10
在busybox里修改.config下CONFIG_BLKID=y,然后直接用blkid就可以了.代码在busybox/util-linux下blkid.c里面
#11
可找到了文件?建议直接用命令把结果输入文件,再从文件中获取。相对方便些。