No USB device as data/backup storage? (And hot plugging)

Status
Not open for further replies.

Argentic

Dabbler
Joined
Nov 20, 2015
Messages
19
I've read several times, that you shouldn't use USB device with FreeNAS (directly attached, besides the Boot-Stick).

Like:
Don't use USB attached anything, (flash, or spinning), for long term attached storage. SATA, eSATA or SAS is best.
USB is the problem, or rather, the lack of XHCI support and the craptastic quality of your average USB/SATA bridge.

Why is that? Did FreeBSD a poor job? Or FreeNAS? Or is it complicated, because of ...? Is there a bug report regarding this? Or is it simply (for the experts) a dead connection and they don't care for it?

And even more interesting, what are the occurring problems?
Are there just problems when connecting it, so it doesn't work always on the first try, but when it does it runs?
Or does it randomly loose the connection?
Basically I'm trying to understand it and evaluating, if an USB-HDD is reliable (enough?) for a backup via local data replication. Or if I need to find another solution. (See this thread).

What about hot plugging and USB?
According to this member even with eSATA you shouldn't do that ...
Just a work of advice... Do not hot plug the eSATA drive. Shut down your system, connect the drive, power up your system, import your pool, do your backup, export your pool, shut down, disconnect the drive, and power your system back up. If you try to do things otherwise, well you risk data loss.
Your advice and experiences with eSATA?

For both problems (USB reliability and hot plugging with both connections):
Are this issues across the board or do they depend on the system? Could I (extensively) test my system if it will work correctly or see it by the used hardware?
If so, how?
 
Last edited:

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,972
Your advice and experiences with eSATA?
My experience on this forum since FreeNAS (iXSystems version) has been created. I'm not saying a person cannot make hot plugging work, of course it will work but too many people (home users especially) make mistakes and it costs them their data. My advice is, if you can shut down the NAS to connect and disconnect external storage, do it. I personally do shut down my NAS when I need to do anything with a hard drive, with one exception, when I attach a USB external hard drive and import data into my pool. I have only done that a few times but then again FreeNAS is designed to work that way. This USB drive is not a ZFS formatted drive either.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,176
Let's see:
  • USB itself is just like any other interface. USB 2.0 is slow and 100% host-initiated, which makes it even slower. It's also half-duplex.
  • USB 3.0 improves things a lot, but the new unified USB driver that introduces support for USB 3.0 and later (and can replace older drivers for USB 2.0 and older), XHCI, is not very stable in FreeBSD 9.3. In fact, it crashes with the Lynx Point PCH (which makes up probably 30%-50% of the USB 3.0 market at the moment). Therefore, it is disabled by default.
  • USB/SATA bridges are almost universally enormous pieces of shit. The additional layer of abstraction that allows an ATA device to be seen by the OS as an USB Mass Storage Device doesn't help, either, but at least SMART is supported by most USB/SATA bridges, so the biggest issue isn't too much of a problem.
  • USB has zero issues with hot-plugging. It was designed for it. Of course, this doesn't mean you don't have to be careful with what you do, since the software is probably doing things (that's its job).
  • eSATA really is like SATA in every way. It'll work exactly like SATA. However, you're almost always limited to 1m cabling, total - like regular SATA.
Also, sidenote:

DO NOT EVER TRY TO HOT PLUG A SATA DRIVE USING A CONNECTOR NOT EXPLICITLY DESIGNED FOR IT

That means, in practice, that the only safe way to hot plug a SATA device is with external power, as in eSATA, or with a proper backplane. Note that Lian-Li makes some backplanes which do not support hot plugging, since they do not include capacitors to handle the transient caused by the drive being connected. Most PSUs simply cannot compensate for the transient quickly enough and the voltage will sag, possibly taking several drives along with it. Backplanes must have all pins except the hot-plug pins recessed into the connector (these pins make contact with the drive's power circuitry through high-value resistors which limit inrush current), to allow the drive's capacitors to load up a bit and they have to provide capacitors to further manage inrush current to the backplane.

Edit: I should've mentioned that USB hard drives are actually treated as SCSI devices. So:
An (S)ATA device is being presented as a USB Mass Storage Class Device, which the driver presents to the OS as a SCSI device.
 
Last edited:

Argentic

Dabbler
Joined
Nov 20, 2015
Messages
19
My Mainboard (ASUS P9D-V) uses the Intel C224 which is a Lynx Point PCH. This means I shouldn't even try to enable USB3.0, because it is (at this state) guaranteed to crash?
That's why it shows something with 40.000 speed when connecting a USB3.0, because it falls back to USB2.0.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,176
My Mainboard (ASUS P9D-V) uses the Intel C224 which is a Lynx Point PCH. This means I shouldn't even try to enable USB3.0, because it is (at this state) guaranteed to crash?
Yeah, on FreeNAS 9.3 at least.
 

Argentic

Dabbler
Joined
Nov 20, 2015
Messages
19
  • eSATA really is like SATA in every way. It'll work exactly like SATA. However, you're almost always limited to 1m cabling, total - like regular SATA.
Ok, eSATA acts like SATA. What does that mean for hot plugging in your opinion?
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
Ok, eSATA acts like SATA. What does that mean for hot plugging in your opinion?
If your hardware supports hot-plugging, you should be able to hot-plug using eSATA, but you still have to 'do it right'. This means, for example, detaching any ZFS pool on a device you're about to unplug, to ensure that it's in a consistent state.
 
Status
Not open for further replies.
Top