Skip to main content

Emulated Zoned Block Devices

In a Linux environment, there are several ways available to create an emulated zoned block device.

  1. The zloop kernel block device driver: available since Linux 6.16, this driver uses one regular file per zone as backing storage. Large devices can be emulated without a matching amount of memory, and the zone state is preserved when the device is removed and added again, including across host reboots.

  2. The null_blk kernel block device driver: this is a simple method to emulate a zoned block device with different zone configurations mimicking both SMR and ZNS devices. While easy to use, null_blk uses system memory as backing storage, thus limiting the capacity of the devices being emulated. The emulated devices are also not persistent across host reboots.

  3. The scsi-debug kernel block device driver: this driver is simple to use but only makes it possible to create emulated SCSI ZBC hard disks with limited capacity (system memory is used as backing storage).

  4. The tcmu-runner SCSI device emulation: this application uses a regular file as its storage backstore, and can thus emulate large capacity host-managed ZBC SCSI disks. Disks created with tcmu-runner are treated by the Linux kernel as though they were physical disks.

  5. The QEMU open source machine emulator and virtualizer: recent versions of QEMU support the emulation of NVMe devices with Zoned Namespace support. These use regular files on the host as a backstores. Within a guest VM, an emulated ZNS device acts like a physical device.

The zloop and null_blk drivers are easy to use to quickly set up zoned block devices. Other emulation methods are either functionally more limited or more complex, but can be more accurate. The table below provides a summary of each method.

MethodBacking StorageAdvantagesDrawbacks
zloopRegular files (sparse files, one per zone)Very simple to use and allows large capacity devicesCannot fully emulate a ZNS device (no active zone emulation)
null_blkSystem memorySimple to use, can emulate all zoned block device characteristicsEmulated capacity limited by the system memory, emulated devices are not persistent across host reboots
scsi-debugSystem memoryRelatively simple to use, fully emulates a ZBC deviceEmulated capacity limited by the system memory, emulated devices are not persistent across host reboots
tcmu-runnerSingle regular fileFully emulates a ZBC deviceRequires user-space applications and more complex to setup
QEMUhost file (device image file)Fully emulates a ZNS deviceRequires running in a VM, the zone state of the emulated devices is not persistent across VM-hypervisor restarts