Why this post exists: the forum's storage series has covered the disk's wear contract (TBW/DWPD), survivor statistics (AFR), the rebuild window, scrub scheduling, the SLOG write path and backup lifecycle, and the RAM above the pool. This one goes one level below all of them, to the unit every one of those layers ultimately writes in: the sector. It is also the only setting in the series that a homelab builder can get wrong once and never repair without moving every byte of data — which makes it worth understanding before the pool exists rather than after the benchmark disappoints.

What is ashift, in one sentence?

ashift is the base-2 logarithm of the smallest I/O a vdev will issue, so 2^ashift bytes is that floor. The official OpenZFS documentation on workload tuning defines it precisely: top-level vdevs contain an internal property called ashift, which "stands for alignment shift. It is set at vdev creation and it is immutable. It can be read using the zdb command. It is calculated as the maximum base 2 logarithm of the physical sector size of any child vdev and it alters the disk format such that writes are always done according to it. This makes 2^ashift the smallest possible IO on a vdev." Four claims sit in that paragraph, and each one matters: it is derived from the physical sector size of the children, it takes the maximum across children, it is fixed at creation, and it is readable after the fact with zdb. The last point is the only mercy in the whole topic — you can always find out what you got, even when you cannot change it.

Why does a 512e drive end up with the wrong value?

Because the number ashift is built from is reported by the drive, and the drive has a reason to lie. A 512e drive ("e" for emulation) stores data in 4,096-byte physical sectors but presents 512-byte logical sectors so that legacy operating systems and controllers continue to work. The OpenZFS page describes exactly this history: sector size was 512 bytes on every device before flash; flash-based SSDs arrived around 2007 reporting 512-byte sectors "but the actual flash pages, which roughly correspond to sectors, are never 512-bytes"; and "Advanced Format" hard drives were later built with a 4,096-byte sector size. Then comes the sentence that turns hardware behaviour into a configuration problem: "ZFS makes the implicit assumption that the sector size reported by drives is correct and calculates ashift based on that." When the report says 512, the calculation produces 9, and 2^9 is 512 — a floor eight times smaller than the hardware's real unit.

The documentation does not leave you to guess the workaround. Because "many devices misreport their sector sizes and ZFS relies on the block device layer for this information," each platform developed its own fix: sd.conf on illumos, gnop(8) on FreeBSD, and -o ashift= on ZFS on Linux — with a database of known misreporting drives maintained in the Linux port so that common models are corrected automatically. The FreeBSD Handbook states the practical rule without hedging: "Some drives report 512-byte sectors for compatibility while using 4096-byte sectors internally. Create pools on such drives with an explicit -o ashift=12", and notes that setting vfs.zfs.vdev.min_auto_ashift=12 applies the same floor not just at zpool create but to later zpool add and zpool attach — which matters, because the disks you add in 2028 will be created under the same assumption as the pool you built today.

What does a partial-sector write actually cost?

The official sentence is short: "partial sector writes incur a penalty where the sector must be read into a buffer before it can be written." The mechanism behind it is in every drive vendor's Advanced Format documentation, and it is the same on flash and on spinning media: a drive cannot rewrite half a physical sector, so when the host asks to write less than a full 4,096-byte sector, the drive reads the whole sector into memory, merges the changed bytes, and writes the whole sector back. On a hard drive that read-modify-write also costs an extra rotation, which is why the penalty was first described as a performance problem rather than a durability one.

Now do the arithmetic on a pool built with ashift=9 on 512e drives. A 4 KiB logical write — one 4 KiB block of a ZFS record — is 4,096 ÷ 512 = eight writes at the vdev's floor. If each of those lands inside a different physical sector, each can trigger its own read-modify-write: 8 × 4 KiB of reads plus 4 KiB of writes for 4 KiB of data, a 9:1 byte ratio at the drive interface. That is where the "8× write amplification" folklore comes from — and where it goes wrong. The 8 is a block-count ratio, not a measurement: drives buffer and coalesce adjacent writes, so a sequential 4 KiB write arriving in eight pieces often lands in one physical sector after merging, and the real penalty is workload-dependent. We are stating the upper bound because it is the honest number, and because the actionable conclusion does not depend on which end of the range you land on: you cannot tune your way out of a floor that is fixed at creation, so the value has to be right before the first block is written.

Why can't it be fixed later?

Because ashift is baked into the on-disk format, not stored as a preference. The OpenZFS documentation says it "alters the disk format such that writes are always done according to it," and the FreeBSD Handbook repeats the consequence for operators: ashift is "a property of each vdev, not of the pool as a whole. It is fixed when creating the vdev and cannot change afterwards, so verify it before committing data to a pool." The community documentation is equally blunt — the only way to change it after the fact is to recreate the pool — and adds a detail worth knowing before you decide: using a larger ashift also slightly reduces usable capacity, because the minimum allocation unit grows with the floor.

Two consequences follow for a homelab. The first is that "fix it later" means a full data migration: create a new pool with the right value, replicate with zfs send -R | zfs recv if you have spare bays, or back up, destroy and restore if you do not — with the old pool read-only during the copy so you are not chasing a moving target. The second is that the choice is made per vdev, from the maximum across its children: mixing an old 512-byte-native disk with a new 4Kn disk in one vdev gives you the larger value for the whole vdev, which is the correct direction (a too-large floor wastes a little space; a too-small one costs writes). The failure mode to watch for is the layer that hides the number entirely — a hardware RAID controller or a USB bridge presenting a virtual disk whose sector size has nothing to do with the platters underneath. In that case the automatic detection has no chance, and the explicit -o ashift=12 is not belt-and-braces, it is the only correct input.

What does ashift=12 cost you in space?

Less than the folklore suggests, and only in one place. A larger floor raises the minimum allocation unit from 512 bytes to 4,096, so anything smaller than 4 KiB pads up to 4 KiB. For the workloads homelabs actually run this is close to a non-issue: the default recordsize is 128 KiB, which divides by 4 KiB exactly 32 times, so large files, media, VM images and backups waste nothing at all; a 4 KiB volblocksize or an 8 KiB database record also divides evenly. The cost lands on the tail — many tiny files, small metadata-heavy datasets, or a workload whose records are deliberately set below 4 KiB. Compare that with the cost of getting it wrong in the other direction: a floor of 512 bytes on a drive with 4,096-byte physical sectors, which is a permanent tax on every write for as long as the pool exists. Trading a measurable amount of capacity for a permanent write penalty is the right trade in essentially every homelab case, and the official guidance for flash media goes further still, recommending 12 for 4 KiB and 13 (8 KiB) for SSDs with 8 KiB pages.

How should a homelab builder check and decide?

Four steps, in order, all of them before the pool exists. First, read the platters. lsblk -o NAME,LOG-SEC,PHY-SEC (or smartctl -i) prints the logical and physical sector sizes the system sees; if logical is 512 and physical is 4096, the drive is 512e and the automatic calculation will want 9. Second, read what ZFS actually chose. zdb -C prints the pool configuration, including ashift per vdev — the OpenZFS docs name zdb as the way to read it. If 2^ashift is smaller than the physical sector size, the vdev is misaligned, and no amount of recordsize or compression tuning will fix it. Third, decide once. For anything built on 4 KiB media, the documented answer is -o ashift=12 explicitly rather than trusting detection; on FreeBSD, set vfs.zfs.vdev.min_auto_ashift=12 so future add and attach inherit it. Fourth, write the value down. Record ashift, vdev layout and RAIDZ width next to the pool's purpose, because the person who replaces a disk in three years will assume the pool was built correctly — and the only evidence either way is the zdb output nobody thought to save.