71 points · by globalc · 5y ago · 4 comments
https://libguestfs.org/nbdkit-loop.1.html
eg. Make a 7 exabyte disk:
$ sudo modprobe nbd
$ nbdkit -U /tmp/sock memory 7E
$ sudo nbd-client -unix /tmp/sock /dev/nbd0
$ sudo mkfs.btrfs /dev/nbd0
$ sudo mount /dev/nbd0 /tmp/mnt
$ df -h /tmp/mnt
Filesystem Size Used Avail Use% Mounted on
/dev/nbd0 7.0E 3.4M 7.0E 1% /tmp/mnt
I even did a talk about it:In my defense, the storage related PM and colleagues who reviewed the article did not bring up nbd either.
Anyway the real power of nbdkit is not that you can create huge disks, but the plugin/filters system, so you can write highly customized block devices for specific use cases, and do things like error injection and test compression or deduplication strategies.