Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hyram

macrumors regular
Original poster
As the title says... how does trash work? As best I can make out it just removes a file from the directory structure and places a link (or something) to it into the .Trashes directory. The file is not actually moved and can be recovered simply by reversing the process. Only when the trash is emptied is the file deleted.... I know, it's not really gone here either, but let's say it is.

Now here's where my understanding fails, if you have more than one disk or partition there are .Trash files located on every volume. Which one does OS X use for trash? One of them? All of them?

TIA!
 
All of them.


Computer A has external HDD connected to it. You delete file/folder X on it (but not empty it).

You connect the external HDD to computer B and open the Trash on that computer and see the file/folder X you deleted on computer A.
Now you empty the Trash and plug the external HDD back into computer A and see that file/folder X is gone.
 
If you have, for example, a USB flash drive, and delete a file but do not empty the trash and then dismount the usb, the OSx 'trash' icon in the doc shows nothing in the trash. As soon as you plug the disk back in, then the trash icon shows there is something in the trash.

Each volume has a .trashes where it keeps track of files that have been "moved to trash" but not emptied. When you empty the trash, the space occupied by the file is then released to the volume's free space.
 
Any time you plug a drive into a Mac it creates a .Trash folder on THAT drive. My USB sticks and my external drive each has its own .Trash folder.

If I throw something away that is on my USB stick, then eject it without emptying, my trash may appear empty because there is nothing on my internal .Trash folder. But when I plug the USB stick back in, the trash is occupied by whatever is in the USB stick's .Trash folder.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.