{"id":13409216,"url":"https://github.com/dividuum/fdb-nbd","last_synced_at":"2025-03-14T14:31:04.134Z","repository":{"id":142892519,"uuid":"131432759","full_name":"dividuum/fdb-nbd","owner":"dividuum","description":"A totally proof-of-concept FoundationDB based network block device backend","archived":false,"fork":false,"pushed_at":"2018-04-30T08:23:58.000Z","size":11,"stargazers_count":116,"open_issues_count":0,"forks_count":7,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-07-31T20:35:18.554Z","etag":null,"topics":["foundationdb","nbd","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dividuum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-04-28T18:07:06.000Z","updated_at":"2024-01-04T16:22:41.000Z","dependencies_parsed_at":"2023-04-03T15:47:15.666Z","dependency_job_id":null,"html_url":"https://github.com/dividuum/fdb-nbd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dividuum%2Ffdb-nbd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dividuum%2Ffdb-nbd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dividuum%2Ffdb-nbd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dividuum%2Ffdb-nbd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dividuum","download_url":"https://codeload.github.com/dividuum/fdb-nbd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243593313,"owners_count":20316165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["foundationdb","nbd","python"],"created_at":"2024-07-30T20:00:58.939Z","updated_at":"2025-03-14T14:31:03.811Z","avatar_url":"https://github.com/dividuum.png","language":"Python","readme":"# A totally proof-of-concept FoundationDB based NBD backend\n\nI wanted to play around with [FoundationDB](https://www.foundationdb.org/) a bit more and\nbuilding a [network block device (NBD)](https://nbd.sourceforge.io/) backend seemed like\na good fit for that.\n\n**Do not use this in production**, unless you like data loss, kernel crashes and you don't\nmind if your house burns down.\n\nIf you're interested in a more serious implementation, have a look at https://github.com/spullara/nbd.\n\n## Installation\n\n * Install [FoundationDB](https://apple.github.io/foundationdb/local-dev.html).\n * Run `fdb-nbd.py`. It will start a local TCP server on port 10809 (default NBD port).\n * Load the `nbd` kernel module.\n * Run `nbd-client -N example 127.0.0.1 /dev/nbd0`. This will initialize the network block device `/dev/nbd0` and point it to the started python server.\n * You might now format `/dev/nbd0` with any filesystem and mount it.\n\n## Cleaning up\n\n * Unmount your filesystem\n * Run `nbd-client -d /dev/nbd0` to disconnect the block device from the server\n\n## Worth noting\n\n * The server can handle multiple block device \"stores\" at once. In the above example, `example` got selected with the `-N` argument of `nbd-client`. Have a look at the source code of `fdb-nbd.py` to see how this is initialized.\n * You can list all other available \"stores\" with `nbd-client -l 127.0.0.1`\n * The server is hardcoded to use a blocksize of `1024`. Each block is stored in its own FoundationDB key `('dev', 'example', 'blocks', block_nr)`. Partial reads or writes of blocks are not supported.\n * Since it's possible, I just compress/decompress each key before set/get. Yay.\n * It's interesting to see how block device caching works. File system actions often don't directly cause block device operations. Play around with `sync` and flushing the cache `echo 3 \u003e /proc/sys/vm/drop_caches` for maximum effect.\n * Don't suddenly stop the server or disconnect with `nbd-client`. The kernel can be a bit sensitive about this. I've had unkillable processes as a result and a kernel OOPS. You have been warned.\n * Performance isn't too good, at least in my tests. It's around 10MB/s or so with a locally running FoundationDB. But hey: It works :-)\n","funding_links":[],"categories":["Layers","Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdividuum%2Ffdb-nbd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdividuum%2Ffdb-nbd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdividuum%2Ffdb-nbd/lists"}