• Ret2libsanity@infosec.pub
    link
    fedilink
    English
    arrow-up
    13
    ·
    1 year ago

    Someone should get one of these and dd copy all 0xdeadbeefs to the disk

    Then dd it all off and confirm no corruption and it truly is the size it says.

    Seen firmwares of shitty sd cards and drives lie about their storage capacity

        • Aceticon@lemmy.world
          link
          fedilink
          arrow-up
          9
          ·
          edit-2
          1 year ago

          Just as a side note for any reader that doesn’t already know it, the computer ones are 2 to the power of a multiple of 10.

          So 1 kilobyte is 210 (which is 1024) bytes, 1 MiB is 220 (1048576) btes and so on.

          So there is actually some logic behind the wierd looking numbers.

        • lemmyvore@feddit.nl
          link
          fedilink
          English
          arrow-up
          2
          ·
          1 year ago

          And then you have to put a filesystem on it, which has its own metadata – file attributes and folder/file names and so on. If you use NTFS you lose at least 12.5% to the metadata so now you’re down to 11.8 GiB. 😛

          • FaceDeer@kbin.social
            link
            fedilink
            arrow-up
            6
            ·
            1 year ago

            As an amusing side note, I once came across a joke compression program that could compress any data down to zero bytes. It did this by creating directories filled with zero-sized files whose filenames contained the actual data of the file in question.

            If you right-clicked on the folder and asked the OS how big it was, it’d report 0 bytes. But of course all that data still had to be stored somewhere, in the metadata of the filesystem.

            • sugar_in_your_tea@sh.itjust.works
              link
              fedilink
              arrow-up
              1
              ·
              edit-2
              1 year ago

              That’s part of why I use du on Linux instead of df/ls -l to figure out file/directory/partition usage. The former figures out actual size on disk, whereas the latter ignores metadata like the list of files in the directory.

          • sugar_in_your_tea@sh.itjust.works
            link
            fedilink
            arrow-up
            1
            ·
            1 year ago

            The next level is that some flash drives reserve some of the space as a hot failover as memory cells die. Some have this separate from the advertised memory capacity, whereas others may report the total memory on the device even if it’s not available for direct use by the user.

            So a double whammy of GB vs GiB and reserve flash memory to keep the drive going as cells die.