Modern high-capacity enterprise storage architectures frequently incorporate Zoned Block Devices (ZBDs), including Shingled Magnetic Recording (SMR) hard drives and Zoned Namespaces (ZNS) NVMe solid-state drives. Unlike traditional random-write block devices, zoned storage divides the physical storage space into discrete zones where data must be written sequentially from a designated write pointer. While specialised zoned filesystems like Btrfs or F2FS and zoned device mappers manage these constraints transparently during file operations, storage engineers and system administrators need direct visibility into zone topologies, write pointers, and zone capacity. The blkzone utility, part of standard util-linux, provides low-level command-line controls to query zone status, open or finish zones, and reset write pointers across zoned block devices in Linux.
Understanding Zoned Block Device Architecture in Linux
Zoned storage enforces strict sequential write rules across defined logical block address (LBA) ranges:
- Zone Types: Conventional zones (permitting standard random writes), Sequential-Write-Required (host-managed zones where writes must occur strictly at the current write pointer), and Sequential-Write-Preferred (host-aware zones where out-of-order writes are allowed with performance penalties).
- Write Pointer (wp): A hardware marker tracking the current sequential boundary within an open zone. Once data is written, the pointer advances toward the zone limit.
- Zone States: Empty (write pointer at zone start), Implicitly Open / Explicitly Open (ready to receive write streams), Closed (temporarily halted), Full (capacity reached), and Read-Only / Offline (hardware faults).
- Resetting Zones: To overwrite or reclaim an exhausted zone, the host must issue an explicit reset command, returning the write pointer to the beginning of the zone.
Verifying Zoned Storage Support and Device Types
Before using blkzone, inspect your block device attributes using lsblk or sysfs to confirm that the disk uses a zoned model:
lsblk -o NAME,SIZE,TYPE,ZONED
The ZONED column indicates the model:
- none: Standard block device (not zoned).
- host-managed: Requires strict sequential software management (compatible with
blkzone). - host-aware: Accepts both conventional and sequential commands.
You can also check the zone size and maximum open zones via sysfs:
cat /sys/block/sdX/queue/zoned
cat /sys/block/sdX/queue/chunk_sectors
Reporting Zone Status with blkzone report
To inspect zone layout, operational states, and write pointers across a zoned device, execute blkzone report:
sudo blkzone report /dev/sdX
The command outputs a structured list of zones starting from sector 0:
start: 0x000000000, len 0x080000, cap 0x080000, wptr 0x000000000, reset:0, non-seq:0, zone: 2(seq-write-req), cond: 1(empty)
start: 0x000080000, len 0x080000, cap 0x080000, wptr 0x00009c400, reset:0, non-seq:0, zone: 2(seq-write-req), cond: 3(open-imp)
start: 0x000100000, len 0x080000, cap 0x080000, wptr 0x000180000, reset:0, non-seq:0, zone: 2(seq-write-req), cond: 14(full)
Key attributes in the output include:
- start & len: The beginning LBA sector and total length of the zone in 512-byte sectors.
- cap: The usable capacity within the zone (important for ZNS NVMe drives where capacity may be smaller than total zone length).
- wptr: The current write pointer position. If
wptr == start, the zone is empty. Ifwptr == start + len, the zone is full. - cond: The current zone condition (empty, open-imp, open-exp, closed, or full).
Filtering Zone Reports by Sector Offset and Count
On large multi-terabyte drives containing hundreds of thousands of zones, querying the entire device floods the terminal. Use the -o (offset) and -c (count) options to report on specific ranges.
To inspect 5 zones starting at sector 0x00080000:
sudo blkzone report -o 0x00080000 -c 5 /dev/sdX
Opening, Closing, and Finishing Zones
Enterprise applications and storage engines manage hardware resources by explicitly transitioning zones between operational states:
To explicitly open a zone (allocating internal hardware buffers for immediate writing):
sudo blkzone open -o 0x00080000 -l 0x080000 /dev/sdX
To close an open zone (releasing active write resources while keeping the write pointer intact):
sudo blkzone close -o 0x00080000 -l 0x080000 /dev/sdX
To finish a partially written zone (marking it as full and advancing the write pointer to the end, preventing further writes):
sudo blkzone finish -o 0x00080000 -l 0x080000 /dev/sdX
Resetting Zone Write Pointers with blkzone reset
When reclaiming storage or wiping test partitions on a host-managed drive, you must reset the zone write pointer before new data can be written. Resetting sets the write pointer back to the zone start and erases existing data references.
To reset a specific zone:
sudo blkzone reset -o 0x00080000 -l 0x080000 /dev/sdX
To reset all zones across the entire drive simultaneously (wiping the whole device):
sudo blkzone reset --all /dev/sdX
Verify that all write pointers have returned to their base addresses by running blkzone report.