0

What I would like to do is to divide a hard drive into partitions, and connect my PC to other devices. While connected, I want the other device to recognize a partition of the hard drive as if it were simply an external hard drive. Optimally, I could have multiple partitions and select which one the device accesses from the PC.

This question is for educational purposes only. I'm not trying to accomplish anything in particular.

4
  • What sort of devices - SCPI/VISA type or USB or serial or parallel?
    – cup
    Commented Apr 5 at 3:32
  • 1
    @cup - What are SCPI and VISA? I confess that I doubt serial or parallel would make a difference.
    – davidgo
    Commented Apr 5 at 3:36
  • They are protocols for oscilloscopes, logic analyzers etc. They can dump images to your PC. Basically what sort of devices are you connecting that need to see particular partitions?
    – cup
    Commented Apr 5 at 3:42
  • 1
    @cup I think you may have misunderstood the question. He is just connecting a hard drive. No logic analyzing required.
    – davidgo
    Commented Apr 5 at 4:03

2 Answers 2

1

Yes, this is possible - although there is quite a bit of nuance on what can and can't be done. It is easier to do in Linux than in Windows.

One standardized way of doing this is using the iSCSI protocol. You would need something which can emulate iSCSI on the "file server" and then a driver/mechanism to recognise and use this on the client side. This is probably the most common and "cross platform" way of sharing a block device across an Internet connected system - but there are others.

4
  • Another way to do this is to use NBD (network Block device). This is mainly a Unix thing, but it looks like you can do it under Windows as well - see github.com/cloudbase/wnbd
    – davidgo
    Commented Apr 5 at 3:31
  • I've not explored it at all, but CEPH looks like it can do this as well - docs.ceph.com/en/quincy/rbd/index.html through its RBD - Rados Block Device. Also look at FCoE and ATA over Ethernet.
    – davidgo
    Commented Apr 5 at 3:35
  • I do use Linux at times, so I wouldn't opposed to looking at this from the perspective of Ubuntu or Debian as opposed to windows. Let me use a common example. Let's say the device I need to access the external hard drive is a Nintendo Wii, and say I'm utilizing USB over cat6 to connect a Nintendo Wii to a "server" that is on the opposite side of a building. Could I then utilize these programs so that the Nintendo Wii would only recognize the partition specified by the server as if it were an external hard drive? And would it be possible to accomplish this without modifying the Nintendo Wii? Commented Apr 5 at 14:35
  • I've never used a Wii - but I would be very surprised if it supports this. I dont know what USB over cat6 is - but if it is a mechanism for extending the length of a USB run using additional hardware this could conceptually work - but would not mount a partition. I can conceive of building a hardware solution with an SBC (eg Pi) and usb mass gadget Linux module. This is not a trivial project.
    – davidgo
    Commented Apr 5 at 19:25
0

Speaking of local connections:

  • It is possible to turn some computers into USB 'devices' – although regular USB is asymmetric and most desktop/laptop PCs don't have the hardware that would support that, but some "Pi" nano-computers do have dual-mode USB controllers, and you can find instructions on setting up Linux "gadget mode" so that such a Pi could work like a USB stick.

    I'm not sure about the capabilities of Thunderbolt – I know it can do peer-to-peer connections for transporting Ethernet, but no idea whether it can do that for storage.

  • Older Macs used to have FireWire, which was a symmetric connection (like USB4 and even more so) and did not require any special hardware for a computer to become a 'device'; as a result, many Mac laptops had a hidden "Target Disk Mode" built in. You could hold a certain key while powering it on, and the entire laptop would show up as an external disk across the FireWire cable.

    (Some new Linux distributions have a mode that imitates this by booting directly into an "NVMe-oF target" mode that serves the system disk over Ethernet.)

Such things are more commonly done over the network – although, of course, storage over network requires cooperation from the client as well, but the end result is still that you have a "disk" showing up on the client computer that can be partitioned, formatted, etc.

  • The NVMe-oF and iSCSI protocols are commonly used for network storage (just like regular NVMe and SCSI are used over direct connections).

    Windows XP/10/11 can be an iSCSI client ("initiator"), while Windows Server can also act as an iSCSI server ("target"). It's also common to set up Linux or even Solaris as an iSCSI server; many NAS devices have an iSCSI feature. I've even seen software that makes CD-RW drives available over iSCSI for remote CD burning.

  • Since it all works through client/server cooperation, any number of protocols can be made; e.g. there is also ATA-over-Ethernet (rare, Linux-specific); there is NBD (also Linux-specific); there used to be a MS-DOS program for disk-over-Ethernet access; old SunOS had the 'ND' protocol before NFS was invented; etc.

    All of those were "disk sharing" protocols that made the client pretend it had an external disk, as opposed to file sharing like NFS/SMB.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .