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
    27
    ·
    18 days 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.

  • _____@lemm.ee
    link
    fedilink
    English
    arrow-up
    8
    ·
    18 days 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)

  • NutinButNet
    link
    fedilink
    English
    arrow-up
    8
    ·
    18 days ago

    Think the best analogy I can give you is this:

    If you write a check and give it to someone, the money has not yet been taken out of your account until they turn that check into cash or deposit it into their bank account.

    Until that time, it is something you are keeping a record of to say “I wrote a check for $700 so I am down $700 in my checking account.” Even though the total balance today says $1700, you know that it really is supposed to be $1000 that is available to be used for other expenses.

    If you wanted to recover that $700, all you need to do is shred the check before it gets to the bank or check cashing place or contact your bank to tell them to not process this check. Thereby, you have essentially “recovered” the $700 you intended to give to someone else.

    This is similar to how your hard drive works. When you tell your computer to delete a file, your computer’s operating system basically tells you that it’s been deleted and no longer lets you access it by normal methods, but that data still exists in a form awaiting an actual deletion. Once you create a new file, your operating system remembers that it had deleted 100MB earlier in the day, so it can now use 25MB of that 100MB it reserved to overwrite some of that file that was deleted, in a sense. However, this whole time, your operating system told you that you had an extra 100MB immediately after you deleted that file, even though it was really being reserved to eventually be replaced.

    Your operating system speaks in binary language of 1’s and 0’s and this file existed as a bunch of 1’s and 0’s. When something else got overwritten, it took some of these 1’s and 0’s from the old file to be turned into space for the new file that is to be created.

    So as long as it’s recent, no new data has been written to the drive, and the computer hasn’t been restarted, the file is still effectively there in the binary language, just not in plain text to you. However, as time goes on, new data is written, or the computer is restarted, then it becomes much more difficult to restore the file. This is mainly because data is always being written to the drive due to the computer doing other things in the background in addition to the things you do on the computer.

    But there isn’t any way to exploit this as this is all due to how much data is available. You have a 1TB drive in your computer and your computer will only ever report 1TB of available storage. It will never report to you that you have more storage unless you’ve done some trickery and even then, it’s just playing with the numbers that you see. Fake USB drives do this where someone sells you what they tell you is 2TB but is actually 16GB and the file has been written to trick the operating system into thinking it has 2TB. If you try to copy more than the actual 16GB of available space, you get an error.

  • jimmydoreisalefty@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    18 days 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.

  • TESTNET@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    18 days ago

    Because as long as it isn’t overwritten it can sometimes reside in a residual way in the storage sectors on the drive, these hdd scanning software’s check through the sectors for data hiding in them some successfully some not as successfully, therefore some will find more or less data than others do as well.

    This is why data disappears on drives as well when a physical issue causes the sectors of the drive to begin to stop working aka “bad sectors” this makes the data start to seemingly magically vanish or corrupt if it’s still operating and booting into Windows you can at times witness the data/folders and or files present in folders one moment and missing from the OS the next, that’s an indictator often of an imminent drive failure due to bad sectors In this scenario it get’s less likely you’ll recover the data the longer the drive is in use because more of the sectors will probably die. You want to be doing the recovery and not using the drive in Windows in this instance. I say Windows but it applies to any HDD with any OS installed really.

  • orcrist@lemm.ee
    link
    fedilink
    arrow-up
    4
    ·
    18 days 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
    3
    ·
    18 days 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
    2
    ·
    18 days 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