Jump to content
2twisty

USB Hard disk doesn't always pass through

5 posts in this topic Last Reply

Recommended Posts

I've got a Linux VM that I want to pass a USB hard disk through.  The box is checked in the VM config to pass it through, and most of the time it doesn't appear in the lsblk output of the VM.

At one point yesterday, it magically showed up and I have no idea what I did to make that happen.  Subsequent reboots of the VM failed to attach the drive.

I tried passing my whole USB controller (separate PCIe device) through, making sure that my flash drive was on a different controller, using the vfio-pci.ids= command in the boot config. After that, UNRaid would not boot.  I had to manually edit the files on my flash to remove the vfio directive and then unraid came right back up.  

 

I've searched the forum for this particular issue and haven't found an answer that seems to apply or works.

What information can I provide to allow you to help me resolve this?  I don't really need/want to pass the entire controller through, since the VM is a server, and I don't need to pass any other USB devices to it (I use SSH or the RealVNC if I need to).

 

Please advise.

Share this post


Link to post

Here's some more info that I just noticed.  It seems that the VM "sees" the external USB drive enclosure, but then does nothing with it.

 

webadmin@panel:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

webadmin@panel:~$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0     11:0    1  667M  0 rom
vda    253:0    0   60G  0 disk
├─vda1 253:1    0  512M  0 part /boot/efi
├─vda2 253:2    0 55.5G  0 part /
└─vda3 253:3    0    4G  0 part [SWAP]
vdb    253:16   0  200G  0 disk
└─vdb1 253:17   0  200G  0 part /var/customers

So maybe this isn't a KVM/unraid issue, but an Ubuntu 16.04 issue.  I'll keep digging, but any ideas are appreciated.

 

Share this post


Link to post

HMMMM.

I read a post about USB hard disks not being detected, and the solution the OP found was that his USB cable was somehow bad.

 

I tried that. It didn't show up in the VM.

So then, I powered it off and restarted.  It appeared!

So, I tried a reboot of the VM.  It's still there as of now.

 

So...bad cable? I was a cheap Chinese enclosure, so who knows.  Hopefully this problem is resolved, but if it recurs, I'll come back here and update with any other things I try/find.

 

 

Share this post


Link to post

Passing a USB device through to a VM using the Form view ticker method is pretty inconsistent. Something i try to do as little as possible.

What i've done for a USB drive based VM is to use the manual Primary Vdisk Location method. And direct the path to the device-id of the drive.

Like so. 929498301_ManualMethod.PNG.4e95c2bdbd3eb4d3f7d0c4abbcf198c2.PNG

 

Supplementing your specific drive after the /dev/disk/by-id/

Using this method the VM will have total access to the drive as a SATA style device. Allowing you to format and partition it how you see fit. Also has the side benefit of storing the data as actual separate file data instead of a .vdisk img of the data.

 

Edit -

You can look up your exact device-id using the unraid terminal. Just

execute  "cd /dev/disk/by-id" command at root

And then  execute "dir" to get a listing of all the drives available to you.

Make sure to use the first listing of your device. The one without the part whatever at the end.

Edited by metathias
More info

Share this post


Link to post

That might work, but it would completely destroy the ability to hotplug/easily remove the device. If I am stuck with that arrangement, I might as  well shuck the drive and install it into the server.  

 

It's a backup drive, so I'd like the ability to remove it from the system.  I use rSync to copy the files, so I am considering taking the drive off-site (eventually) and use remote rSync.  

 

I guess I'll take another stab at passing the entire USB controller through to the VM.  I'd imagine that would be more stable -- only when I tried it, it caused my unraid server not to boot.  I am 95% sure that the flash was NOT connected to that controller at the time, but have since moved it to the external USB3 ports on the motherboard (rather than using the internal USB3 header on the motherboard) so I am now 100% certain that the flash isn't on the USB3 add-in card.  So I will try again and see if I can make that work.

 

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.