4Kn HDD's formating and usable capacity

so i got a couple of 4Kn drives, a few 512e drives and a good deal of 512n… not that it is relevant
for the last few months i’ve been trying to take advantage of using 4Kn formating on drives.

to my understanding because the 512sector keep crc values for each 512bytes or whatever while then 4kn keeps it for every 4096, that gives a sizable optimization in capacity of 4Kn drives.

supposedly it’s suppose to be that instead of the approximate 10% loss of capacity on 512n HDD’s then the 4Kn format losses only 3% to overhead… or so it’s claimed…

I’ve been trying to take advantage of this to no avail… and i was wondering if anyone else had any success with this… meaning getting a sizable reduction in the overhead on 4Kn or 512e HDD’s when formatting them to 4Kn

       description: SCSI Disk
       product: HUS726060AL4210
       vendor: HGST
       physical id: 0.2.0
       bus info: scsi@7:0.2.0
       logical name: /dev/sdj
       version: A7J0
       serial: K1HYUGWF
       size: 5589GiB (6001GB)
       capacity: 7231GiB (7764GB)
       capabilities: 7200rpm partitioned partitioned:dos
       configuration: ansiversion=6 logicalsectorsize=4096 sectorsize=4096

i did a bit further digging and experimentation now that i got my 4Kn drives dug out of my array, it seems they are variable sector size… which shouldn’t mean anything really… tho i cannot help but consider this is why they aren’t acting like they are suppose to… and may i’m just to new with using SAS drives, oh god maybe i have to read the manual…

You do not see it. The ECC is invisible to the OS, only the drive firmware sees it. Essentially, each sector is not 512B on the drive, but, say, 560B. You write 512B, the firmware adds 58B of ECC. For a 4K drive, you write 4096B, the firmware adds 120B of ECC and writes 4216B to the platter.

Basically, with the same data density, number of platters etc, a 512n drive would have lower capacity than a 512e or a 4Kn drive.

this is the same model in SATA and 512n
i get exactly the same capacity… which is what i find odd… because from what i understand people seems to agree that there should be 10% overhead on this version…

i also find it kinda odd that the SAS drives write 7241 in capacity, but i chalk that up to lshw being weird…

since it also likes to claim that these drives are 15k rpm, which they most certainly are not… it also keeps saying it’s dos partitions on the sas version even tho zfs made the partitions and all the drives where the same…

been pondering if there might be some hdd firmware settings that maybe kinda weirdly configured from whatever else the drives have been use for before i got them.

       description: ATA Disk
       product: HGST HUS726060AL
       physical id: 0.7.0
       bus info: scsi@7:0.7.0
       logical name: /dev/sdh
       version: T1EV
       serial: AR11021EH2JDXB
       size: 5589GiB (6001GB)
       capacity: 5589GiB (6001GB)
       capabilities: 15000rpm gpt-1.00 partitioned partitioned:gpt
       configuration: ansiversion=6 guid=aa4051ab-0514-5941-afbf-a2147f772556 logicalsectorsize=512 sectorsize=512

You will get the capacity that is written on the drive. You cannot “reformat” the drive to 4K sectors.

the 4Kn is out of the pools… been trying to make them utilize them at what was suppose to be their full capacity… so they are basically reformated… just did fdisk on them and remade their partitions…
i didn’t specifically clear out all the data, but that shouldn’t be required when i just rewrite the tables, then the data should be disregarded…


Disk /dev/sdi: 5.5 TiB, 6001175126016 bytes, 1465130646 sectors
Disk model: HUS726060AL4210
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: C5FA030A-EF2B-154B-91A3-F82094590795

Device          Start        End    Sectors  Size Type
/dev/sdi1        2048 1465112575 1465110528  5.5T Solaris /usr & Apple ZFS
/dev/sdi9  1465112576 1465128959      16384   64M Solaris reserved 1

when i try to make a pool with them… on ashift 12

i’ve had the partitions deleted multiple times and rewritten the gpt, i also tried to use different partitions in fdisk to try and get the improved capacity…

since the drives are currently out of production i figured i would tinker and see if i couldn’t get all the capacity that i was expecting to get from 4kn … it was why i bought them

But if i get the same capacity i’m unsure why i would even want to use 4kn
atleast for small data iops… like database stuff…

Actually there are some Seagate drives which allow you to switch between 4Kn and 512e with a software tool.

And since both 4Kn and 512e are 4K you would have the same capacity. If you could reformat the drive to 512n, that would probably result in lower capacity.

512e drives is essentially 4k drives that has firmware / hardware that can make them run / emulate 512n… however these drives will always have slightly worse performance.

these particular drives are variable sector size and will do 512, 520, 4096… and the larger sector sizes… how that works i got no idea… but it says so in their product sheet … i assume that is for usage with applications like netapp das which applys additional checksums and thus require the drives to run different sector sizes like 520 for optimization reasons.

these drives are atleast according to fdisk and according to what they bought as and what is written on them 4Kn drives.

my drives are 512n and 4Kn

and yet there is no difference in their capacity…

Disk /dev/sdd: 5.5 TiB, 6001175126016 bytes, 11721045168 sectors
Disk model: HGST HUS726060AL
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: CC816930-0033-0B49-9CC6-05C8CF41F3D6

Device           Start         End     Sectors  Size Type
/dev/sdd1         2048 11721027583 11721025536  5.5T Solaris /usr & Apple ZFS
/dev/sdd9  11721027584 11721043967       16384    8M Solaris reserved 1

Why should there be? The drive is advertised as, say, 1TB, why should it have more or less capacity than that?

isn’t that the whole selling point in 4k
that you get 97% capacity utilization compared to 90% on 512n

i don’t see why people would pay so much extra for 4k if they didn’t get anything from it.

ofc there would be a reduction in iops… but that isn’t always the case… but yeah granted that may give some advantages like say higher transfer speeds with the same hardware…

but i was reading up on 4kn and i bought them because people said they had much less overhead… i suppose they could have been referring to bandwidth overhead… or have been just as confused as i am lol

Let’s imagine I am a HDD manufacturer. I make a drive that can fit 5TB exactly. Why should I advertise it as less than 5TB?

4K sectors get you cheaper drives or more capacity with the same areal density, but this is taken into account when advertising the drive.

1 Like

well that sort of makes good sense… i guess i can stop trying to squeeze out more capacity than the drives has lol

and when looking at prices 4k is usually much more expensive than the 512e (which one should stay away from if possible) and well 512n isn’t really that future proof but they are much cheaper … atleast when i look at used drives…

atleast i hadn’t ordered like 10 of these expecting 7% better capacity…

well lesson learned… i suppose i can push them back to work then… has nearly 5tb data i need to copy onto them… so they will become a mirror pool i guess… not sure what else i should use them for… nice drives tho… and only from 2017

got them for less than 100$ each… 6tb helium 4kn sas drives, pretty good deal… so not a total loss lol

In the past, you could buy a drive (20MB or so) and depending on your controller, you could format using MFM or RLL and get different capacities (RLL is more efficient in putting the bits on the drive). Those days are long gone. If the drive says it can store 1TB, it can store 1TB (if it was less, the manufacturer would get sued), but there is no point whatsoever in advertising a drive as lower capacity so someone could “overclock it”.

Just like SMR - it can put 15-20% more data on the drive, but the drive will be advertised as the “real” capacity that takes the gains into account.

1 Like

yeah that makes perfectly good sense for stuff like raid , production costs and such… i just figured… more capacity wouldn’t hurt anyone… was pretty interesting to find out about variable sector drives tho… i didn’t even know such a thing existed… i mean i knew 512e was a thing… but a drive that can do basically all sector sizes with some firmware tweaking… thats news to me

you know if there is anything else to be gained for 4kn aside from maybe more throughput with lower iops… which i suppose is also a pretty grand thing… maybe also a bit more throughput or something if i was to guess…

512n drives have lower capacity for the same cost.
512e drives have 4K sectors, but allow older software to use them as if they had 512B sectors (with possible performance penalty if writes are unaligned).

4Kn drives present the “real” sectors, but may have problems with older software.

1 Like

Very good explanation here: https://www.datacore.com/blog/stories-from-the-bit-shift-or-what-means-512n-vs-512e-vs-4kn-vs-flash-pages/

1 Like

interesting read… a bit short but very concise i think