Recordsize
Cheat sheet · https://pcornel.dk/topic.php?topic=4018
Answer
Recordsize is a per-filesystem-dataset property used when ZFS forms data blocks for files; it is not a fixed physical sector size and can vary for tail blocks or workload behavior. Changing the property affects newly written or rewritten data rather than magically rewriting every existing block. Workload alignment should be reasoned together with application I/O, compression and underlying vdev geometry.
Remember
- Recordsize ≠ disk sector size.
- Recordsize ≠ zvol volblocksize.
- Changing recordsize ≠ immediate rewrite of existing file blocks.
- Larger recordsize ≠ automatically better throughput for every workload.
First checks
zfs get recordsize <ds>— currentzfs set recordsize=1M <pool>/media— large fileszfs set recordsize=16K <pool>/db— databases
Verify in this order
file write → records of up to recordsize
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 → Recordsize 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 effective recordsize value proves the property used for future applicable file-block creation; it does not prove existing data uses that size or that the setting is optimal. | Correlate ZFS evidence with both workload and lower device/path evidence |
| Acceptance | Healthy evidence: effective recordsize is deliberate for the workload, rewritten representative data shows expected latency/compression/amplification, and no regression appears in the original 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=4018