And additionnaly, isn’t there a way to exploit this so we can store more stuff on PCs?

Edit: can’t thank you all individually but thanks to everyone, I learnt something today, appreciate all of your replies!

  • zeppo@lemmy.world
    link
    fedilink
    English
    arrow-up
    34
    ·
    2 months ago

    Because of how filesystems work. There’s basically an index that tells the OS what files are stored where on the disk. The quickest way of deletion simply removes the entry in that table. The data is still there, though. So a data recovery program would read the entire disk and try to rebuild the file allocation table or whatever by detecting the beginning and ends of files. This worked better on mechanical drives than SSDs.

    • pearsaltchocolatebar@discuss.online
      link
      fedilink
      arrow-up
      17
      ·
      2 months ago

      Yup, and many security suites will include a tool that writes all 0s or garbage to those sectors so the data can’t be recovered as easily (you really need multiple passes for it to be gone for good).

      • zeppo@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 months ago

        right, i’m super out of date but you;d want to do shred or some dd dev/random > device thing to securely erase them.

  • AstralPath@lemmy.ca
    link
    fedilink
    arrow-up
    21
    ·
    2 months ago

    If you remember the VCR days, imagine your hard drive is a copy of Bambi. You, in preparation for a family event need a tape to store footage of the event on. You decided that you haven’t watched or wanted to watch Bambi in a long time so you designate that tape as the one you’re gonna use when the party day comes.

    At this point your hard drive (the copy of Bambi) has been designated as useable space for new data to be written in the future.

    Bambi is not lost yet and wont be until you write to that tape, therefore if you wanted to you could watch Bambi in the time between now and the party even though you plan to overwrite it. Once Bambi is overwritten, its no longer recoverable but the interim between now when you designate it as useable space and when the space is used, the data persists.

  • CameronDev@programming.dev
    link
    fedilink
    arrow-up
    21
    ·
    edit-2
    2 months ago

    You have a notebook. On the first page, you put a table of contents. As you fill in pages, you note them down in the table of contents at the start.

    When you want to delete a page, instead of erasing the whole page now (there are hundreds free still, why waste the effort), you erase the entry in the table of contents.

    Now if someone finds your notebook, according to the table of contents there is no file at page X. But if they were to look through every single page, they would be able to find the page eventually.

    This is loosely how file systems work. You can’t really use it to boost storage, the number of pages is finite, and if you need to write a new page, anything not listed in the contents is fair game to be overwritten.

  • lurch (he/him)@sh.itjust.works
    link
    fedilink
    arrow-up
    11
    ·
    edit-2
    2 months ago

    it’s inefficient to really erase the data, so what happens usually is: it gets marked as deleted. the data only gets overwritten when another file is written in the same data area, which often doesn’t happen immediately. even if a drive gets formatted the empty metadata structures of the new partitions and file systems are just written on top. since they have no file entries yet, the previous data just sits there invisible and inaccessible until new files are created and maybe overwrite a bit of the old data.

  • Transient Punk@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    9
    ·
    2 months ago

    Often times when you delete something off a computer, the computer simply deletes the address of the data, but doesn’t overwrite the data.

    Think of a map for a city. If you delete a house off the map, you may not be able to find it anymore, but the house is still there. It’s the same for computer storage

  • _____@lemm.ee
    link
    fedilink
    English
    arrow-up
    9
    ·
    2 months ago

    It’s because hard drives don’t turn every written bit into a 0. Instead it tells the operating system that the region you deleted is free for writing again.

    At some point in the future through usage that region will either be corrupted or have something completely different in it (from our perspective though it may read as corrupt it will still work as expected when written into)

  • hddsx@lemmy.ca
    link
    fedilink
    arrow-up
    7
    ·
    2 months ago

    No, there is no way to store more stuff on PCs.

    Hard drives are devices that store 1’s and 0’s. There’s a bit more complication, but the short answer is that you can wipe a file system, but the files are still there.

  • jimmydoreisalefty@lemmy.world
    link
    fedilink
    arrow-up
    9
    arrow-down
    3
    ·
    2 months ago

    IIRC: Data has not been overwritten yet; it is just shown to be open to being rewritten.

    It can still be recovered with minimal corruption if the device was not used too much, where open storage would be eriten over.

  • orcrist@lemm.ee
    link
    fedilink
    arrow-up
    6
    ·
    2 months ago

    Generally speaking, writing new data is what actually erases old data. So no, you can’t exploit it for extra storage space.

  • TheBananaKing@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    2 months ago

    A file comes in two parts: the actual blocks of data that hold the file itself, and a directory entry with the name of the file, and the location of the first block.

    When you delete a file, it only scrubs out the directory entry, and re-lists the data blocks as available for use.

  • 1rre@discuss.tchncs.de
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    2 months ago

    Storage forensics can look into variations in charge to suggest “this used to be a 1” or “this used to be a 0”

    To store more data that way, it’d have to be analog data in reality, as otherwise data loss due to charge decay would be immense so you’d need so much error checking you’d lose most of the storage savings

  • InFerNo@lemmy.ml
    link
    fedilink
    arrow-up
    2
    arrow-down
    1
    ·
    2 months ago

    On ext4 drives 5% is reserved for the system in emergencies. Since disks are getting larger over the year, 5% is a pretty big chunk. It’s possible to tell the system to use a lower reserve. It’s the only instance I know where you can seemingly gain more storage out of thin air. I’ve used it in moments of emergencies when a servers’ disk was too full to function.