Ashift
Cheat sheet · https://pcornel.dk/topic.php?topic=4019
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 ashiftcat /sys/block/sdX/queue/physical_block_size— disk sectorzpool 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 boundary | What to verify | Proof limit |
|---|---|---|
| Identity / topology | Pool GUID/name, dataset/zvol, top-level vdev class, leaf-device identity and effective properties | Object presence alone does not prove integrity, performance or recovery |
| Capacity / protection | Pool free space, quotas/reservations, snapshot retention, redundancy and active scrub/resilver state | Free space or ONLINE state at one layer does not prove end-to-end health |
| Failure boundary | An 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 |
| Acceptance | Healthy 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