in reply to Re^2: imitation block device in linux
in thread imitation block device in linux

Basically, you write a network server implementing the NBD protocol and then use nbd-client to connect and link it to some nbd device.

There is little documentation about the NBD protocol, you will have to read the C source code for the nbd-server program. It is a very simple protocol. After some simple handshaking, there are only two kind of messages you have to support: read and write.

Another option would be to write a custom nbd-client able to fork and run the server through an anonymous socket (think socketpair).