System will hang after my truenas instances add USB controller and started

I know that I should Avoid using USB-connected hard disks for primary storage with TrueNAS, but my motherboard has limited m.2 interfaces and there happens to be a built-in USB interface on the motherboard, so I installed the system on an SSD USB drive. My SSD USB drive is like SSK USB3.0. When I add USB controller to the instance in instances, the system will hangs and the main system no longer responds. After restarting the system, the truenas cli shows USB Device or resource busy. After a while, the system still hangs. I guess it is because the USB controller is occupied after the instance is started. Is this a problem? or is there any way to avoid passthrough the system’s USB directly to the virtual machine.

I am guessing (from your use of “instances” because you didn’t state it explicitly) that thus is TrueNAS as a VM under e.g. Proxmox.

As a user of a USB SSK SSD boot drive myself (native - no Proxmox) I can attest to the issues of USB drives because I get USB disconnects and TrueNAS hangs. My own experience was that the internal USB port was much much less reliable than an external one.

HOWEVER, if you are using Proxmox on a system that is so constrained on ports that you are using a USB drive to boot TrueNAS, I suspect that it isn’t going to be suitable for virtualising ZFS in other ways. If you have SATA drives dedicated to TrueNAS, did you pass through the SATA controller(s) / HBA(s) (and blacklist it/them)?

Thanks for your reply, I’m sorry for not describing it clearly. I use Truenas scale 25.04 and Truenas is not a virtual machine of Proxmox but a native system. The instances means truenas instances: Instances | TrueNAS Documentation Hub

The moment you pass the USB controller to your instance it goes to that instance exclusively, so TrueNAS loses access to all USB connected (via that particular controller) devices.

Thanks for your reply, so the best way is to add a single USB device instead of passthrough USB controller, right?

So you are trying to use the USB drive as a boot drive for a virtual machine running under TrueNAS rather than a boot drive for TrueNAS itself?

The best way is NOT to use USB drives.

Why don’t you start by explaining what you are trying to achieve e.g. run a Linux VM and what you are trying to use it for (e.g. running some application) and we can advise on how you should configure storage for the VM.

USB drive is a boot drive for TrueNAS rather than as a boot drive for a virtual machine running under TrueNAS.But I passthrougt usb to vm

I want to flash Nvidia Jetson Orin NX in vm, so I need to connect Jetson Orin NX to the virtual machine via USB. So I passthrough the USB controller for ubuntu vm

Then, whilst I have no idea whether this is possible, it would seem that you need to have a virtual USB controller and pass through your Nvidia Jetson Orin NX USB device to the VM.

1 Like

That said, using a VM under TrueNAS to flash a Jetson Orin NX seems weird to me.

Wouldn’t you be better off using a workstation for this?

Yes, it is true, but I didn’t have a suitable workstation to do this job at the time, so I used a vm instance on TrueNAS. So from the current point of view, we still need to avoid passthrough the USB controller to the VM when we use the USB drive as the boot driver, right?

Correct. If that flashing stuff will work with only a single device passed to the VM I have no idea.

1 Like

OK, thank you for your reply. I suggest that this point should be mentioned in the usage documentation(Instances | TrueNAS Documentation Hub) to prevent someone from passthroughing the USB controller to the VM without knowing it. Because once this happens, the only solution is to rebuild the TrueNAS system, which will be very troublesome if there is no system backup.

In my case, my instances config storage in app pool rather than boot pool, so even if I reinstalled truenas on the usb ssd, the system would still hang. I eventually fixed the issue by installing truenas on my m.2 ssd, deleting the instance config on the app storage pool, and reinstalling truenas on the usb ssd, then restoring the system using a system backup.

Thanks for the suggestion, but considering that the TrueNAS installer itself warns against installing to a USB boot drive, you’re already in an unsupported configuration. It isn’t realistically possible for the documentation to cover every way you might shoot yourself in the foot if you happened to have done something you had already been warned against earlier.

@DjP-iX Absolutely. If you decide to go off piste you need to rely on your own knowledge and skills and not expect iX to bail you out.