vmware ubuntu: 错误 usb 4-1: stat urb: status -32 when connecting external drive

vmware ubuntu: error usb 4-1: stat urb: status -32 when connecting external drive

我正在使用带有 ubuntu 14.04 LTS 的 vmware。 当我尝试连接我的希捷 M3 时,虚拟机实际上识别了它,但它没有被系统安装或识别。经过一点点挖掘,看起来设备确实已连接,因为命令 lsusb 显示:

Bus 004 Device 004: ID 0bc2:61b6 Seagate RSS LLC 
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

检查系统日志显示系统实际尝试挂载它,失败:

Oct 16 11:42:43 ubuntu kernel: [  479.209798] usb 4-1: new SuperSpeed USB device number 4 using xhci_hcd
Oct 16 11:42:43 ubuntu kernel: [  479.228756] usb 4-1: New USB device found, idVendor=0bc2, idProduct=61b6
Oct 16 11:42:43 ubuntu kernel: [  479.228774] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Oct 16 11:42:43 ubuntu kernel: [  479.228775] usb 4-1: Product: M3
Oct 16 11:42:43 ubuntu kernel: [  479.228776] usb 4-1: Manufacturer: Seagate
Oct 16 11:42:43 ubuntu kernel: [  479.228777] usb 4-1: SerialNumber: NM124VYT
Oct 16 11:42:43 ubuntu kernel: [  479.427608] scsi host35: uas
Oct 16 11:42:43 ubuntu kernel: [  479.429253] usb 4-1: stat urb: status -32
Oct 16 11:42:43 ubuntu kernel: [  479.429273] scsi 35:0:0:0: tag#0 data cmplt err -32 uas-tag 1 inflight: CMD 
Oct 16 11:42:43 ubuntu kernel: [  479.429276] scsi 35:0:0:0: tag#0 CDB: Inquiry 12 00 00 00 24 00
Oct 16 11:42:41 ubuntu vmsvc[1298]: message repeated 10 times: [ [ warning] [guestinfo] Failed to get vmstats.]
Oct 16 11:42:43 ubuntu mtp-probe: checking bus 4, device 4: "/sys/devices/pci0000:00/0000:00:15.0/0000:03:00.0/usb4/4-1"
Oct 16 11:42:43 ubuntu mtp-probe: bus: 4, device: 4 was not an MTP device
Oct 16 11:43:04 ubuntu kernel: [  500.862644] scsi 35:0:0:0: tag#0 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD 
Oct 16 11:43:04 ubuntu kernel: [  500.862650] scsi 35:0:0:0: tag#0 CDB: Inquiry 12 00 00 00 24 00
Oct 16 11:43:04 ubuntu kernel: [  500.862713] scsi host35: uas_eh_bus_reset_handler start
Oct 16 11:43:04 ubuntu kernel: [  500.977721] usb 4-1: reset SuperSpeed USB device number 4 using xhci_hcd
Oct 16 11:43:04 ubuntu kernel: [  501.014051] scsi host35: uas_eh_bus_reset_handler success
Oct 16 11:43:04 ubuntu kernel: [  501.014652] usb 4-1: stat urb: status -32
Oct 16 11:43:04 ubuntu kernel: [  501.017564] scsi 35:0:0:0: tag#0 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD 
Oct 16 11:43:04 ubuntu kernel: [  501.017567] scsi 35:0:0:0: tag#0 CDB: Test Unit Ready 00 00 00 00 00 00
Oct 16 11:43:04 ubuntu kernel: [  501.017570] scsi host35: uas_eh_bus_reset_handler start
Oct 16 11:43:05 ubuntu kernel: [  501.234951] usb 4-1: reset SuperSpeed USB device number 4 using xhci_hcd
Oct 16 11:43:05 ubuntu kernel: [  501.301555] scsi host35: uas_eh_bus_reset_handler success
Oct 16 11:43:05 ubuntu kernel: [  501.301561] scsi 35:0:0:0: Device offlined - not ready after error recovery

显然我用这个 usb 4-1 得到这个 -32 错误。

有人知道为什么会发生这种情况吗?在网上找不到任何相关内容。

usb 4-1是USB端口号,stat urb : status -32表示urb(USBrequest block ) 报告 error -32 ( broken pipe ) cf. http://www.makelinux.net/ldd3/chp-13-sect-3 for the urb and http://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Errors/unix_system_errors.html 错误代码

很可能问题出在 UAS 模块https://en.wikipedia.org/wiki/USB_Attached_SCSI ), see https://bbs.archlinux.org/viewtopic.php?id=183190, https://bbs.archlinux.org/viewtopic.php?id=183723

archlinux 的解决方案在 https://bbs.archlinux.org/viewtopic.php?id=183190 Da_Coynul 的 答案中,它 'blacklists' uas 模块用于通过配置 usb-storage 模块的特定 SCSI 驱动器:

I was able to get my external drive working again by telling the usb-storage module to ignore uas for the device. Here is how to do it:

First, create a file named ignore_uas.conf in the /etc/modprobe.d directory containing the following*

 options usb-storage quirks=Vendor_ID:Product_ID:u

*(substitute your actual Vendor_ID and Product_ID obtained from the lsusb -v command).

Next, regenerate your inital ramdisk:

 # mkinitcpio -p linux

此解决方案必须适用于虚拟机。可能遵循本指南:https://www.vmware.com/support/ws45/doc/disks_add_ws.html 因为似乎不支持热插拔 SCSI 设备:

Hot adding and removing SCSI devices is not supported.

来源:https://docs.vmware.com/en/VMware-vSphere/6.0/com.vmware.vsphere.hostclient.doc/GUID-3E6E58AA-2AD4-4370-9955-07E5FBDE800D.html

作为解决方法,当使用虚拟机时,您可以共享主机上的文件夹,方法是将其添加到设置>选项面板>共享文件夹中。考虑到来宾和主机之间的附加通信层,速度要慢得多,但至少您可以访问驱动器。