Pcornel
Storage · ZFS

Recordsize

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

Back to the Topic

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> — current
  • zfs set recordsize=1M <pool>/media — large files
  • zfs 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 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 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
AcceptanceHealthy 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

Confirmation

Confirm action

Continue?