Giter Club home page Giter Club logo

nbd's Introduction

nbd

'nbd' is a Haskell library to implement NBD (Network Block Device) servers. This can be used to implement block-devices in userspace using the Haskell programming language, using the Conduit library.

Demo

A very simple demonstration server is included in this repository, see bin/server.hs. The server can export multiple files (all as a different device), and currently only supports read-only access.

To test, build the library and binary using cabal, then run something like:

$ dd if=/dev/urandom of=blocks bs=1024 count=65536
$ md5sum blocks
7604d00d72b9b8f8cb10e709a1ac3075  blocks
$ ./dist/build/nbd-demo-server/nbd-demo-server blocks

Now in another shell, as root:

# modprobe nbd
# # Connect to the server, creating /dev/nbd0
# nbd-client localhost /dev/nbd0 -N blocks
Negotiation: ..size = 64MB
bs=1024, sz=67108864 bytes
# # Read the data and validate the hash
# dd if=/dev/nbd0 bs=4096 | md5sum
16384+0 records in
16384+0 records out
67108864 bytes (67 MB) copied, 0.265507 s, 253 MB/s
7604d00d72b9b8f8cb10e709a1ac3075  -
# # Disconnect /dev/nbd0
# nbd-client -d /dev/nbd0
Disconnecting: que, disconnect, sock, done

nbd's People

Contributors

nicolast avatar

Stargazers

 avatar  avatar

Watchers

 avatar James Cloos avatar  avatar  avatar

nbd's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.