Since version 5.12 btrfs supports zoned mode. This is a special on-disk format and allocation/write strategy that's friendly to zoned devices. In short, a device is partitioned into fixed-size zones and each zone can be updated by append-only manner, or reset. As btrfs has no fixed data structures, except the super blocks, the zoned mode only requires block placement that follows the device constraints. You can learn about the whole architecture at https://zonedstorage.io.
Because of the append-only write, several btrfs features are not supported:
- nodatacow -- overwrite in-place
- fallocate -- preallocating space for in-place first write
- mixed-bg -- unordered writes to data and metadata
- booting -- resetting the first zone after superblock rotation would remove the boot loader data
The above is really incompatible because it expects an in-place write at some point. There are some features that are not part of the first implementation but is planned to be implemented in the future:
- only 'single' profile works, TBD: synchronize zone write pointers among the block groups
- fitrim, TBD: do not depend on free space cache
Creating a zoned filesystem needs btrfs-progs 5.12 or newer (not yet released).
The WD Ultrastar series 600 advertises HM-SMR, ie. the host-managed zoned mode. There are two more: DA (device managed, no zoned information exported to the system), HA (host aware, can be used as regular disk but zoned writes improve performance). There are not many devices available at the moment, the information about exact zoned mode is hard to find, check data sheets or community sources gathering information from real devices.
- the feature sets an incompat bit and requires new kernel to access the filesystem (for both read and write)
- superblock needs to be handled in a special way, there are still 3 copies but at different offsets (0, 512GiB, 4TiB) and the 2 consecutive zones are a ring buffer of the superblocks, finding the latest one needs read it from the write pointer or do a full scan of the zones
- mixing zoned and non zoned devices is possible (zones are emulated) but is recommended only for testing
- mixing zoned devices with different zone sizes is not possible
- zone sizes must be power of two, zone sizes of real devices are eg. 256MiB or 1GiB, larger size is expected, maximum zone size supported by btrfs is 8GiB
- https://hddscan.com/blog/2020/hdd-wd-smr.html -- some details about exact device types
- https://lwn.net/Articles/853308/ -- Btrfs on zoned block devices