Pcornel
Storage · ZFS

Ashift

Cheat sheet · https://pcornel.dk/topic.php?topic=4019

Back to the Topic

Answer

Ashift represents the logical alignment ZFS uses for writes to a vdev based on an assumed physical sector size. A too-small ashift on media with larger physical sectors can cause read-modify-write amplification. Because ashift is effectively immutable for an existing top-level vdev, wrong selection is a design issue that usually requires replacing/recreating storage rather than a simple property edit.

Remember

  • Ashift ≠ recordsize.
  • Ashift ≠ filesystem block size.
  • Reported logical sector size ≠ guaranteed physical sector size.
  • Ashift on one top-level vdev ≠ necessarily identical ashift on every vdev in a heterogeneous pool.

First checks

  • zdb -C <pool> | grep ashift — pool ashift
  • cat /sys/block/sdX/queue/physical_block_size — disk sector
  • zpool create -o ashift=12 ... — set at creation

Verify in this order

vdev creation → ashift → I/O alignment

Where it usually breaks

First mismatch in member media → metadata/layout → allocation/placement → redundancy/recovery → logical object → consumer; preserve identity/pre-state before mutation.

ZFS → Ashift ZFS map

ZFS boundaryWhat to verifyProof limit
Identity / topologyPool GUID/name, dataset/zvol, top-level vdev class, leaf-device identity and effective propertiesObject presence alone does not prove integrity, performance or recovery
Capacity / protectionPool free space, quotas/reservations, snapshot retention, redundancy and active scrub/resilver stateFree space or ONLINE state at one layer does not prove end-to-end health
Failure boundaryAn ashift value proves ZFS vdev alignment policy; it does not prove the drive reports its real physical geometry or that workload writes align end to end.Correlate ZFS evidence with both workload and lower device/path evidence
AcceptanceHealthy evidence: ashift is compatible with real media geometry, small-write behavior is within baseline, and no avoidable alignment penalty is observed under representative workload.Close only after original workload plus checksum/read-back/recovery verification succeeds

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4019

Confirmation

Confirm action

Continue?