Problems using USB DAT


#1

Hi

I’m currently trying to migrate some machines from vmware server to KVM and I’m having trouble with a particular machine that uses an USB connected tape drive with AMANDA.

The tape drive is passed through OK and is visible on the guest;

~# lsusb Bus 001 Device 002: ID 03f0:0125 Hewlett-Packard

Here is where it gets interesting though. If I try writing to the device in the KVM guest; I get “The device or resource is busy” and it fails;

~# dd if=/dev/urandom of=/dev/nst0 bs=1024k count=500 dd: writing `/dev/nst0': Device or resource busy 1+0 records in 0+0 records out 0 bytes (0 B) copied, 7.36953 s, 0.0 kB/s

If I run the same test on the KVM host it works fine.

The problem appears to be that even though I have passed the USB device through to the guest, the host machine is still “holding on to” the device.

Do I have to do something on the host to make it “let go” of the device so that the guest can write to it?


#2

Well, I appear to have figured out what was going on. It seems that I had been playing around with usb over IP several months back and I had inadvertently left the configuration to export the device in place.

Because it was being “exported” by USBoIP the drive was consequently seen as being “in use”

oopsie

After removing the USB over IP stuff on the host everything now works as expected.