512e or 4Kn HDD?

So… I know there are 512e and 4Kn options for HDDs, but I don’t understand the difference and what is better for Storj. I believe all my drives are 512e. Is this bad?

my are 512 for sure, and thats good, 4k i wouldnt be able to use under my virtual machine, it takes only 512. There Was topic about that, people elaborated the differences : TL:DR: no big deal for NTFS.

1 Like

I am on ext4, Synology. It appears that my Exos drives support both fotmats, but in order to convert them to 4K the data will be lost. So… that’s a no no. But I want to know for the new drives if should I make them from the start 4Kn.
And how can that be achieved under Synology? Should I use an external case and format them? With what?
… I found that you can use Seachest to format the drive. You can gain 7-11% more space from 4K format.

The mention of this in the other thread was in the context of using SSDs.

SSDs have 4k sector size, but because they originally were designed to be a “drop-in” replacement for HDD most emulate 512 sector size. It’s called 512e, e stands for emulated

But because magic does not exist – when you write 512-size sector, on the background SSD has to read 4k sector, modify 512 block, and write 4k sector. This has two undesirable consequences:

  1. Flash wear 4k/512=8x faster.
  2. Because of this read-modify-write and wear leveling algorithms SSDs employ failure during write of new data can corrupt unrelated data you wrote months before. This is horrific property is intrinsic to SSD design, but write amplification exacerbates the problem. (SMR drives exhibit the same behaviour)

Most OSes will default to 512 sector size if the deivece supports it, and since these SSDs “do” – that’s what will end up being used.

For those using zfs – the parameter you want to override is “ashift”, you need to set it to number if bits, in this case 12 (2^12=4k). You can list ashift values on the existing array like so:

zdb -U /data/zfs/zpool.cache | grep ashift
            ashift: 12
            ashift: 12
            ashift: 12
            ashift: 12

There is the whole other realm of what sector size to pick from the perspective of the filesystem – 512 vs 4k, but beyond some exotic scenarios, the answer is usually a multiple of “whatever is native to the drive”, especially with zfs that supports compression and does not waste the whole “sector” for a file (not to be confused with the native sector size on the device).

1 Like

I found the best official explanation here:
https://www.seagate.com/files/www-content/product-content/enterprise-performance-savvio-fam/enterprise-performance-15k-hdd/_cross-product/_shared/doc/seagate-fast-format-white-paper-04tp699-1-1701us.pdf