(if you need more than one NBD device, repeat the above command for nb1,
nb2, ...)
+Since there's a problem with nbd and the (default) cfq I/O scheduler,
+you may want to set it to deadline:
+
+echo 'deadline' > /sys/block/nbd0/queue/scheduler
+
+(again, repeat the above for nbd1, nbd2, etc, if you need more than one
+device)
+
Next, start the server. You can use a file or a block device for that:
nbd-server <port> <filename>
readonly = false
multifile = false
copyonwrite = false
+ prerun = dd if=/dev/zero of=%s bs=1k count=500
+ postrun = rm -f %s
[otherexport]
exportname = /export/nbd/experiment
port = 12346
If, while your kblockd is emptying the NBD buffer cache, the kernel
decides that the cache of the block device your nbd-server is writing to
needs to be emptied, then you've got a deadlock.
+
+A kernel patch exists[2] to create a separate kernel thread for NBD
+writes which woul fix this problem; however, it has not made it into
+mainline yet.