Connect USB storage device to 2 computers at a time

15

4

I'd like to connect an USB storage device to 2 computers at the same time (With a cable, not over the network). Is this possible?

Context: I want my Raspberry Pi to save output on an external USB-storage, and then be able to read the output on a Windows XP PC.

stommestack

Posted 2013-06-07T12:12:37.983

Reputation: 411

@kruug Storage that can be accessed from multiple machines in parallel is usually used with a http://en.wikipedia.org/wiki/Clustered_file_system. E.g. GFS or Lustre. I think all implementations require a communication channel separate from the storage itself, (usually IP over ethernet) for the hosts coordinate who's going to write where. Anyway, I doubt there are any multiple-writer USB storage devices, so this doesn't help :/ Clearly your Raspberry Pi is in need of Fibre Channel :P

– Peter Cordes – 2015-03-28T07:41:03.807

3You'll need to explain precisely what you expect to accomplish to get a useful answer. – David Schwartz – 2013-06-07T12:14:19.970

Try a google search for "usb sharing" – Dave – 2013-06-07T12:30:19.797

1As @Ramhound stated, you can't have both computers access the USB Resource at the same time. For example, a USB hard drive can only be mounted on one computer at a time. A printer can only be available to one computer at a time. If you want/need access from both computers, you would have to set up a network share to do so. – Kruug – 2013-06-07T14:35:04.770

you could stick the usb device into a computer, like a mini or pico or nano itx then access it remotely. Make the computer as small as possible! – barlop – 2013-09-20T13:24:48.470

@barlop - What you describe is a network solution. The author specifically says this isn't an acceptable solution. – Ramhound – 2013-09-20T13:28:39.967

Answers

10

Something like the following is the best you can hope for.

enter image description here

  • Easily share access to USB devices between two computers
  • LED lights indicate which computer has access
  • Gain instant access to your USB devices by plugging one USB cable into your computer
  • Simply press a button to switch individual USB devices from one computer to another
  • Both computers have direct access to the printer thanks to Automatic Printer Sharing
  • Plug and play set up and easy to use with no network required

Since we don't really do product suggestions here at Superuser here is a single Example of the device described. There are others that'll work similarly to this single example. You will be unable to share a USB device with multiple computers at the same time.

Like the Serial devices that came before Universal Serial Bus devices. USB devices are not designed to be accessed by multiple hosts at the sametime. Its the same reason you cannot share a USB device with a VMWare Guest Operating System and the Host System at the sametime and have to disconnect/connect the device.

Ramhound

Posted 2013-06-07T12:12:37.983

Reputation: 28 517

If you are going to issue a downvote I would appreciate if you would provide feedback on the reason before doing so. – Ramhound – 2015-04-01T10:49:40.680

I'd like to add, you'd still need to unmount the USB device from one host, then mount on the other host. This helps with the cable swap, doesn't quite do what (I think) the OP is asking for. Not a deficiency of this answer: I don't think any device can do what the OP wants. – Rich Homolka – 2013-06-07T16:33:38.807

3-1 If you are going to comment "I didn't say this device could do exactly what the author wants" and if you really think it doesn't do exactly what he wants, then you should have said that in your answer. And not in a response to a criticism, where you suggest you already were aware of that and you just didn't say. – barlop – 2013-09-20T13:21:32.240

@Ramhound Rich filled a gap with his great comment,that u have to unmount n mount each time you want to use it on the other computer. If you agree and you knew that then you should have said that in your answer.It's much clearer than your first line about "hope" and your other line(which is unspecific) about not being able to share at the same time. ('cos that leaves open the possibility that they might share it in a concurrent but not simultaneous way so a task on CompA and task on CompB could happen during the same time period but with execution switching between them). – barlop – 2013-09-20T23:13:58.003

I'd note though, regarding @RichHomolka 's comment. There is an option in windows with usb drives, where you don't have to manually mount/unmount them, you officially pull them out safely.. (though i suppose i wouldn't try it if it was writing!). You wouldn't need to dismoutn the drive. And with this switch type device, the mounting is automatic. So there'd be no manual mount or dismount if using that windows option. – barlop – 2013-09-20T23:22:49.720

I have removed my downvote. – barlop – 2013-09-20T23:41:20.207

1

Software people won't like it but from a hardware perspective there is no reason two systems cannot have access to the same storage. If one only writes and one only reads there is no issue except trying to read from a file not yet complete. I am sure that can be resolved by simply waiting a prescribed amount of time before trying to read the file. If both systems want to read and write a simple semaphore can be created using files.

This would be a safe way to transfer data between systems. Unless the systems execute the files viruses on one system could not infect the other system. The infected file would be present but it would just be a file.

I have considered designing such a device myself but never seem to have the time. A development board with two USB slave ports (B) and one USB host port (A) could do it. Just pass all commands arriving on either slave port to the host port. Plug a USB drive or thumb drive into the host port. It wouldn't be quite that simple but that would be a starting point.

Scott Taylor

Posted 2013-06-07T12:12:37.983

Reputation: 11

0

I haven't used one before, but you could possibly use a USB-USB bridge to let a second computer access files on the first, which would also include any USB attached storage on the first.

LawrenceC

Posted 2013-06-07T12:12:37.983

Reputation: 63 487

Doesn't look like it supports Linux. – stommestack – 2013-06-07T15:28:25.527

There's more out there than that example I believe. I don't know of any specific brands but there has got to be a USB-USB bridge that acts like an Ethernet cable. and then you could just NFS or SMB the files over the usb0 interface on both sides. Alternatively if both systems have a serial port you could connect a null modem cable, set up ppp, and file share over that, but it'd be slow. If both systems have a Firewire port you could try that as well. That supports point-to-point PC connections if I'm not mistaken. – LawrenceC – 2013-06-07T15:46:14.480