Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NBD client and server on same machine

Tags:

deadlock

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)
like image 807
Mansour Avatar asked Dec 30 '25 09:12

Mansour


1 Answers

Just for the record, having the NBD client and server on the same machine has been possible since 2008.

like image 51
Remy Blank Avatar answered Jan 02 '26 04:01

Remy Blank



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!