Use of MB vs MiB, GB vs GiB, TB vs TiB etc



  • Ref: https://forum.pfsense.org/index.php?topic=106470.0 where we start reporting TB.

    Ref: https://en.wikipedia.org/wiki/Petabyte and table of "standard" abbreviations.

    The metric system has kB MB GB TB … for 10^3 10^6 10^9 10^12 ...

    JEDEC (somewhat unfortunately) allows KB MB GB for 1024 1024^2 1024^3

    IEC uses KiB MiB GiB TiB ... for 1024 1024^2 1024^3 1024^4...

    Should we switch to KiB MiB GiB TiB ... in the places where the calculation is being done in powers of 1024?



  • I've always used upper/lower case to designate multiplier of 1000 vs. 1024, and bits vs. bytes.

    k = 1000^1
    m = 1000^2
    g = 1000^3
    t = 1000^4

    K = 1024^1
    M = 1024^2
    G = 1024^3
    T = 1024^4

    b = bits
    B = bytes

    So for example.
    n KBps = n x 1024^1 bytes per second.
    n MBps = n x 1024^2 bytes per second.
    n GBps = n x 1024^3 bytes per second.
    n TBps = n x 1024^4 bytes per second.

    n kbps = n x 1000^1 bits per second.
    n mbps = n x 1000^2 bits per second.
    n gbps = n x 1000^3 bits per second.
    n tbps = n x 1000^4 bits per second.



  • @Phil, IMHO a better Wiki article is the definition for Gigabyte (Consumer Confusion):

    https://en.wikipedia.org/wiki/Gigabyte#Consumer_confusion



  • @NOYB:

    I've always used upper/lower case to designate multiplier of 1000 vs. 1024, and bits vs. bytes.

    k = 1000^1
    m = 1000^2
    g = 1000^3
    t = 1000^4

    K = 1024^1
    M = 1024^2
    G = 1024^3
    T = 1024^4

    b = bits
    B = bytes

    So for example.
    n KBps = n x 1024^1 bytes per second.
    n MBps = n x 1024^2 bytes per second.
    n GBps = n x 1024^3 bytes per second.
    n TBps = n x 1024^4 bytes per second.

    n kbps = n x 1000^1 bits per second.
    n mbps = n x 1000^2 bits per second.
    n gbps = n x 1000^3 bits per second.
    n tbps = n x 1000^4 bits per second.

    Fully agree.
    No reason for that 'i' in between. Looks dull also.


  • Rebel Alliance Developer Netgate

    I don't have a strong preference here either way. Though I will say that when I see, for example "MB" I don't assume one way or the other, though when I see MiB I can safely assume it's 1024.

    I'm much more pedantic about B=byte and b=bit



  • Steve B merge PR https://github.com/pfsense/pfsense/pull/2605 so I guess at least he liked the MiB.



  • Since we're being pedantic about MB vs MiB, I think we also need a way to indicate what size of "byte". Since people get confused about MB, surely they realize the definition of "byte" varies on context, especially in networking. /sarc

    I would vote for using the "proper" abbreviation if only to reduce the confusion for laypersons and it's much harder to typo a missing "i" than "B" vs "b".

    edit: MiO  MebiOctet. We should use that.



  • Found system->Advanced->Miscellaneous, section "RAM Disk Settings (Reboot to Apply Changes)"

    Sizes are in MB and not like above abbreviation.



  • @M_Devil:

    Found system->Advanced->Miscellaneous, section "RAM Disk Settings (Reboot to Apply Changes)"

    Sizes are in MB and not like above abbreviation.

    Pull request https://github.com/pfsense/pfsense/pull/2696

    From what I can see, you are right. The underlying FreeBSD mdmfs utility creates a 40 MiB memory disk when -s 40m is specified.