在Linux下无法识别USB驱动器

时间:2020-01-09 10:44:01  来源:igfitidea点击:

为了在Linux下访问USB驱动器,您需要加载特殊的USB驱动器,并且运行Linux内核中必须包含支持。
尝试一个接一个地执行以下命令来解决您的问题:

步骤1:确保系统检测到您的外部驱动器运行dmesg命令,该命令可打印或者控制内核环形缓冲区:

dmesg

或者

dmesg | grep i USB

输出:

SLPB PCI0 HUB0 USB0 USB1 USB2 USBE
usbcore: registered new driver usbfs
usbcore: registered new driver hub
USB Universal Host Controller Interface driver v2.3
uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 1
hub 1-0:1.0: USB hub found
uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 2
hub 2-0:1.0: USB hub found
uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 3
usb 1-2: new full speed USB device using uhci_hcd and address 2
hub 3-0:1.0: USB hub found

如您所见,内核中包含USB支持。
您还可以使用以下命令对此进行验证:

lspci -v | grep HCI

输出:

0000:00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 02) (prog-if 00 [UHCI])
0000:00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 02) (prog-if 00 [UHCI])
0000:00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 02) (prog-if 00 [UHCI])
0000:00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 02) (prog-if 20 [EHCI])

步骤2:加载USB模块/驱动程序如果在dmesg输出中看不到外部USB驱动器,请尝试加载usb-uhci和usb-ohci模块(驱动程序):

modprobe usb-uhci  modprobe usb-ohci  modprobe usb-storage

现在再次运行dmesg:

dmesg

输出:

usb 4-1: new high speed USB device using ehci_hcd and address 3
scsi2 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
Vendor: SAMSUNG   Model: SV4002H           Rev: 0811
Type:   Direct-Access                      ANSI SCSI revision: 00
SCSI device sdb: 78242976 512-byte hdwr sectors (40060 MB)
sdb: assuming drive cache: write through
SCSI device sdb: 78242976 512-byte hdwr sectors (40060 MB)
sdb: assuming drive cache: write through
sdb: sdb1
sd 2:0:0:0: Attached scsi disk sdb
usb-storage: device scan complete

步骤3:使用外部USB驱动器如您所见,将设备sdb分配给了外部USB驱动器,请使用mount命令来安装驱动器:在/dev/sdb上列出分区:

fdisk -l | grep sdb

输出:

Disk /dev/sda doesn't contain a valid partition table
Disk /dev/sdb: 40.0 GB, 40060403712 bytes
/dev/sdb1               1        4870    39118243+   c  W95 FAT32 (LBA)

现在挂载分区:

mount /dev/sdb1 /mnt