[2021-03-01: If you have disk larger than 8 TB, a slightly different rules apply.]
Ever since I first dealt with RAID, I was taught and was witness to ugly fact that two disks marked with the same size might not be exactly the same. Even the same disk from the same manufacturer could have slight difference in number of sectors. And some manufacturers were notorious for this (yes, Sun/Oracle, I am looking at you.
It was common wisdom to always make RAID a bit smaller than your full drive size to accommodate for potential “shrinkage” in the future. And I was myself known to warn others. However, things change…
Believe it or not, these days all disks have completely standardized sector count. For 512b sector size, formula is:
97,696,368 + (1,953,504 * (CapacityInGB – 50))
For 4K sectors, formula is:
12,212,046 + (244,188 * (CapacityInGB – 50))
This is courtesy of LBA Count for Disk Drives Standard (LBA1-03) that is seemingly followed by all manufacturers. I couldn’t find a single drive not following this standard and I’ve tried.
What does this mean? It means, if you have drive that is manufacturer in last five years, you can forget about under-sizing your RAID. Any replacement drive you order will have exactly the same sector count as long as sector size is same.
PS: Find below table for disks with 4K sectors:
|Size||LBA sector count|
PPS: While these rules are valid for SSDs too, depending on their configuration (e.g. over-provisioning) exact sector count available to end-user might vary.
[2017-07-16: Added calculator]