Hard disk drives that use Shingled Magnetic Recording technology can have different interface implementations. This results in different usage models:
Drive Managed Interface: SMR disks that implement this interface are seen by the host kernel and applications as identical to regular disks and do not need special attention. Most Linux® kernels recognize these disks. With this implementation, no LBA space zoning information is available to the host. Drive Managed disks are therefore not considered to be zoned block devices.
Zoned Block Interface: SMR hard-disk drives that implement ZBC and ZAC feature sets provide commands to the host that allow the host to indentify and control the device zones. This interface has two different variations, or model implementations (See SMR Interface Implementations):
Host Aware: While this zone model offers the convenience and flexibility of Drive Managed disks (for example, random write capabilities), Host Aware disks support the full set of zone commands defined by ZBC and ZAC standards. Host Aware disks can support both the regular block device abstraction ("regular disk") and the zoned block device abstraction.
Host Managed This zone model defines a device type that is different from the "regular disk" device type. Host Managed disks can be used only as zoned block devices in order to satisfy the strong sequential write constraints defined by the model.
In the following sections, Host Aware disk models are considered similar to zoned block devices, with characteristics similar to the characteristics of Host Managed drives. This means that, for Host Aware disk models, sequential writes are assumed to be a constraint for the correct operation of the disk.
Serial ATA (SATA) host adapters, including those that use the Advance Host Controller Interface (AHCI) standard, are able to scan and initialize connections with Host Aware disks. Most AHCI host adapters are known to work with Host Managed disk drives (this is because the adapter usually does not react to the device signature of the connected disk).
On systems that fulfill all prerequisites, SATA Host Aware Disks and Host Managed Disks can be connected directly to SATA ports on the host controller.
After booting the system, use the lsscsi utility to list all SCSI devices attached to the system and verify the presence of the newly-connected disk:
In this example, the disk '/dev/sda' is the system boot disk and the disk '/dev/sdb' is recognized as a ZBC disk.
The second column of
lsscsi output indicates the device type. The value
zbc is always used for Host Managed ZBC and ZAC disks. This corresponds
to the ZBC-defined device type 0x14 for SAS disks and corresponds to the
ZAC-defined device signature 0xabcd for SATA disks. Because Host Aware
disks have the same device type or device signature as regular disks,
lsscsi lists host aware disks as disk.
The lsscsi utility does not list SATA ZAC disks with the type zac. The type zbc is always used, because the kernel internally implements a SCSI-to-ATA translation layer (SAT), which allows SATA devices to be represented as SCSI devices.
Verify the zone model of the disk by checking the zoned sysfs attribute:
The possible values of the zoned attribute are shown in the table below.
|none||Regular disk or drive managed ZBC/ZAC disk|
|host-aware||Host aware ZBC/ZAC disk|
|host-managed||Host managed ZBC/ZAC disk|
Kernel messages also contain useful information about the disk:
The zone model of the disk is confirmed to be "host managed". The total number of zones on the disk is also displayed. In this example, the disk capacity is 15 TB and the disk has 55880 zones.
The zone size of the disk can be inspected by using sysfs to examine the attribute chunk_sectors:
The value is displayed as a number of 512B sectors regardless of the actual logical and physical block size of the disk. In this example, the disk zone size is 524288 x 512 = 256 MiB.
As of Linux kernel version 4.20.0, the sysfs attribute nr_zones reports the total number of zones on the disk:
To obtain detailed information on the disk zone configuration, for instance the number of conventional zones available, the blkzone utility can be used.
From the output, one can see that the 512B sector range from 0 up to 0x010600000 is divided into 524 conventional zones. The sector space starting from 0x010600000 until the last sector of the disk is devided into 55356 sequential write required zones.
AHCI adapters can only accomodate Serial ATA disks and generally only provide a limited number of ports. SAS Host Bus Adapters (HBA) are widely used in enterprise applications to overcome AHCI limitations. The SAS transport layer used by SAS HBAs can equally accomodate both Serial ATA and SCSI disks.
While most AHCI adapters for Serial ATA disks generally do not cause any problem with host managed ZAC disks identification, SAS HBAs on the other hand may suffer from a lack of support depending on the HBA model being used.
The compatibility of a SAS HBA with host managed disks mainly depends on the following factors.
The HBA must have the ability to recognize the host managed device type 0x14 of host managed SAS disks (ZBC/SCSI).
The HBA must have the ability to recognize the host managed device signature 0xabcd of SATA host managed ZAC disks and translate this signature into the ZBC defined SCSI device type 0x14.
Generalizing the previous point, the HBA must implement a SCSI-to-ATA translation (SAT) layer supporting the conversion of host issued ZBC zone commands into ZAC zone commands that can be executed by a SATA ZAC disk connected to the HBA.
Any HBA failing the first requirement will not expose a ZBC host managed disk to the host. Similarly, an HBA failing to comply with the second and third requirement will fail to expose to the host a host managed ZAC disk as a ZBC host managed disk.
In the case of a host aware disk model, the device type and device signature handling will not cause any problem (recall that host aware disks use the regular disk device type and signatur 0x00). Host aware disks will thus always be useable as regular disks with any HBA. The execution of ZBC zone commands with a SAS host aware disk may also work most of the time. However, similarly to host managed disk, the absence of a ZBC/ZAC compatible SAT layer will prevent the use of a Serial ATA host aware disk as a ZBC host aware disk. The ZBC zone commands sent to the SATA disk will not be translated and result in command failures.
The compatibility of an HBA model with the ZBC and ZAC standards should be checked with the HBA vendor. Under some conditions, an HBA compatibility can also be checked using the libzbc conformance test suite.
If you are using a compatible HBA and you have connected the drive and rebooted the system, verifying the disk identification and checking the disk parameters and zone configuration can be done in the exact same manner as with Serial ATA disks as discussed above.
Remember that most SAS HBAs have plug-and-play features that make it unnecessary to reboot the system after connecting or disconnecting a disk to it.
In these examples,
/dev/sdc is an SAS disk connected to an SAS HBA and
/dev/sdd is a SATA disk connected to the same HBA.
Inspecting the kernel messages shows no differences between the initialization of the SAS drive and the SATA disk.
Both disks are identified by the kernel as Direct-Access-ZBC devices. This indicates that the HBA is correctly translating the ZAC host managed device signature into a ZBC host managed device type.