Article 4VKT9 QEMU (4.1.0) Connect a usb-sata-hdd

QEMU (4.1.0) Connect a usb-sata-hdd

by
Luridis
from LinuxQuestions.org on (#4VKT9)
(Apologies for the original post, it was supposed to be a new thread and somehow ended up a repy, I removed that one since it was off-topic to that thread.)

I've been trying to do this for hours and can't figure out why it is not working. I've dug through dozens of guides, webpages and manuals and none of the examples seem to work completely. So first, here is my ls{pci,usb,scsi} (trimmed):

Code:lspci
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 7 Series/C216 Chipset Family PCI Express Root Port 1 (rev c4)
00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4)
00:1c.3 PCI bridge: Intel Corporation 7 Series/C216 Chipset Family PCI Express Root Port 4 (rev c4)
00:1d.0 USB controller: Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
lsusb
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 13d3:5719 IMC Networks
Bus 001 Device 003: ID 8087:07da Intel Corp.
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 004: ID 13fd:1e40 Initio Corporation INIC-1610P SATA bridge
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
lsscsi
[0:0:0:0] disk ATA ST750LX003-1AC15 SM12 /dev/sda
[2:0:0:0] cd/dvd MATSHITA DVD-RAM UJ8B2 1.00 /dev/sr0
[6:0:0:0] disk SWI SD Card 2.31 /dev/sdb
[7:0:0:0] disk ST ST9500420AS 3.00 /dev/sdcHere are the exmples I've found:

qemu-system-x86_64 <my other options> -usb -usbdevice disk:/dev/sdc
Doesn't work, warns depreciated, can't find updated version of command, assumed a dead end.

qemu-system-x86_64 <my other options> -hda /dev/sdc
This works for the most part, but things like cgdisk won't work because it prevents writing to block 0. Note the warning:

Code:WARNING: Image format was not specified for '/dev/sdc' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.Yet there is no way to secify things like cache=none and format=raw using this method. Though if I boot an archlinux iso, everything appears to be fine, except the sector zero block.

What about connecting via usb: qemu-system-x86_64 <my other options>-usb -device usb-host,hostbus=2,hostaddr=4
NOPE! If I boot from the arch iso the kerenel completely throws a tantrum and keeps disconnecting and reconnecting the drive.

I tried several other methods, virtio-scsi, etc. (complained of no pcie bus)

I'm really lost on this one. Because the -hda method does work with limitations, I just need to know how to do that while specifying a raw format, etc. But nothing I've found explains how to do that. Has anyone managed to connect a usb-sata enclosure drive to qemu and get it properly recognized?latest?d=yIl2AUoC8zA latest?i=Pwn2_lKnfjE:wXkFUgWte_E:F7zBnMy latest?i=Pwn2_lKnfjE:wXkFUgWte_E:V_sGLiP latest?d=qj6IDK7rITs latest?i=Pwn2_lKnfjE:wXkFUgWte_E:gIN9vFwPwn2_lKnfjE
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments