{"id":13576223,"url":"https://github.com/abbbi/nullfsvfs","last_synced_at":"2026-02-25T09:21:53.477Z","repository":{"id":40605205,"uuid":"156756147","full_name":"abbbi/nullfsvfs","owner":"abbbi","description":"a virtual black hole file system that behaves like /dev/null","archived":false,"fork":false,"pushed_at":"2025-06-11T09:00:43.000Z","size":192,"stargazers_count":299,"open_issues_count":9,"forks_count":12,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-06-11T09:49:54.767Z","etag":null,"topics":["dev","filesystem","linux","linux-kernel","null","nulldev","nullfs","performance-testing","vfs","virtual-file-system"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abbbi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"abbbi","buy_me_a_coffee":"abbbi"}},"created_at":"2018-11-08T19:12:22.000Z","updated_at":"2025-06-11T08:56:59.000Z","dependencies_parsed_at":"2023-11-11T16:24:37.976Z","dependency_job_id":"6026f3df-1695-4f9e-bb57-ef938a54a131","html_url":"https://github.com/abbbi/nullfsvfs","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/abbbi/nullfsvfs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbbi%2Fnullfsvfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbbi%2Fnullfsvfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbbi%2Fnullfsvfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbbi%2Fnullfsvfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abbbi","download_url":"https://codeload.github.com/abbbi/nullfsvfs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbbi%2Fnullfsvfs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29234154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T14:18:14.570Z","status":"ssl_error","status_checked_at":"2026-02-08T14:18:14.071Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dev","filesystem","linux","linux-kernel","null","nulldev","nullfs","performance-testing","vfs","virtual-file-system"],"created_at":"2024-08-01T15:01:08.153Z","updated_at":"2026-02-25T09:21:53.471Z","avatar_url":"https://github.com/abbbi.png","language":"C","readme":"[![nullfsvfs CI on ubuntu-latest](https://github.com/abbbi/nullfsvfs/actions/workflows/ci-ubuntu-latest.yml/badge.svg?branch=master)](https://github.com/abbbi/nullfsvfs/actions/workflows/ci-ubuntu-latest.yml)\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n- [nullfsvfs](#nullfsvfs)\n  - [installation](#installation)\n    - [manual installation](#manual-installation)\n    - [debian package](#debian-package)\n  - [Usage](#usage)\n    - [Keeping file data](#keeping-file-data)\n    - [ACL](#acl)\n    - [usecases](#usecases)\n    - [supported mount options](#supported-mount-options)\n    - [todos/ideas](#todosideas)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n# nullfsvfs\nA virtual file system that behaves like /dev/null\n\nIt can handle regular file operations like mkdir/rmdir/ln but writing to files\ndoes not store any data. The file size is however saved, reading from the files\nbehaves like reading from /dev/zero.\n\nWriting and reading is basically an NOOP, so it can be used for performance\ntesting with applications that require directory structures.  Implemented as\nkernel module, instead of using FUSE, there is absolutely no overhead for\ncopying application data from user to kernel space while performing write or\nread operations.\n\n![alt text](https://github.com/abbbi/nullfsvfs/raw/master/nullfs.jpg)\n\n```\n# sudo make\nmake -C /lib/modules/4.18.5/build M=/home/abi/lwnfs modules\nmake[1]: Entering directory '/usr/src/linux-headers-4.18.5'\n  Building modules, stage 2.\n  MODPOST 1 modules\nmake[1]: Leaving directory '/usr/src/linux-headers-4.18.5'\n\n# insmod nullfsvfs.ko\n# mkdir /sinkhole\n# mount -t nullfsvfs none /sinkhole/\n# mkdir /sinkhole/testdir\n# touch /sinkhole/testdir/myfile\n# echo foobar \u003e /sinkhole/testdir/myfile\n# ls -lah /sinkhole/testdir/myfile\n-rw-r--r-- 1 root root 0 Nov  8 20:17 /sinkhole/testdir/myfile\n# cat /sinkhole/testdir/myfile\n# pv \u003c /dev/zero \u003e /sinkhole/testdir/myfile\n11.1GiB 0:00:04 [3.85GiB/s] [     \u003c=\u003e      ] \n# cat /sinkhole/testdir/myfile\n# \n```\n\nFile size is preserved to work around applications that do size checks:\n\n```\n# dd if=/dev/zero of=/nullfs/DATA bs=1M count=20\n20+0 records in\n20+0 records out\n20971520 bytes (21 MB, 20 MiB) copied, 0.00392452 s, 5.3 GB/s\n# stat -c%s /nullfs/DATA\n20971520\n```\n\nReading from the files does not copy anything to userspace and is an NOOP;\nmakes it behave like reading from /dev/zero:\n\n```\n# dd if=/nullfs/DATA of=/tmp/REALFILE\n40960+0 records in\n40960+0 records out\n20971520 bytes (21 MB, 20 MiB) copied, 0.0455288 s, 461 MB/s\n# hexdump -C /tmp/REALFILE\n00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|\n```\n\n\n## installation\n\n### manual installation\n\nTo install the module for the running linux kernel use:\n\n```\n # make -C /lib/modules/$(uname -r)/build M=$PWD modules_install INSTALL_MOD_DIR=kernel/fs/nullfsvfs\n # depmod\n```\n\nRunning `depmod` is mandatory. Now the module can be loaded via:\n\n```\n # modprobe nullfsvfs\n``` \n\nTo automatically load the module during system boot, create a configuration\nfile suitable for your distribution (usually located in */etc/modules-load.d*):\n\n```\n # echo nullfsvfs \u003e /etc/modules-load.d/nullfsvfs.conf\n```\n\nExample entry for `/etc/fstab`, mounting the filesystem to `/nullfs`:\n\n\n```\nnone    /nullfs nullfsvfs auto\n```\n\n### debian package\n\n```\n # apt-get install debhelper dkms dh-dkms\n # dpkg-buildpackage -uc -us -rfakeroot\n # dpkg -i ../nullfsvfs_\u003cversion\u003e_amd64.deb\n```\n\n## Usage\n### Keeping file data\n\nThere is the possibility to exclude certain files from being sent into the\nvoid.  If, for example, the file matching \"fstab\" should be kept in memory,\nmount nullfs with the \"write=\" option.\n\n```\n# mount -t nullfsvfs none /sinkhole/ -o write=fstab\n# cp /etc/fstab /sinkhole/\n# wc -l /sinkhole/fstab \n14 /sinkhole/fstab\n# cp /etc/passwd /sinkhole/\n# wc -l /sinkhole/passwd \n0 /sinkhole/passwd\n```\n\nAnother option is using the sysfs interface to change the exclude string\nafter the module has been loaded:\n\n```\n # echo foo  \u003e /sys/fs/nullfsvfs/exclude\n```\n\nKeep in mind that file data is kept in memory and no boundary checks are done,\nso this might fill up your RAM in case you exclude big files from being\nnulled.\n\n### ACL\n\nIt is possible to set POSIX ACL attributes via `setfacl` so it appears the\nfilesystem supports them, they are not saved.\n\nWorks with recent linux kernels (5.x), nullfs builds fine with older kernels\n(4.x, 3.x) but setting ACL information fails with \"Operation not supported\".\n\n### usecases\n\nSee: [Use Cases ](https://github.com/abbbi/nullfsvfs/labels/Usecase)\n\nThe module has been used for performance testing with redis, see:\n\n https://www.usenix.org/system/files/atc20-george.pdf\n\nPlease report usecases as regular issues!\n\n### supported mount options\n\nThe following mount options are supported:\n```\n -o mode=      set permissions on mount directory ( mount .. -o mode=777 )\n -o uid=       set uid on mount directory ( mount .. -o uid=1000 )\n -o gid=       set gid on mount directory ( mount .. -o gid=1000 )\n -o write=fn   keep data for specific file ( mount .. -o write=fstab )\n```\n\n### todos/ideas\n\n* replace simple_statfs call with real one, show free space of a directory that\n  can be passed during kernel module load\n* support multiple parameters for write= option\n* allow regex for write= option via trace.h\n* simulate xattr support?\n","funding_links":["https://github.com/sponsors/abbbi","https://buymeacoffee.com/abbbi"],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabbbi%2Fnullfsvfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabbbi%2Fnullfsvfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabbbi%2Fnullfsvfs/lists"}