13

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.

  • 3
    You'll need to explain precisely what you expect to accomplish to get a useful answer. – David Schwartz Jun 7 '13 at 12:14
  • Try a google search for "usb sharing" – Dave Jun 7 '13 at 12:30
  • 1
    As @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 Jun 7 '13 at 14:35
  • 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 Sep 20 '13 at 13:24
  • @barlop - What you describe is a network solution. The author specifically says this isn't an acceptable solution. – Ramhound Sep 20 '13 at 13:28
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.

  • 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 Jun 7 '13 at 16:33
  • 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 Sep 20 '13 at 13:21
  • @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 Sep 20 '13 at 23:13
  • 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 Sep 20 '13 at 23:22
  • I have removed my downvote. – barlop Sep 20 '13 at 23:41
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.

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.

  • Doesn't look like it supports Linux. – stommestack Jun 7 '13 at 15:28
  • 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 Jun 7 '13 at 15:46
0

Thats so simple -if you know a little bit soldering- first get one female usb socket then get two usb cable solder two cables GND,DATA+,DATA- pins together solder 2 piece diodes for 2 cables + pin then connect flash drive to female socket and connect 2 cables to 2 pc NOTE 1 : why we use diode , because we didnt want burn anything NOTE 2 : NEVER OVERLOAD FLASH DRIVE IN THIS MODE

  • 2
    This would be slightly less concerning with some kind of diagram. – Nattgew May 8 '14 at 17:12
  • 2
    Have you actually tried this? The problem is the USB protocol, not the cables. Both PCs would see responses from the device to the other PC, so it won't work. Maybe for simple devices like keyboards it could work, but I don't think so... – Marki555 Sep 5 '14 at 7:08
  • im going to try it.. will report findings – Dan Bradbury Dec 14 '18 at 23:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.