Comments

You must log in or register to comment.

nmxt t1_iy3h9bq wrote

At the beginning of the computer memory there is a list of all the files with their names, locations and sizes. When you delete a file the record of that file is deleted from the list. From now on the place in the memory with that file’s information is considered free and can be eventually allocated for a new file. For this reason it is possible to “undelete” files within some time period after deleting them - right up to the moment when the data gets actually overwritten, which may be a while.

207

unlikemike123 OP t1_iy3hpkd wrote

So when I delete it I'm just saying "this cannot be accessed and has permission to be overwritten" but it's still "physically" there?

134

Persist_and_Resist t1_iy3hulw wrote

That is exactly yet, and that is why it can almost always be recovered up until the point in which it is written over.

101

boersc t1_iy3j0vp wrote

There is also the action of a 'destructive delete', where the file is actually overwritten with gibberish. This is done when you want to delete a file without ever being able to restore it. This could be the case when handling confidential information, or in case you plan to retire the PC and hard disk.

Basically, you're telling the system to do the 'overwriting' action immediately.

84

ElAdri1999 t1_iy48082 wrote

But if you can do the hammer delete then it's way better, since someone might be able to recover your stuff if not sufficiently deleted

23

[deleted] t1_iy4loxs wrote

[deleted]

3

CrazyMando t1_iy4nqq0 wrote

Sledgehammer

3

Pikassassin t1_iy4py1y wrote

Gigantic electromagnet

2

ElAdri1999 t1_iy4qk5j wrote

All, all is good.

My last dead HDD I removed the magnets(which are fucking strong as fuck btw) and spun the platter while scratching lines on it, when I finished I broke it just for the safety

2

Kriss3d t1_iy4tw7s wrote

If it's a 2.5" hard-drive you can just give it a good whack with a hammer.

When it sounds like a box of matches, your data is safely deleted.

4

cope413 t1_iy4tl9m wrote

Just make sure none of your crypto is on a drive you do that to.

3

yoshhash t1_iy4a8jw wrote

Isn't that the same thing as over writing with the same file name?

4

boersc t1_iy4apc9 wrote

Not perse. In that case you're erasing/reusing the ledger entry, but the 'new' file may get written on a wholly different location depending on how the OS works. But yes, it CAN work the same, if the new file overwrites the exact same spot as the old file. Most OSses work that way.

13

bob0979 t1_iy4blr4 wrote

Many drive cleaner tools will have a tool to wipe free space. They write over every bit that is not occupied with 'undeleted' data or stuff you're using. They replace everything not in use with new junk data that could just be 00000001 for every bit. This takes a fair bit of time but doing this a couple of times can remove any trace of what a specific bit says or even used to say.

If you save somethinn as 'file.name' and it's contents are 00000111 then delete it, it stays as 00000111, but if you delete it then wipe free space it changes that 00000111 to something useless.

5

Grezzo82 t1_iy5aoeu wrote

“A couple” is sometimes not enough, but a few more is considered secure enough for most contexts, though gov will often physically shred the disks to be sure.

I only know for sure with macOS, but I image isn’t this applies to all: the OS has a built in secure erase feature that will overwrite a whole disk enough times to be confident that the data is irrecoverable

1

Any-Broccoli-3911 t1_iy4fv5b wrote

No, even if it's the same filename, there's no guarantee that it will be at the same place. Also, if your new file is smaller, for example an empty file, it can only overwrite a tiny part of it if ever it's at the same place.

3

graebot t1_iy4q95g wrote

Does that work with SSDs? I thought they try to write in a new location each time to prolong life

1

Grezzo82 t1_iy5arcz wrote

SADs are much harder (perhaps impossible) to securely erase, you’re right

1

unlikemike123 OP t1_iy3i3q0 wrote

Ok, so why does my computer say that I now have more memory if it's still there? Shouldn't it technically occupy the same amount of space?

10

unlikemike123 OP t1_iy3i9q4 wrote

O wait, that space is now available to be taken over by new data?

51

Hyperspacehost t1_iy3wgqy wrote

It’s worth thinking of computer memory less like a resource that’s used up, like water being scooped out of a bucket and drank, and more like sand in a sandbox.

Sometimes it’s being used for something meaningful, like being a castle or making the walls of a big hole or having letters written in it, and sometimes it just lying around doing nothing, but there’s not any more or less of it.

You might draw a line around a bit and say, “my castle is here, don’t use anything inside the line”, and at the end of the day you rub the line out and go, “I’m all done now, so do whatever”. Maybe you come back and the castle is still there or maybe someone has knocked it down and built something else with it.

24

Neuro0Cancer t1_iy3iplc wrote

Exactly. The "free" memory is just the available memory, not the empty memory.
In fact memory that has been overwritten can still be recovered.
That's why there is software that "clean" your disk if you want, and it takes a while because basically what it does is just overwrite over and over again the disk until recovery is almost undoable.

14

[deleted] t1_iy41j00 wrote

[deleted]

0

AdmirableOstrich t1_iy470c2 wrote

There isn't really (official) publicly available software to do this, but depending on the storage technology you can often tell not only the current binary state of a memory bit but also the previous one.

As an example, we might say a bit is on if it is at 5V and off at 0V. However, real bits have voltages that vary quite a bit and we just threshold at (say) 2.5V. The actual voltages depend on (among other things) the previous state of the bit. If AB denotes a previous state A and a current state B, you might have something like:

00 -> 0.5V 10 -> 0.9V 01 -> 4.1V 11 -> 4.5V

Note that is doesn't quite work like this. The main point is that with dedicated hardware you can try to read data that has been lightly overwritten. This is why tools intended to purge data will overwrite many times with random bit sequences to minimize the chance of data recovery.

7

Alternative_Log3012 t1_iy4kkgi wrote

You won’t be able to do these sort of voltage reads in the standard OS the computer is running. I’m assuming you will need to remove the drive and put it into dedicated forensic recovery hardware. This could be even more difficult if your SSDs are soldered on like it most modern ultra books.

1

tim36272 t1_iy439pq wrote

Programs like Recuva do it for you. In the basic mode it is just reading all the entries that are marked as deleted.

2

dale_glass t1_iy3ircn wrote

Yup.

Also, fun fact, computers lie to users all the time. Eg, say you're playing a game and save. The game with very high likelihood will tell you it has saved well before the computer actually did it, and resume playing.

Why? Because people hate waiting, and the computer can actually do the writing to disk while you keep playing without making you wait for everything to be done.

There's many, many such optimizations.

8

ThatGenericName2 t1_iy3vbv5 wrote

There's also the lie in the other direction. While I don't think it's practiced anymore, sometimes software would "fake load" in that the program simply just waits for an extra bit of time because people would think that a computer didn't do something properly if it worked too fast.

4

goclimbarock007 t1_iy41vuk wrote

I read an anecdote about a programmer that wrote some sort of script that worked too fast and didn't look like it actually did anything. He added sleep counters and a progress bar to make it seem like it was doing something. A year later he "optimized" the program by cutting the sleep timers in half.

7

ClownfishSoup t1_iy4mkcj wrote

This weird thing happens with cake and cookie mixes as well. You can easily make a mix that just requires adding water and then baking, but people didn't believe they would be any good, so manufacturers changed the ingredients so that the end user has to add oil, milk and eggs to the mix. ie; people were suspicious that the mix was too easy, so they dumbed it down.

2

Brian57831 t1_iy41vtz wrote

Until you crash shortly after saving and the file shows it's corrupted.

1

DeHackEd t1_iy3mcrz wrote

People often ask why deleting files is faster than creating files. The answer is because the bulk of the file's data is NOT erased, because that's considered wasted effort. When the new file comes along it will write over the data, completely unaware of what was once there. So actually blanking out the old data doesn't really accomplish anything and the "delete" is really fast by just dealing with the file listing paperwork.

...unless there's privacy concerns that warrant actually clearing the data, specifically because preventing undelete from being possible is the goal. This is sometimes called "secure delete". But if you're uninstalling a video game, who cares?

4

EcchiOli t1_iy3oori wrote

Mostly useless remark, quoting you,

> People often ask why deleting files is faster than creating files

That's the case for the most common operating systems. However, sometimes, with server hardware + software, it's working differently and deletion can take a long time, as with linux's ext4. It's still relatively fast, but much slower than the others nonetheless.

0

kucksdorfs t1_iy3uze3 wrote

Think of it as a table of content in a book. So when you "delete' a file, you just remove the table of content chapter marker, but not the pages. Then, when you need to write more data, you "write" to the pages then update the table of content.

Things can get more complicated when it comes to flash storage (ssd/flash drive) but only when it comes to overwriting the pages.

2

eotty t1_iy45ump wrote

Imagine a binder with a table of contents, inside the binder there are pages, when deleting a file you just erase the page number, the page is still in the binder but you no longer know where to look. (If you want to find the pages again, there is special software, akin to looking through the binder page by page)

Some documents are several pages long, so when you later write something to the binder and replaces the pages, you might have page 4,7,9 of your document left, thats when it cannot be recovered anymore.

1

Defleurville t1_iy3lxmr wrote

Just to clear up any confusion, the word memory is often used in confusing ways. Expensive working memory (RAM) is used to do stuff (like a kitchen counter), whereas cheaper storage memory (SSD, HDD) is used to keep stuff (like kitchen cabinets).

Current computers have working memory in the 16GB to 128GB range and storage memory in the hundreds to thousand of gigabytes (known as terabytes)

Phones and tablets (and video game consoles) all have working memory, but the numbers are basically unadvertised (~up to 4 GB). Their storage memory is widely advertised, but is often in the same 16-128GB range as a computer’s working memory, which adds to the confusion.

While technically these are all “memory”, when we speak of a computer’s memory, we usually mean working memory (RAM) — not the one freed up by deleting files. But when we speak of a phone’s memory, we usually mean storage memory (SSD)

7

Any-Broccoli-3911 t1_iy4gc16 wrote

Your free memory is the memory your computer is allowed to use, which includes any deleted files even if it's still there. Your computer doesn't care about the information in the free memory, but it's recoverable.

1

21_MushroomCupcakes t1_iy4olnj wrote

Stuff that's "marked for overwrite" isn't counted against total capacity.

I would just like to make the distinction that memory and storage are not the same thing, memory is your RAM and storage is your hard drive.

Many people are using them interchangeably, which will run aground if memory addresses ever come up.

1

clideb50 t1_iy4ece7 wrote

It’s also why it’s good practice to pull the drive out of the computer when throwing it away/recycling it, and then destroying the drive.

1

GoodTodd1970 t1_iy3iiu7 wrote

There are specific programs that allow file "shredding" or "secure deletion", which will overwrite the file location with junk data multiple times. The original file no longer exists and the space is free to use.

16

unlikemike123 OP t1_iy3imhn wrote

Oooh that's how they work, cool!

7

snozzberrypatch t1_iy3r50b wrote

There isn't really any such thing as "deleting" memory so that it becomes "empty". Individual memory locations can either be a 0 or a 1 at all times, there are no other options. You could write all zeros into the memory but that's still data. There is no way to "clear" a memory location such that it's neither a 0 nor a 1. That's why it's most efficient to delete a file by just freeing up those memory locations but not actually overwriting them, unless you're concerned about Russian spies getting your hard drive and restoring deleted data.

5

unlikemike123 OP t1_iy3ympg wrote

I am very concerned about Putin seeing my endless lists of goals that are never achieved tbh, he's a harsh critic

4

Defleurville t1_iy3k9vj wrote

Note that different types of storage handle things slightly differently.

Magnetic storage (HDD, floppies) cannot delete files, it can only overwrite them, so the space will never stand empty.

Flash storage (SSD or a memory stick) will actually delete the file (or parts of the file) at some point (but you won’t know when) and may leave space empty for a while.

Re-writable optical storage (DVD-R) will basically wipe disc contents when you erase it (but is really bad at deleting individual files).

RAM (there are some circumstances where you can delete a file from RAM, such as when using a RAM disk) will retain the file “inaccessibly” until it is either overwritten or the RAM loses power, which causes it to lose all contents.

Note that in every case, “inaccessible” just means harder to access. If the data is there, there are ways of reading it.

3

Kientha t1_iy3m2ka wrote

And this is why flash storage devices are a nightmare for forensic purposes. With magnetic storage, you can attach a write blocker and know the data on the drive won't change so you can compare hash values and verify nothing changed. Flash memory however will randomly change data so you can't rely on hash values to prove nothing has changed

2

Defleurville t1_iy3uvx0 wrote

Another precision for other readers, which I assume Kientha knows, is that when speaking of computers, “randomly” never means randomly, as computers are incapable of doing anything at random (even electronic slot machines aren’t random).

In some cases, in means “not in sequential order”: We don’t continue reading a dictionary from where we stopped last time, but we do go in looking for a specific word, not pop it open and read whatever’s on the page. In computer terms, despite not being at all random, this is called “random access”.

In other cases, it means “made to appear random to a human”. Computers can easily generate values where users can’t tell what it will pick next, but under identical circumstances (the “seed”) it will pick the same values in the same order every time. We generally “cheat” by incorporating the time (down to the millisecond) into generating the numbers, so it’s mostly unpredictable.

Changes in Flash data aren’t random, they’re 100% deterministic and predictable (knowing all the info): they’re just not readily predictable to a user, which is functionally basically the same.

4

squigs t1_iy3u6o8 wrote

Yup. Data recovery firms rely on this.

There are actually some fairly simply tools for most filesystems that will find deleted files.

It's the same with RAM. I think modern systems are more secure, but in the past, hackers were able to break into systems by allocating a large chunk of RAM and seeing if anything that looks like a password was there.

2

Zoso03 t1_iy4gh82 wrote

Think of it like a book. It's going to the table of contents and saying these pages are empty and can be used. Yes words are still on the pages but now you are free to erase what's there and write something new. This is why things can be recovered.

Destructive delete is deleting the table of contents entry then going to pages and erasing everything on those pages. Some methods will then write over the data with garbage several times. So with the same analogy it's erasing the page writing gibberish then erasing it so even the intends of the last letters are impossible to make out.

2

freecain t1_iy3rnv1 wrote

Exactly. If you ever get rid of a computer, it's worth spending the money on a program that will right over the files methodically with null files. Alternatively, just encrypt your device when you first set it up and you should be fine (though encryption could be broken at some point in the future).

1

TheSnarfles t1_iy3w28z wrote

Think of it like that mural the previous tenet painted on the wall at your apartment. The landlord just paints over it, but you could recover it if you really wanted to.

1

therealpigman t1_iy3wumy wrote

Some memory cards have the ability to write the deleted data with all 0s in the places, but that isn’t guaranteed behavior and usually takes more time and energy than allowing the old stuff to be overwritten

1

tweiss84 t1_iy4il9y wrote

This is why you can sometimes recover data from a corrupted or crashed hard drive. In computer forensics they find "deleted" files.

Not removed, just deallocated.

1

Terr_ t1_iy4rszf wrote

Imagine that computer RAM or a classic hard-drive are like a bunch of tiles an Othello/Reversi game board.

When you delete a picture, only the tiles that say "photo.jpg is inside tiles X to Y" are erased and flipped to be white-side up.

The actual tiles in spaces X to Y that had all of the pixels are usually left untouched, unless we have a paranoid reason to go through and change them.

In no case are any tiles being removed from the table--that would represent damage to the system.

Later those X-Y tiles may be changed, but usually because we've decided to put something new there.

1

Kriss3d t1_iy4to8g wrote

Yes. That's how undelete programs works.

Think of a drive as a book. You got the list in the first part with the pages where each chapter begins and ends and what the chapter is called.

That's in the computer called a partition table.

And instead of a chapter it's a file. But pretty much like that.

So if you want to delete a drive you don't delete the actual pages. You just clear the index page where the name of the chapter is.

So if there's a range of pages that have no chapter name then it means you could replace the chapter with a new chapter ( so to speak) and add a chapter name for it.

This makes formatting a big drive quick. You simply erase all the names in the index.

All the data is technically still there.. But because the index said it's empty, the computer will Just overwrite that part and add a new name in the index.

That's actually exactly how a drive on a computer works. Ans also why you can undelete files or drives if they haven't been overwritten.

1

PaxNova t1_iy3vssw wrote

On older hard drives with magnetic memory (not the fancy M.2 and flash stuff we have now), you had to defragment drives.

Data was stored magnetically and you had to move a magnetic reader head over it to recover the data. Because the data took up physical space, it was faster for hard drives to store related data close together. As you deleted some files, the remaining files stayed in the same physical place. To make things faster, you would copy your files every now and then to condense them. Bringing all those fragments together was "defragging."

In modern drives, it takes the same amount of time to access all parts of your hard drive, so defragging is no longer necessary.

0

vo0do0child t1_iy4c4a8 wrote

Why are the memory addresses abandoned rather than covered over with 0’s?

2

sauprankul t1_iy4fw41 wrote

To save time. Hard disk writes take forever, and the disk has better things to do than overwrite deleted data.

SSD overwrites would increase wear on the flash. You have a limited number of writes before the flash starts becoming unstable.

3

nmxt t1_iy4fx21 wrote

Because writing them over with zeroes or anything takes considerable time. Basically deleting files would then be as slow as copying them. That doesn’t apply to modern SSDs though, they do reset the memory taken up by deleted files.

1

vo0do0child t1_iy4h9ef wrote

Interesting, thanks. You’d think the OS would provide the user with the option to do a “deep delete.”

1

Brayzure t1_iy4jx8i wrote

There's a built-in function to overwrite your "empty" hard drive space with random data. Problem is it takes forever (and isn't easily accessible). There's a reason why the option isn't available to the average user.

1

Foolfog t1_iy4g7in wrote

Because specifically changing it rather than just 'forgetting' about it would be just unnecessary extra work, unless you aim for extra safety

1

Donno_Nemore t1_iy499kh wrote

This answer is not correct. The post describes a file allocation table as if it were in the beginning of memory. In the simplest designs, the file allocation table is at the beginning of the storage volume, not in memory. In more complex systems, such as distributed file systems, the file allocation table can be stored completely separate for the data storage systems.

1

sauprankul t1_iy4fiar wrote

nmxt is using "memory" the same way OP is: to refer to storage. Technically, storage is a type of memory. Not all memory is RAM.

3

Donno_Nemore t1_iy4icn8 wrote

The sub is eli5. In common vernacular memory refers to RAM or ROM. The first thing you should explain to a 5 year old is the right words, to make sure you understand what they are asking.

Yes, it is possible to have memory mapped files or a part of storage that is used like non-volatile memory, but it isn't what is commonly referred to as memory.

0

sauprankul t1_iy4iqpg wrote

Ok. So then the answer isn't incorrect. OP used a word incorrectly and the answer used that word the same way OP did.

3

MeatHamster t1_iy4bh4g wrote

This is the reason I will NEVER sell my old computers with old hard drives even after clearing them of the data.

But with few full formats and rewrites you sjould be ok, I'm just paranoid.

1

sauprankul t1_iy4fmit wrote

Just... take a hammer to it. They're hardly expensive.

2

ClownfishSoup t1_iy4lt2f wrote

You are confusing "file storage" with "memory".

ie; harddrive, floppy disk, solid state drive storage versus RAM (Random Access Memory).

Most operating systems use a part of file storage for swapping out memory, yes, but that's not really what they OP is asking.

1

lovejo1 t1_iy4rp0a wrote

And moreover, sometimes even the record itself is not "deleted", simply marked as deleted.. so even the file name and metadata is mostly there.

1

LlamadeusGame t1_iy3ma45 wrote

Something worth noting is the only spinning platter HDDs and very few early SSDs actually work the way being described here (old files are actually still there and just waiting to be rewritten)

Modern SSDs use TRIM operations to immediately clear data from blocks as soon as you actually delete it. You'd have to manually disable TRIM, and some SSDs have TRIM instructions as part of their on chip firmware.

28

Professor_Dr_Dr t1_iy3zyzt wrote

https://www.crucial.com/articles/about-ssd/what-is-trim

Here is a short explanation by Crucial, so yeah. You can't restore files once they have been deleted in modern SSDs it seems. TIL

7

YouMeanOURusername t1_iy41xk0 wrote

You can still recover data post delete and TRIM on modern SSDs. The methods available for modern SSDs are certainly less reliable and consistent then in the past but certainly not impossible.

7

sauprankul t1_iy4hqkl wrote

This is misleading. TRIM does not immediately "clear" ie "set to 0" deleted pages. They simply mark them as "do not collect" for garbage collection. This way, when the GC algorithm runs, it doesn't copy over the useless pages to new blocks. However, afaik, SSDs never actually destroy deleted pages unless overwritten by new data.

4

LlamadeusGame t1_iy4j2t8 wrote

It's a distinction without a difference. The drive gets managed during garbage collection, as in a block is copied and reorganized to a different block so the old block can be cleared (e.g. set to 0).

TRIM tells the drive "hey don't bother copying this stuff, and clear it with the rest of this block " effectively deleting it, not just delisting it. Garbage collection is(effectively) constant, and deleting a file is going to clear many many blocks, causing those blocks to be fully zeroed on the next pass.

So while technically true that TRIM is not a deletion protocol directly, it results in the deletion of data on the next garbage collection pass which is normally milliseconds after you delete a file.

3

sauprankul t1_iy4j8jr wrote

Wait, are you saying that garbage collection zeros deleted blocks?

1

LlamadeusGame t1_iy4k8d6 wrote

As far as I understand, yes. There is conflicting documentation out there, and I'm not an engineer so take this with a grain of salt.

That being said, in order to write new data to a block it first has to be zeroed and then written. The idea behind trim and GC is for the block to already be zeroed before you'd want to write to it, therefore improving the perceived response of the drive. There are of course other purposes behind the operation, but it makes sense that if you need to zero an entire block BEFORE you can write to it, you'd want to zero it preemptively and not immediately before a write.

Higher in this comment chain is an article from crucial who describes trim & GC working exactly in this way if you'd like some reading on the subject.

2

mtfellie t1_iy45afo wrote

It's worth noting that if you're not on a windows machine or a OS X machine you may need to manually configure TRIM, as many *nix distributions do not have it enabled by default

3

Optimal_Traffic1237 t1_iy3i3hc wrote

Here's my ELI5 version:

Think of your computer's hard drive as incredibly large kitchen table.
And each file on your computer is a piece of paper that gets placed on that table.

The computer keeps track of where each file/paper has been placed so you don't accidentally overwrite something.

When you delete a file, you are not removing the piece of paper. But telling the computer that "this space is now empty".
So the next time you need to save a file, the computer is free to put the new file/paper on top of the old one.

12

gobe1904 t1_iy4frxs wrote

That is a really good example of this

1

Donno_Nemore t1_iy42xaw wrote

The question title does not match the question body. Memory and storage are distinct components in many systems.

Most memory systems require an active power source to maintain the values stored in it. As soon as power is lost the energy in the memory begins to shrink and what was in the memory is lost

Storage keeps data even when the power is off. Early types of storage were much slower than memory. Deleting a file is done by changing the values stored. How the file is deleted is determined by a combination of the program deleting it, the operating system being used, the storage format, and the specific storage hardware.

11

BigChiefS4 t1_iy4d7du wrote

This is a huge pet peeve of mine. My non-computer illiterate friends me ask me, “How can I clear up my memory? It’s full.”

You can’t. You can’t clear up memory like you do with storage. Memory and storage are two distinct things. They don’t understand the difference.

Most of my friends don’t ask me computer questions anymore because I get all pedantic on them.

8

iswedlvera t1_iy4fawc wrote

You can 100% clear up memory by closing all those chrome tabs.

3

BigChiefS4 t1_iy4fm5s wrote

Memory, yes. Storage, no.

OP is conflating memory and storage. He says memory but means storage.

2

Magic_Neil t1_iy4ja6g wrote

Yeah, this bugs the bejesus out of me too. I can only assume it’s because “it’s all gigs”, but you’d think that eventually people would figure out the nomenclature of memory vs drive space or disk space or storage of F’n whatever.

2

miraska_ t1_iy3mqtg wrote

There is three ways:

  • computer says "I don't if this sector of memory would get rewritten". Most of the data restoring software works by ignoring it

  • computer will rewrite fill memory sectors with zero. Data is 0s and 1s that have meaning, if everything is 0s, there would be no meaning.

  • physical way - do something with hardware to erase data

3

FellowConspirator t1_iy3wxpl wrote

Files can be anywhere, so there’s a big table in a predetermined spot that lists all the files and the place(s) where the file is stored. You can also look there to see what space is in use by files.

When you write a file, the computer looks for a spot that isn’t in use, reserves it, puts stuff there, and updates the table so it shows where the file is.

When you delete a file, the computer simply removes the entry in the table that says where it is and what area was reserved for it. There’s no need to delete the actual data because once the name disappears from the table, it might as well not exist as far as programs are concerned.

Since the space isn’t reserved anymore, the space is free to be used to store other files in the future and will eventually get written over.

3

boersc t1_iy3iqtn wrote

It's like a book. The start of the book has a table of content, that lists all the chapters in the book. If you would want to remove a chapter, you could remove the entry to that chapter from the Table of Contents.

So, effectively, not much is removed, only the entry in the Table of Contents is gone, so you cannot easily find the chapter again. It is still possible, but takes a lot more efffort (skipping through all pages). You could even overwrite the pages of that chapter with something else, adding an entirely different chapter, as long as the chapter is of the same size or smaller than the one you just removed.

Same happens with files on computer storage. There is an index of where all files are located. By removing a file, the entry in the index is removed, effectively making it a lot harder to find that file again, and even allowing other files to be written on the same spot previously filled with that file.

2

mtheofilos t1_iy3ulgq wrote

TL;DR: Files on the disk use space, not memory, the file still exists but it is no longer accessible and the operating system doesn't count it anymore to calculate free/used disk space.

You may be confused with memory and space. Memory refers to what running programs use, e.g. what Chrome uses right now to display stuff, space refers to the capacity of a drive (HDD, SSD, etc). Computers have a file system, which keeps track of where files are located in the disk and gives the programs of your computer some tools to interact with them. When you delete a file, you basically unlink it from the system. The file is no longer accessible, and if the file system supports a trash bin, it moves the link to the file there, so you can link it back to its original position (e.g. to a path like C:\Users\MyUser\Desktop), the links in the path are basically the "\". Once the file is removed from the trash bin, it is no longer accessible from anywhere like Trash Bin, C:\, D:\, e.t.c. and then depending on the hard disk's type (HDD, SSD) does one of the two things, either marks it as free space and then a new file may overwrite the old one (HDD), and for SSDs it gives it a signal that the area the file is no longer used, so the SDD will manage the used space on its own. So if that area is not touched at all, you can use some programs that will scan the disk and they can "recover" the file if it was permanently deleted. What they do is actually locate the file with some tricks and then create a new link so it can be traced again (C:\...\Desktop\MyRecoveredFile.pdf). To permanently delete a file for good, a program will just write a bunch of zeroes on top of the file and then unlink it from the system, like what you would do with a correction tape or fluid on a piece of paper to "remove" the letters and write something new on top. Now that you learned about links, you may understand that when you move files, you actually don't physically move them you just move the link in the file system, that's why cut/paste files is faster than copy/paste.

2

PrinceWalnut t1_iy43ict wrote

So generally speaking, if you're a normal consumer user of tech, deleting a file just deletes a record on your hard drive that points to where the memory address that locates your data is. The data itself isn't actually deleted unless you do a memory wipe. It will eventually be overwritten, because any memory that isn't reserved by a set of records is considered "free" to the OS to overwrite, even if there was previous data there, but until that point that data still exists there.

You can truly delete a file by wiping the memory (usually done by taking the set of memory for the file and overwriting everything to some empty state). But the default that happens when you delete a file doesn't do this because it's computationally expensive to do this when there's no real reason to.

As a security tip, if you're ever trying to actually delete data from a computer in a way that ensures it's not accessible, you want to do a memory wipe and overwrite the entire drive to an empty state. Just "deleting" the files will actually leave all the data there and just delete the records that say where the data is. Anyone good with computers can recover all of that unwiped data despite there not being a stored record for it because the data is never overwritten. Always fully wipe your drives before transferring ownership of computers with sensitive info.

2

MJGM235 t1_iy3snsh wrote

Nothing is actually deleted. The computer just removes the file path and the information gets overwritten. There is recovery software that can help recover lost files that have been accidently deleted. If you really want to erase something, run a program called BC Wipe which will overwrite files 5x to make sure they are thoroughly gone.

1

PSUAth t1_iy3x5rn wrote

Think of your hard drive as having a bunch of small cubbies in it, not one massive storage hole. These cubbies are much smaller than most typical files these days. So when you have a file to save, the computer breaks up that file into the correct number of pieces to fit into those cubbies. It could start out as it just goes from cubbie 1 to 30 for one file, 31 to 40 for the next, and so on.
Now in order to be useful, the computer has a log of all these files with the locations of all of the cubbies to make up the full file. It also has a list of "available" cubbies to put new files in. So when you first start out it's possible to go from cubby 1 to the end. But as you use the computer and make and delete files, these cubbies are "out of order" but the computer keeps track of what cubby is "used" and what is "open". Now when you delete a file, the computer just deletes the entry of the file and the associated cubby locations, moving them to the available list. It doesn't clean out the contents, because well it doesn't need to. So now a new files needs to be saved, it is given a list of cubbies to use and as it moves through them just tosses what was previously left in them and places the new file info in there.

1

nugnugs t1_iy4dznz wrote

imagine you're playing in a sandbox at the playground. you have a corner to yourself and you built a sand castle. This is a computer taking up memory.

Your mother tells you it's time to go home. you leave the sandbox, but you don't knock down your castle. it stays up after you leave. this is memory being deleted.

Your sand castle will stay up until another kid comes to knock it down, so they can build their own thing. This is memory reallocation.

1

unlikemike123 OP t1_iy4hee9 wrote

Cheers all for the interesting answers. Now I know my computer is lying to me in several ways lol.

1

Brave_Promise_6980 t1_iy4i6hy wrote

Rather than trying to delete - encrypt the drive with a tool like bit locker and then that’s it - I would have more confidence in this than a secure delete, or formatted and over written

1

pm_me_n_wecantalk t1_iy4l6n6 wrote

You know when you read a book, it has index of all of its chapters etc. files on hard disk are stored in similar way. There is an index which maintains which file is where.

When you delete a file, it’s entry is removed from the index. The file still exist but it can’t be located from index (which is used by all programs to locate files).

The file which still exist can be over written by others with new respective entry in index.

1

ClownfishSoup t1_iy4lj5a wrote

You may be confusing "memory" with "disk storage".

For memory, turning off power basically deletes all memory as it needs power to "maintain state".

For disk storage, deleting a file just means removing any reference to it, but leaving the contents on the disk as it's more work to "erase" the contents.

Imagine you have a large book like the Bible, and each story is a marked with a bookmark. "deleting" the file means just throwing the bookmark into the garbage. The text is still there, but there is nothing to point to it. If you write a new file, you put a new bookmark where there is space, maybe it's on top of the old one, then you just write over top of the old text. Overwriting the data changes it, it doesn't accumulate or anything.

1

Pretz_ t1_iy4npvr wrote

Say for example that when you get home from work, you put your wallet in a drawer and then write down on a piece of paper instructions how to find it. The following day, you throw away the piece of paper and forget where your wallet is. It's still technically there, but you can't find it; the wallet has been deleted.

Eventually you get a new wallet and need to put it somewhere. You open the drawer and see your old wallet there. It's irrelevant now, so you throw it out, put the new wallet in, and write down on a piece of paper instructions how to find it.

The wallet is a computer file.

EDIT: At least, this is the olde way of doing things. Looks like the youths have gone and made things all different and frightening.

1

Flair_Helper t1_iy4u044 wrote

Please read this entire message

Your submission has been removed for the following reason(s):

  • ELI5 requires that you search the ELI5 subreddit for your topic before posting. Users will often either find a thread that meets their needs or find that their question might qualify for an exception to rule 7. Please see this wiki entry for more details (Rule 7).

If you would like this removal reviewed, please read the detailed rules first. If you believe this submission was removed erroneously, please use this form and we will review your submission.

1

745395 t1_iy4umi2 wrote

Can someone explain why when a post is removed, it's still posted along with comments? Clearly, the post is NOT removed.

1

blaskkaffe t1_iy4jtdm wrote

There are two types of computer memory, the first one is remembering what is being done right now, it is called RAM and is what people mean most of the time when they talk about memory. It is used for example to know what pictures to show or what numbers to count with. It is similar to how you put a book in your hand when you are reading that book. All the text and images in the book is easily and quickly accessible just by flipping a page. It contains the instructions for what the computer should do, for example “delete a file”. When you are done with information in that memory you either put it back in the “shelf” or throw it away.

The other type of memory is what you are asking about, usually a Hard Disk Drive (HDD) or a Solid State Drive (SSD). It is usually called storage since it is used to store data.

It is similar to your bookshelf or a library. In the shelf there are many books that is like files. To delete a file you could remove the book from the shelf and destroy it immediately, but that would take too long time. What the computer instead does it has a long list of what books you have, how many pages they have and where they are currently sitting in the bookshelf.

When a file is deleted you just erase that book from the list, the book is still in the shelf. Next time you get a new book to put in the shelf you look in the list, check where there is a empty spot, go to that shelf and if there is any book in the spot you want to put your book you just remove the old book and put your new book there instead. The old book is destroyed and is impossible to get back at the same time as the new book is put in the shelf.

0

BigChiefS4 t1_iy4pvba wrote

I'm going to be pedantic here - there is only one kind of memory in a computer and that is RAM (Random Access Memory). The data that is in memory is stored there as long as the computer is on and the operating system is fully booted. All of your programs that are running (like Chrome, Photoshop or Notepad) are running in memory. When you reboot your computer or power it off, whatever is in memory gets cleared out, or deleted.

Hard drives, whether they be spinning disks (HDD) or SSD's, are storage, not memory. The data stored in them is retained after a reboot or power cycle of the computer.

OP's wording of his question and your answer are the reasons why people get confused about memory vs. storage.

0

blaskkaffe t1_iy5igkn wrote

First this is r/explainitlikeimfive, accuracy is not the highest importance but a simple to understand general (but somewhat accurate) explanation is usually enough.

Secondary, there are two types of memory in a computer, primary memory (RAM, CPU cache and ROM) and secondary memory (SSD, HDD, CD, Floppy disks, tape or any other storage media).

Those two definitions are what is generally used in computers and are a very simple way of differentiating between the two categories of memory (short term vs long term) which is what you call memory and storage, both are types of memory.

The confusion comes from that Random Acces Memory contains the word “memory” and Hard Disk Drive, Solid State Drive, Compact Disk etc. doesn’t contain the word memory even though they are all different types of long term memory storage technologies.

Here is one of many links that explains the different types of computer memory in more detail: https://www.enterprisestorageforum.com/hardware/types-of-computer-memory/

1

BigChiefS4 t1_iy5jgv8 wrote

Nobody I’ve ever worked with in the hardware side of IT has ever called storage “memory” and I’ve been doing this for well over 30 years.

When our devs refer to memory, we are always asking them to differentiate between RAM and storage.

0

blaskkaffe t1_iy79c47 wrote

I agree with that, not many people call it memory, unless it is a memory card or similar. It is however still a type of computer memory and OP is asking how to erase a file in memory, which is why I try to clear up that there is two types of memory. I edited the original post to clarify that primary memory or even more specifically RAM is what people usually call memory, and that secondary memory is often called storage.

But saying you are being pedantic but then saying something that is technically entirely incorrect is not being pedantic and simply ads to confusion.

2