{"id":16876477,"url":"https://github.com/raphaelsc/blockv","last_synced_at":"2025-04-11T17:15:26.024Z","repository":{"id":150403472,"uuid":"51190299","full_name":"raphaelsc/blockv","owner":"raphaelsc","description":"Export block devices and access them using FUSE.","archived":false,"fork":false,"pushed_at":"2016-02-22T06:32:24.000Z","size":54,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T13:11:19.248Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raphaelsc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-06T05:04:38.000Z","updated_at":"2023-03-23T02:55:33.000Z","dependencies_parsed_at":"2023-05-06T06:55:21.340Z","dependency_job_id":null,"html_url":"https://github.com/raphaelsc/blockv","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/raphaelsc%2Fblockv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsc%2Fblockv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsc%2Fblockv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsc%2Fblockv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphaelsc","download_url":"https://codeload.github.com/raphaelsc/blockv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248447595,"owners_count":21105140,"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":[],"created_at":"2024-10-13T15:39:32.371Z","updated_at":"2025-04-11T17:15:25.971Z","avatar_url":"https://github.com/raphaelsc.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"#BlockV\n\n##Introduction\n\nblockv project is composed of blockv server and blockv FUSE (client).\nblockv server is used to export a block device to the outside world. blockv FUSE is used to import a block device exported by a blockv server.\n\nWith blockv project, it's easy to mount locally a file system stored in a block device of a remote computer.\n\nWith blockv FUSE, it's easy to keep access to a large number of block devices that are exported by respective blockv servers.\n\nThis project is based on the concept of network block device. For further information:\nhttps://en.wikipedia.org/wiki/Network_block_device\n\n##Getting started\n\nCompile full project with:\n```\ng++ --std=c++14 `pkg-config fuse --cflags --libs` blockv_fuse.cc -o blockv_fuse;\ng++ --std=c++14 blockv_server.cc -o blockv_server -lpthread;\n```\n\nThere is no makefile because I am lazy, but I will write one as soon as possible.\n\n\n##Playing with network-based block device\nAt this section, you will learn how to export a file system to the outside world and import it from another machine.\n\n\n#### Server side\n\n1) Compile project for server side:\n```\ng++ --std=c++14 blockv_server.cc -o blockv_server -lpthread;\n```\n\n2) Create a pseudo block device that will be exported to the network:\n```\nqemu-img create -f raw -o size=500M ./pseudo_block_device.raw;\n```\n\n3) Format pseudo block device with a file system:\n```\nmkfs.ext2 ./pseudo_block_device.raw;\nmkdir ./mount_point;\nsudo mount -t ext2 ./pseudo_block_device.raw ./mount_point;\nsudo umount ./mount_point;\n\nNOTE: copy all files you want to share to the folder ./mount_point.\n```\n\n4) Export pseudo block device by running blockv server as follow:\n```\n./blockv_server ./pseudo_block_device.raw;\n```\n\nRead-only mode (write request is disallowed):\n```\n./blockv_server ./pseudo_block_device.raw --read-only;\n```\n\n\n#### Client side\n\n1) Compile project for client side:\n```\ng++ --std=c++14 `pkg-config fuse --cflags --libs` blockv_fuse.cc -o blockv_fuse;\n```\n\n2) Mount blockv:\n```\nmkdir ./blockv_mount_point;\n./blockv_fuse -d ./blockv_mount_point -o allow_root;\n\nNOTE: *allow_root* option requires adding *user_allow_other* to */etc/fuse.conf*\n```\n\n3) Import the remote block device exported by blockv server:\n```\nln -s localhost:22000 ./blockv_mount_point/remote_block_device;\n\nNOTE: Replace localhost and 22000 by server ip and port, respectively.\n```\n\nIt's possible to see the ip and port associated with a remote block device, look:\n```\n$ ls -l ./blockv_mount_point/remote_block_device;\nlr--r--r--. 1 root root 524288000 Dec 31  1969 ./blockv_mount_point/remote_block_device -\u003e localhost:22000\n```\n\n4) Mount the imported block device:\n```\nmkdir ./mount_point_for_remote_file_system;\nsudo mount -t ext2 -o loop ./blockv_mount_point/remote_block_device ./mount_point_for_remote_file_system;\n```\n\nAt this point, you can fully use the file system stored in the remote block device.\n\n\n##Playing with memory-based block device\n\n1) Mount blockv:\n```\nmkdir ./blockv_mount_point;\n./blockv_fuse -d ./blockv_mount_point -o allow_root;\n\nNOTE: *allow_root* option requires adding *user_allow_other* to */etc/fuse.conf*\n```\n\n2) Create a memory-based block device of 30MB:\n```\ntruncate -s 30M ./blockv_mount_point/virtual_block_device;\n```\n\n3) Format the memory-based block device with ext2 file system:\n```\nmkfs.ext2 ./blockv_mount_point/virtual_block_device;\n```\next2 filesystem was chosen arbitrarily. Any other file system supported by Linux should work as fine.\n\n4) Mount the ext2 filesystem with:\n```\nmkdir ./mount_point2;\nsudo mount -t ext2 -o loop ./blockv_mount_point/virtual_block_device ./mount_point2;\n```\n\nAt this point, you can fully use the file system stored in the memory-based block device.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsc%2Fblockv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphaelsc%2Fblockv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsc%2Fblockv/lists"}