LinuxCommandLibrary

mkzftree

Create a compressed ZFS filesystem archive

SYNOPSIS

mkzftree [options] device size

PARAMETERS

device
    The path to the block device (e.g., /dev/sdb) or file to create the zoned block device on.

size
    The size of the zoned block device to create. The size can be specified in bytes (e.g., 1024), kilobytes (e.g., 1024k), megabytes (e.g., 1024m), gigabytes (e.g., 1024g), or terabytes (e.g., 1024t).

-n
    Specifies the number of logical sectors in the device. If not given, the default is used based on the size.

-s
    Specifies the sector size of the device. If not given, the default is used based on the size.

-z
    Specifies the zone size of the device.

-r
    Specifies the maximum number of open zones of the device.

-p
    Preserve the device content. A GPT header and a partition covering the entire device are still added, however data is not touched. If the device contained a file system, it will still be accessible after running mkzftree. This is useful to create a zoned block device on top of an existing file system.

-S
    Sparse file. Allocate only space for metadata.

DESCRIPTION

The mkzftree command is used to create an empty zoned block device. This command is specifically designed for creating devices that conform to the zoned block device model, typically used with shingled magnetic recording (SMR) drives. It initializes the device with the necessary metadata to identify it as a zoned device and to manage the zones it contains. This allows the operating system to utilize the device according to the zoned block device access rules.

The utility writes a GPT header and partition entries that define the user-accessible data area as a single partition that is recognized as a zoned block device by the Linux kernel.

mkzftree can create the zoned block device directly to a file, which is often useful for testing or for creating image files of zoned block devices. The resulting device can then be mounted and used like any other block device. It is crucial to understand zoned block device semantics before using such devices for critical data storage.

CAVEATS

Using mkzftree on an existing block device will overwrite any existing data unless the -p option is used. Understanding zoned block device semantics is critical to avoid data loss.

EXIT STATUS

The mkzftree command returns 0 on success and a non-zero value on failure. A non-zero exit status indicates an error during the creation or initialization of the zoned block device.

HISTORY

The mkzftree utility was developed to provide a means of creating and managing zoned block devices, primarily for use with shingled magnetic recording (SMR) drives. It has evolved in conjunction with the increasing adoption of zoned block devices in enterprise storage solutions to ensure compatibility and efficient utilization of storage resources.

SEE ALSO

sg_format(1), fdisk(8), parted(8)

Copied to clipboard