I have Raspberry Pi setup as NAS. The storage is external HDD powered through USB. I would like to encase this whole thing in some nice box and still be able to easily use the HDD, without disassembling the whole thing.
My idea is following:
The USB A would be connected to the external HDD and USB B would be just USB extension cord accessible from the outside. The box with question marks would be toggle switch controllable through GPIO header.
My idea how to wire the whole thing in the easiest way is sketched in following diagram (the switches represent USBs):
I'm not sure if it's ok, just to switch the power rail between the two outlets.
So far I have following ideas how to implement that:
Is my idea sensible? Do you know any ready made solution? Do you know how to solve this?