{"id":33216468,"url":"https://github.com/kdave/nullb","last_synced_at":"2025-11-16T13:04:45.428Z","repository":{"id":67987382,"uuid":"379066923","full_name":"kdave/nullb","owner":"kdave","description":"Simple null block device manager script, useful for zoned device testing.","archived":false,"fork":false,"pushed_at":"2023-10-18T21:43:04.000Z","size":53,"stargazers_count":4,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-10-20T03:14:23.512Z","etag":null,"topics":["btrfs","linux"],"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/kdave.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,"governance":null}},"created_at":"2021-06-21T21:26:54.000Z","updated_at":"2023-10-18T22:02:18.000Z","dependencies_parsed_at":"2023-02-21T20:15:25.226Z","dependency_job_id":"33291130-9d42-4b09-8c88-afa11e810e1f","html_url":"https://github.com/kdave/nullb","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"purl":"pkg:github/kdave/nullb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdave%2Fnullb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdave%2Fnullb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdave%2Fnullb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdave%2Fnullb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kdave","download_url":"https://codeload.github.com/kdave/nullb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdave%2Fnullb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284711554,"owners_count":27050948,"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","status":"online","status_checked_at":"2025-11-16T02:00:05.974Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["btrfs","linux"],"created_at":"2025-11-16T13:04:29.978Z","updated_at":"2025-11-16T13:04:45.418Z","avatar_url":"https://github.com/kdave.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nullb\n\nSimple null block device manager script, useful for zoned device testing. The\ndevices are managed by configfs files, this script wraps the basic operations\nfor convenience.  The null block device is usually memory-backed so the\ncapacity is limited but it should be sufficient to create 1GiB or 2GiB devices.\nThe benefit is flexible zone size that could be otherwise unavailable with\nother types of device.\n\nRequirements:\n- nullb\\_blk loadable kernel module\n- configfs either as loadable module or built-in\n\nThe script follows common command line interface when there are multiple\nsubcommands provided by one script. Currently there is:\n\n* **nullb setup** - load required modules and mount configfs\n* **nullb create [-s sizeMB] [-z zonesizeMB] [-c zonecapacityMB]** - create a\n  new device with given sizes, allocating the first free indes, device is\n  /dev/nullb$index\n* **nullb ls**\n* **nullb list** - show table of created null\\_blk devices, size and zone sizes\n* **nullb rm NAME**\n* **nullb delete NAME** - delete existing null\\_blk device by name, must match the device node name like *nullb0*\n\nDefaults:\n- device size: 2GiB\n- zone size: 256MiB\n\n# Quick start\n\n```\n# ./nullb setup\nINFO: setup module and mounts\n```\n\nIf that succeeds, the module has been loaded and the configfs is available.\n\n```\n# ./nullb create\nINFO: Create nullb0\nINFO: name=nullb0\nINFO: size=2048M zone_size=256M\n/dev/nullb0\n```\n\nThe INFO messages are for clarity when run interactively, for scripting the\nlast line contains the name of the device node that's been created.\n\n```\n# ./nullb ls\nINFO: device nodes:\n/dev/nullb0\nINFO: created devices:\nNo  Name      Device                   Size    Zone size  Zone capacity  On  Mount\n 0  nullb0    /dev/nullb0             2048M         256M           200M   1  /mnt/test\n```\n\nThe null block device nodes and the actual name in sysfs can be different so\nboth are printed, though this script keeps both names respecting the index and\nname matches the device node filename.\n\n```\n# ./nullb rm nullb0\nINFO: check mounts\nINFO: removing nullb0\n```\n\nMount checks just lists all mounts using the device but won't stop the removal.\nIt should fail if the device is in use, otherwise the device and its resources\nare released after the command ends.\n\n# Trivia\n\n- the `null_blk` driver exists since kernel 3.12, zoned support has been\n  added in 4.19 but please use at least *5.10* as a good base with improvements\n  and fixes\n- the device data are backed by memory, reasonable size should be used for the 'size'\n- zone sizes must be a power of two, eg. 4MiB works\n- you can use the 'nullb' devices with 'btrfs' and have fun testing\n- use `blkzone` utility to 'report' or 'reset' zones on the device\n- https://zonedstorage.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdave%2Fnullb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdave%2Fnullb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdave%2Fnullb/lists"}