Is there any way to run an NBD (Network Block Device) client and server on the same machine without deadlocking the system?
I am very exhausted looking to find an answer for this. I appreciate if anyone can help.
UPDATE:
I’m writing an NBD server that talks to Google Storage system. I want to mount a file system on the NBD and backup my files. I will be hugely disappointed if I have to end up running the server on another machine. Few ideas I already had seem to lead nowhere:
- telling the file system to open the block device using O_DIRECT flag to bypass the linux buffer cache
- using a raw device (unfortunately, raw devices are character devices and FSes refuse to use them as underlying device)
Use a virtual machine (not a container) – you need two kernels, but you don’t need two physical machines.