Why is there a recycle bin for each drive?

405 views

I’m assuming it has to do with the way data is stored and how “deleted” data is never truly deleted.

Is this true for other OSs, or just windows?

In: 0

5 Answers

Anonymous 0 Comments

Because there is a map of “free” and “used” blocks for each drive. If you eject a thumb drive, empty the trash, and put the thumb drive back in, the trash on the thumb drive can’t be “empty”.

Anonymous 0 Comments

Files aren’t actually deleted when you delete them.

The OS marks the file as deleted in the Table on the Drive, which is like removing it from inventory. The file is still physically there until something writes over that area on the hard drive.

The Recycling bin is really just a special folder that stores deleted files until you empty it to make it easier to restore files that you deleted by accident.

The deleted data is stored on the drive on which is was deleted for that reason. If you unplug a USB drive for example its Recycling Bin needs to be on that drive so you can take it with you.

There’s a unique recycling bin instance per user in Windows, which only really comes up when you are working with servers.

Similarly in Linux the Trash is the folder .local/share/Trash within your own directory.

Anonymous 0 Comments

The reason its called a recycle bin is because deleting stuff don’t actually wipe it from storage. What’s actually happening, is that you’re telling the computer that it can overwrite that section of the drive if it needs to. When a new drive it detected by the OS, it has to be formatted, which means the drive has to be partitioned, or laid out in a way they particular OS understands.

When you see a download say that it’s “allocating space” that means its telling the computer how much space it needs, and that sector gets sectioned off. If you unplug that drive, the data is still there, it juts can’t be accessed. That’s why every drive also needs its own recycling bin. Because the OS needs a way to know that there are things on that drive that it was told it could overwrite. Deleting something marks that section of the drive on the disk itself, so any computer you plug it into knows what parts can be written to.

Anonymous 0 Comments

Ok imagine a library, it’s a huge library with mobile library vans(USB drives) and even an instant book copier.
But it only has so many shelves.

At the end of each row of shelves(one disk) and on each mobile library van is a big box of index cards. They are far faster to read than the thousands of books. Which are barely sorted. Basically only by the date they were brought in, with new books fit in empty gaps between old whenever possible.

It works really well, you can find any book index card and use it to get the book in seconds.

You decide you don’t need a whole set of books anymore because you just got the 2022 edition.

Instead of going and taking every book from the set out and recycling them you just put their index cards in a smaller box marked “recycling bin”
This lets other librarians know they are allowed to go and put a new book in this spot and get rid of the old one.

You could go and remove the old book but there’s no need right now.

This is a strong analogy for how hard drives work.
They have a file allocation system like an index card sorter that’s literally why old drives were called FAT32 (File Allocation Table 32bit)
Deleting isn’t really deleting unless you delete and clear. The book is still there. Just the index is now in a pile of cards that says “overwrite me first”.
Also ignored in the analogy is the fact our librarian would happily tear books in half to fit the gaps exactly rather than move another book at all. That’s why some disk’s need defragmentation.

Anonymous 0 Comments

Because otherwise whenever you deleted a file it would have to be copied onto the drive where the recycle bin was. What if the file is really big? What if the recycle bin drive is full? Should the computer tell you that sorry, you can’t delete files until you delete some files?