Ashift=12 and 4Kn

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,949
I have been doing a lot of reading in an attempt to understand 4Kn, 512e and ashift=12
I have a bunch of disks (Seagate Exos 12TB) that are 512/4096 logical / physical. They are in an existing pool with ashift=12
smartctl -i /dev/ada4 shows up as
Sector Sizes: 512 bytes logical, 4096 bytes physical
Which I think means formatted 512

However I understand that ashift=12 means that ZFS is using the physical sector size of 4K - but surely the data is being stored in the old 512 way

Also, anyone know what the implications of having a ashift=9 vdev (SLOG) attached to this pool would be? The Optane 900p at first glance to be seems to be 512 only with no support for 4Kn
 

Etorix

Wizard
Joined
Dec 30, 2020
Messages
2,134
Sector Sizes: 512 bytes logical, 4096 bytes physical
Which I think means formatted 512
No, it means the opposite: Data is stored in 4k sectors, but the drive is willing to pretend to the OS it stores by 512 bytes (with write amplification). Ashift=12 is just what the doctor orders—and this is a pool-wide setting.
Ashift=12 for an actual 512-byte device just means reading and writing in batches of 8 sectors. Optane is byte-addressable and does not really have a "sector size" in the sense of other devices; it will work just fine.
 
Last edited:
Top