Alexander Best

Stories from the Bit-Shift, or What Is 512N vs. 512e vs. 4kN vs. Flash-Pages?

Today, let’s talk about how bits are packed into flash drives and HDDs and why that matters.

The terms 512N and 4kN describe physical sector sizes of HDDs—the smallest amount of data which can be written to or read from the drive. In other words, a 512N HDD has 512 byte sectors and a 4kN HDD has 4 kbyte sectors. Sometimes the 4kN drives are named AF-Drives (Advanced-Format-Drives).

4kN sectors were introduced to hold more data on the platters without bumping up the LBA (logical block addressing) scheme. Unfortunately, not all operating systems and applications were ready to deal with the larger 4kN sectors, especially when writing less than 4k bytes. To deal with that dilemma the HDD manufacturers invented 512e. A 512e HDD emulates an HDD controller with 8 sectors of 512 bytes and still uses a 4 kbyte physical sector. It looks like you’re talking to a 512N drive. This compatibility comes at a price. If not all 8 emulated sectors are updated by a write, then the HDD reads the 4k sector from the disk into a buffer, updates the changed emulated sector space and then writes the updated 4k sector back to disk. This means that a single 512 byte operation translates into two 4kN operations. Since a disk head can only do one thing at a time, either read or write, 512e takes at least two spindle rotations to write the data, where it is only required a single rotation for 512N. In case the write is outside the 4k alignment the same procedure turns out to take 4 rotations, further aggravating the delay. This occurs for example when a 1k write updates the last emulated sector of a 4k sector and the first sector of the next 4k sector in line.

What does this mean for Flash-Pages? SSDs also operate at 512N or 4kN level. The Flash-Pages are usually significantly larger than 4 kilobyte and, like disk sectors, the pages do not allow partial programming. The SSD controller reads an entire page in a buffer, updates the new data within the buffer and then programs the new content into the flash cells. Due to the limited program cycles of flash cells, a wear leveling layer determines where the actual flash page data ends up. This layer always tries to send the data to a page with the least used cells in an erased state. Similar to the heads of HDDs, the flash cells can either be read or erased or programmed. Small writes to fractions of a page or misaligned writes touching multiple pages lead to increased wear and the infamous “Write-Cliff.” The point at which write performance dramatically slows down, because there are no more erased cells “in stock.”

For these reasons, you should take a closer look at the sector sizes employed by new storage hardware before making your next purchase to avoid last minute surprises.

DataCore virtual storage pools internally use a 4 kilobyte alignment, regardless of whether the virtual disk being provisioned is 512N 4kN. A 4kN virtual disk enforces 4 kilobyte boundaries due to its logical geometry, but requires 4kb OS support at the host level.

Watch a Demo

Want to see compatibility between different drive formats? Click here to watch a demo.

Get a Live Demo of SANsymphony

Talk with a solution advisor about how DataCore Software-Defined Storage can make your storage infrastructure modern, performant, and flexible.

Get a Live Demo