4 ms·
> They are all rounded up to 512 or 4096 bytes by your filesystem. That's an implementation detail, and neither I nor my programs care about it. We do care abo
by adwn 4y ago
> They are all rounded up to 512 or 4096 bytes by your filesystem.
That's an implementation detail, and neither I nor my programs care about it. We do care about the actual length of the file, which isn't related to powers of two, except in niche cases.
> SSDs operate using erase blocks sized in mebibytes, and expose sector sizes of 512 B or 4096 B to the OS.
While true, this is also an implementation detail, and I don't think about the size of my SSD in multiples of sectors or pages or kibibytes – "976762584 kiB" just isn't a useful number for me, but "1000.2 GB" is manageable. Specifying it as "931.51 GiB" isn't more correct, so it makes sense to default to powers of 10 instead of powers of 2.
The situation would be different if HDDs and SSDs always or typically had exact sizes like 512*2^30 (= 512 GiB) or 3*2^40 (= 3 TiB) – you know, like RAM – in which case using powers of 2 would make sense. But that's not the world we're living in.
- colanderman 4y ago> The situation would be different if HDDs and SSDs always or typically had exact sizes I just checked two of three SSDs available to me. Two were exact multiples of power-of-two gigabytes -- 200 GiB, 120 GiB. One was 500.3 GB. SI units might be more useful to a consumer (and I am not arguing they aren't). But the argument that storage systems have "nothing to do" with powers of two is not valid.
- qilo 4y agoHDD sizes are set by manufacturers according to the IDEMA "LBA Count for Disk Drives Standard"[0] formula: LBA_count = 97696368 + 1953504 * (Reported_Capacity_in_GBytes - 50) So, for 120 GB HDD: (97696368 + 1953504 * 70) * 512 / 1024^3 = 111.79 GiB (97696368 + 1953504 * 70) * 512 / 1000^3 = 120.03 GB For 200 GB HDD: (97696368 + 1953504 * 150) * 512 / 1024^3 = 186.31 GiB (97696368 + 1953504 * 150) * 512 / 1000^3 = 200.05 GB For 500 GB HDD: (97696368 + 1953504 * 450) * 512 / 1024^3 = 465.76 GiB (97696368 + 1953504 * 450) * 512 / 1000^3 = 500.11 GB Doesn't look like powers of 2 at all. Are you sure about your sizes? [0] http://www.idema.org/wp-content/downloads/2169.pdf http://www.idema.org/wp-content/downloads/2169.pdf
- ThePowerOfFuet 4y agoLogical Block Addresses were simple back when all blocks were 512 bytes. Now we have 520 (T10-PI), 4096, etc, so your math falls apart.
- qilo 4y agoFor disks with sectors of 4096 bytes, the formula is the same except the constants are accordingly 8 times smaller. Regarding sectors of 520 bytes, usable bytes are still 512. Quote from the above referenced document: > HDDs formatted with T10 PI (Protection Information) have 8 bytes added to the end of each sector. However, the user usable sector size will remain at 512 bytes or 4096 bytes. The 8 bytes of PI will increase the overhead of the disk sector density similar to overhead of ECC bytes in a given sector.