1
\$\begingroup\$

Since SATA has made it possible to do all data interfacing to a drive through 4 wires, what I'd like to do is physically route two SATA ports to two drives, through a switch that simply swaps them. This way (for example) the one I want to boot from becomes SATA-0 and the other becomes SATA-1.

For background, many times I've wanted to be able to boot from one of two hard drives on a desktop PC, WHILE keeping both drives accessible to whichever drive I boot from. Often the purpose is to have a choice of operating systems, and to have all the time I need to migrate from one OS to another, while always having the data on both drives available. I'm fully aware of many dual boot schemes available in some system bios, and of course I know i can always open up my machine and manually swap SATA cables. There are all kinds of solutions other than what I'm asking about, but for now I want to explore this purely electrical/mechanical drive swapping idea.

I realize that swapping two SATA drives would take an 8PDT switch, which might be hard to come by, but I could do it with two 4PDT switches ganged together mechanically, or I could do it with several miniature signal relays, such as those made by OMRON. It certainly would be a universal solution, unbounded by bios limitations and a lot less prone to software "Murphy" problems. But my critical concern that has made me hesitate in designing such a mechanism is that the signals going over an SATA wire are pretty damn fast (I think 5-6 gigabit,a according to wikapedia.

How can I implement an electrical circuit to switch between two SATA ports?

\$\endgroup\$
13
  • 1
    \$\begingroup\$ Theoretically it should be possible. I suspect it would be economically infeasible, though. Do they make relays that are coaxial all the way through? \$\endgroup\$
    – Hearth
    May 7, 2017 at 2:18
  • 2
    \$\begingroup\$ you would need controlled impedance tracks, connector, switches, this isn't audio \$\endgroup\$ May 7, 2017 at 2:41
  • 2
    \$\begingroup\$ drive assignments aren't based on wiring anymore; all the boot selection happens in bios w/o moving parts. that said, you can kill the power to the one you don't want to use for a given session, and it won't autodetect on power-up... \$\endgroup\$
    – dandavis
    May 7, 2017 at 2:51
  • 4
    \$\begingroup\$ While mechanically switching is not appropriate, mostly for SI reasons, there are numerous electronic SATA/SAS switches (typically redrivers, as well). For example, MAX4986. However, I second dandavis' suggestion of controlling power, rather than trying to mux the data lines. \$\endgroup\$
    – uint128_t
    May 7, 2017 at 4:43
  • 3
    \$\begingroup\$ @Randy you specifically asked for an opinion, the moderation system has a button to close opinion based questions. A better question would be to do some research and ask a question like "How could I implement a circuit to switch a sata port?" \$\endgroup\$
    – Voltage Spike
    May 8, 2017 at 6:33

1 Answer 1

8
\$\begingroup\$

With a mechanical switch or relay? No, that will absolutely not work.

internals of a SATA cable, from Wikipedia

Here's what a SATA cable looks like internally. The shiny bare wires at the top and bottom, and in the middle, are drain (ground) wires; the copper wires in between those are what carry the signal. As you can see in the picture, they're embedded in a dielectric material. This is to maintain a consistent impedance, which is critical for signal integrity at 6 Gbit/sec.

Bringing those signal wires out of the cable to a mechanical switch will ruin the electrical properties of the connection, and is likely to either prevent the drive from being identified at all, or cause a large number of link errors. If you need to switch a SATA signal, you will need to use an IC specifically designed for this task.

\$\endgroup\$
5
  • \$\begingroup\$ even -1dB/octave @ 100MHz from the slope would be enough to cause ISI and signal corruption on signals at 50Mb/s rates. \$\endgroup\$ May 7, 2017 at 13:11
  • \$\begingroup\$ Thanks.@duskwuff. As you can probably tell, I'd like to try this even if beating the odds is unlikely. What about relays? I linked the wrong OMRON relay in my previous comment, but this one is actually rated for 8Ghz. Now with relays like that, would you agree in principal that a correctly done PC layout would have a chance? Perhaps to better mimic an SATA cable, I'd use a 4 layer board of a thickness that that would allow for two ground (or in this case shield) planes. omron.com/ecb/products/pry/113/g6k_2f_rf_v.html \$\endgroup\$
    – Randy
    May 7, 2017 at 14:20
  • \$\begingroup\$ @ Tony Stewart. EE since '75 -- understood. But as you know, sometimes there are tricks we can use to make a "slightly" less than perfect "transmission line" behave better. Consider, for example, in the early days of working with DRAM chips, getting the RAS and CAS strobes to carry and remain synchronized through less than ideal PC runs. The simple addition of some low value damping resistors often worked wonders. I'm not minimizing the opportunities for failure, but in addition to pointing out the many ways this could go wrong, any suggestions toward success would be welcome too! ;-) \$\endgroup\$
    – Randy
    May 7, 2017 at 14:36
  • 1
    \$\begingroup\$ @Randy In principle? Maybe. But those relays cost $50-60 each, and you'd need two of them for a single SATA link… \$\endgroup\$
    – user39382
    May 8, 2017 at 6:53
  • \$\begingroup\$ @duskwuff - Good point. I'd need 4 of those to do a complete swap, and that would be a pricey experiment, not to mention cutting the PC board. Perhaps the special purpose IC is the only practical solution. I believe @– uint128_t recommended MAX4986 as a possible choice. \$\endgroup\$
    – Randy
    May 9, 2017 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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