4

I'm used to consider that USB transfers are safe for data, that is USB does not add level of unreliability to data storage.

However, I read that USB is not always a good choice for data transfer concerning its reliability. For instance, It seems that using USB disk in a RAID is not a good idea.

I would like to know if the risk of data loss is specific to the way RAID works, or is intrinsic to every USB transfer.

abitbol
  • 141
  • 1
  • 1
    IMO this question is better suited for [security.se]. – Gerald Schneider Sep 25 '20 at 06:08
  • 1
    USB is a communications protocol. What's relatively safe or unsafe depends more on the storage media, which you didn't specify. – Michael Hampton Sep 25 '20 at 06:15
  • 2
    Could you please specify more details on what RAID and what drives are you planning to use? – Strepsils Sep 25 '20 at 07:37
  • @GeraldSchneider Here I'm not taking about securely transfering data by preserving its confidentiality, but rather i'ma talking about preserving its integrity – abitbol Sep 25 '20 at 10:41
  • @MichaelHampton The question is not about the storage media but on reliability of link between computer and this media. I could put it differently : given a storage media, considering only integrity of data, would it be strictly better to use sata connexion or putting the storage media in a USB dock is as reliable as sata connection. – abitbol Sep 25 '20 at 10:49
  • @Strepsils I don't necessarily plan to use raid. It is just an example stating the fact that many people say it is not same to make RAID with USB disks (for instance with mdadm). What I would like to knows is if this unreliability is only due to RAID structure or if it USB is intrinsically not designed for preserving data integrity. – abitbol Sep 25 '20 at 10:52
  • It's more because people try to do crazy things like make RAID arrays out of thumb drives. Again, the storage media matters more than the communications protocol. – Michael Hampton Sep 25 '20 at 17:00
  • @MichaelHampton Ok but, why, in this case, some software like OpenMediaVault refuse to create RAID array with USB connected disks ? – abitbol Sep 26 '20 at 05:00

1 Answers1

7

USB data path is protected by checksums on the both sides.

https://www.beyondlogic.org/usbnutshell/usb3.shtml

(Watch out CRC field within USB data packet structure)

This is the quote from the original USB specification:

8.3.5 Cyclic Redundancy Checks

On the both ends of USB wire, hardwares (PIC USB peripheral and host controller on PC) check CRC to detect packet error (#1). For Control, Interrupt and Bulk transaction, the occurance of error is shared by both ends by absence (not in time) of handshake (ACK) packet at the transaction (#2). And then, host controller retries the transaction, two times more (error correction). At the third error, host controller reports transfer error to the PC driver (#3). In Isoc transaction, error is detected, but the error handling is upto application over the USB protocol.

You can download full USB 2.0 spec for your reference here:

https://www.usb.org/document-library/usb-20-specification

Hope this helped!

BaronSamedi1958
  • 12,510
  • 1
  • 20
  • 46
  • 1
    Thank you for the answer. Thus in this case, why OpenMediaVault refuse to use USB-connected disks to create RAID array? – abitbol Sep 26 '20 at 05:01
  • 5
    My guess is: Because external disks can be unplugged any moment losing WBC. Either way - ask them :) – BaronSamedi1958 Sep 26 '20 at 13:19