Can you pass SATA drives to jail/vm?

metaleggman

Cadet
Joined
Jan 5, 2022
Messages
8
Hi,

In the past I've been using a USB sata dock and windows software to recover old, suspect hard drives, mainly ones I've found around the house, from old computers, or ones I've shucked from old external USB hdds. I've since learned using something like ddrescue or hddsuperclone would be a much better option. However, hooking up sata drives directly to my desktop motherboard, and having it run a linux environment for this purpose would interrupt my work flow.

So I'm wondering if TrueNAS Core 12 could work for this purpose. I have an older xeon/supermicro combo (I think an E5 v1 and an X9 board) setup with some drives to work as my home NAS. The NAS is far more accessible physically than my Desktop (I have my desktop attached to the underside of my sit-stand desk). I was essentially wondering, if I hook up the drive directly to the motherboard's sata ports or to a proper HBA in IT mode (I'm soon running out out of on-board SATA), would I be able to access the drive successfully to a jail or VM capable of running either program (a jail, as I believe ddrescue has a freebsd version, and a VM for running Linux and using either program on there)? I believe the programs need some sort of low-level access to the drives to work properly.

This might be a trivial question, but I haven't seen anyone ask this. Being able to use my truenas server to backup old hard drives to my ZFS pools would be incredibly helpful, as a windows/USB combo isn't always adequate. I'm not sure if this quite counts as "pass-through" or not, I just want TrueNAS to give proper access to the physical drives in question to the jail or VM so the programs can do their job properly. If this would require some sort of additional hardware (say an HBA card used solely for this and only this), that's fine as I haven't populated any PCIe slots yet.

Thanks in advance.
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
A Jail is part of the host OS - so presumably has direct access.
VM's in Core are bhyve so access will be through a layer of virtualisation - anyway bhyve is crap.

However - just attach the disk and look in storage/disks for a non pool disk - then (for example) badblocks it. Use onboard SATA or HBA - it don't matter (as long as it is an HBA). I think you are overthinking this.
 

metaleggman

Cadet
Joined
Jan 5, 2022
Messages
8
A Jail is part of the host OS - so presumably has direct access.
VM's in Core are bhyve so access will be through a layer of virtualisation - anyway bhyve is crap.

However - just attach the disk and look in storage/disks for a non pool disk - then (for example) badblocks it. Use onboard SATA or HBA - it don't matter (as long as it is an HBA). I think you are overthinking this.
Alright, sounds like it should be simple enough to just use Ddrescue in a jail then. Thanks.
 
Top