An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Previous Thread
Next Thread
Print Thread
Trash Problem
#28320 03/08/14 10:20 PM
Joined: Aug 2009
Likes: 2
Douglas Offline OP
OP Offline

Joined: Aug 2009
Likes: 2
My MacMini was acting strange and I ran Disk Utility and it came back with several problems and said the disk needed to be repaired. I booted into my clone and used Disk Utility to repair which it did. I Repaired Permissions and check the disk again and it showed no more problems.

Then I discovered that when I tried to trash a file it was deleted immediately and not going to the trash. I opened Terminal and typed in: sudo rm -rf ~/.Trash

That fixed the trash but it keeps reverting back to deleting files immediately instead of putting them in the trash. Finder Preferences does NOT have secure empty checked.

Anyone know what is causing this and how I can make sure files go to the trash instead of being deleted immediately?

I'm using OSX 10.6.8

Thanks

Re: Trash Problem
Douglas #28321 03/08/14 11:08 PM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
Repairing your home folder permissions may help; see this .


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Re: Trash Problem
artie505 #28322 03/09/14 05:50 AM
Joined: Aug 2009
Likes: 2
Douglas Offline OP
OP Offline

Joined: Aug 2009
Likes: 2
Wondering why Repairing all Permissions with DU would not also fix them for the Home Folder.

Re: Trash Problem
Douglas #28323 03/09/14 08:28 AM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
I can't tell you any more than that DU has never touched your home folder, and that home folder perm repairs was not possible - at least by any means of which I'm aware - prior to its introduction in Snow Leopard.


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Re: Trash Problem
artie505 #28325 03/09/14 01:43 PM
Joined: Aug 2009
Likes: 4
Offline

Joined: Aug 2009
Likes: 4
Given earlier discussion — under Disk Permissions — indicating the essential uselessness of DURP, why would 'repairing' one's home folder have any utility?

Running OnyX might prove more rewarding.

Re: Trash Problem
artie505 #28326 03/09/14 03:30 PM
Joined: Aug 2009
Likes: 3
Moderator
Offline
Moderator

Joined: Aug 2009
Likes: 3

"Reset Home Directory Permissions and ACLs" was introduced in OS X 10.5.



dkmarsh—member, FineTunedMac Co-op Board of Directors
Re: Trash Problem
grelber #28328 03/09/14 04:50 PM
Joined: Aug 2009
Likes: 7
Online

Joined: Aug 2009
Likes: 7
Originally Posted By: grelber
Given earlier discussion — under Disk Permissions — indicating the essential uselessness of DURP, why would 'repairing' one's home folder have any utility?

Running OnyX might prove more rewarding.
I had a situation where I had to restore my entire folder of photos from my Time Machine backup. I got a message that I did not have sufficient privileges to copy my own folder! As a workaround, I restored several photos at a time from that folder until I had all of them, a tedious process. Subsequently, I repaired user permissions.

Truth to tell, I don't know if that worked because I haven't tried any other TM restorations since. I suspect, however, that it may have helped. (At least, it seems logical.)


Jon

macOS 11.7.10, iMac Retina 5K 27-inch, late 2014, 3.5 GHz Intel Core i5, 1 TB fusion drive, 16 GB RAM, Epson SureColor P600, Photoshop CC, Lightroom CC, MS Office 365
Re: Trash Problem
grelber #28331 03/09/14 11:09 PM
Joined: Aug 2009
Likes: 1
Offline

Joined: Aug 2009
Likes: 1
In any Unix system, files have "owners," and additionally they have permissions that say who the owner is, what access the owner has, what access a particular group has, and what access everyone has.

The owner of files you create is (usually) you. There's a fly in the ointment, though. Sometimes, when you do something like re-install a system, the owner and permissions can get confused.

My login name on my computer is "tacit," but the owner on my files is 502. In Unix systems, every user has a number, and that number is the "owner" of the file.

So if I have to restore my system, and I end up re-creating the user 'tacit', I will still have the same name...but my number might not be 502 any more! Say after I restore my system, 'tacit' now has the UID 503. All my old files are owned by 502, not by 503, so the system will tell me I'm not allowed access to them.

Updating home folder permissions, as near as I can tell, makes sure that all the files in your home folder (which includes your documents, pictures, and music folders) are owned by who it says on the tin. That is, if I log in as tacit and I do the repair, it will look up my UID and make sure the stuff in tacit's home folder is in fact owned by 502 (or whatever my UID happens to be).


Photo gallery, all about me, and more: www.xeromag.com/franklin.html
Re: Trash Problem
dkmarsh #28332 03/09/14 11:28 PM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
Thanks for correcting me. (I searched for an Apple doc on the subject and was surprised that I couldn't find one. As always, good searching on your part.)


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Re: Trash Problem
grelber #28334 03/10/14 03:11 PM
Joined: Aug 2009
Likes: 4
Offline

Joined: Aug 2009
Likes: 4
My earlier question (see below) wasn't idle or rhetorical.

Originally Posted By: grelber
Given earlier discussion — under Disk Permissions — indicating the essential uselessness of DURP, why would 'repairing' one's home folder have any utility?

Re: Trash Problem
grelber #28335 03/10/14 03:48 PM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
I'll try to build on tacit's post (the easy way)...

Unless you, yourself, have set custom permissions, the correct permissions for every folder and file in your home folder are "pre-ordained" when you install OS X; therefore, out-of-whack permissions can be readily and accurately detected and corrected.

tacit has described one way in which home folder permissions get o-o-w, and while I'm not up on the details of how it happens in other instances, I do remember at least a few posts over the years that dealt with users losing ownership of stuff within their home folders. (I suggested repairing perms because I think I remember incorrect home folder perms being at the root of the "immediately deleted trash" problem. [I searched, but fruitlessly.])

Hope that helps.


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Re: Trash Problem
artie505 #28336 03/10/14 04:25 PM
Joined: Aug 2009
Likes: 4
Offline

Joined: Aug 2009
Likes: 4
Then I take it that it would only be within such a restricted circumstance that DURP would actually be viable and that in all other situations it is indeed 'useless'.
Many thanks.

Re: Trash Problem
grelber #28337 03/10/14 06:30 PM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
DURP (Disk Utility Repair Permissions) runs from your OS X installation; home folder permission repair runs from your install disc or recovery partition and is a different, albeit similar animal.

Edit: I suspect that in saying "DURP would actually be viable" you meant to say "repairing permissions would actually be viable".

Correction to "I suggested repairing perms because I think I remember incorrect home folder perms being at the root of the "immediately deleted trash" problem": I should have said "incorrect permissions on the trash folder in a user's home folder".

Last edited by artie505; 03/10/14 06:35 PM. Reason: Correction

The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Re: Trash Problem
Douglas #28338 03/10/14 06:41 PM
Joined: Aug 2009
Offline

Joined: Aug 2009
Originally Posted By: Douglas
I discovered that when I tried to trash a file it was deleted immediately and not going to the trash. I opened Terminal and typed in: sudo rm -rf ~/.Trash

That fixed the trash but it keeps reverting back to deleting files immediately instead of putting them in the trash.

Your trash isn't a single folder. You have (or can have) a trash folder on every volume. Moving a file to the trash means moving it to your trash folder on the volume the file is already on.

The reason is that it is not possible to move a file to a different volume. You can approximate the effect by copying a file to a different volume and then deleting it on the original volume, but that kinda defeats the purpose of the trash, which is to postpone deletion. And besides, what if there isn't room to copy the file to the other volume? What if you want to put the file back where it came from, and there is no longer room for it on the original volume?

When Finder shows you the Trash, what it's really showing you is an amalgamation of all of your trash folders, as if they were a single folder. (This is one of the many little white lies Finder tells. It used to pull the same stunt with your desktop folders.)

~/.Trash is only one of your trash folders. That's the one that is used for all files that you trash from the same volume as the one your home folder is on.

For other local volumes, your trash folder is /Volumes/<volumeName>/.Trashes/<uid>, where <uid> is your numeric user id.

But users are a local concept. For non-local volumes, for example volumes mounted through file-sharing, you have no user id, and the system cannot uniquely assign you your own trash folder on that volume. Trashing a file from a shared disk volume requires that the file be deleted immediately. (It may be possible to defer the delete until you unmount the volume, but no longer.)

Even on a local volume, trashing a file might mean the file must be deleted immediately if:
  • The appropriate trash folder does not exist and cannot be created
  • The trash folder exists, but you don't have write permission to it. (You need write permission to a folder to add items to it.)
  • You don't have write permission to the folder the file is in now. (You need write permission to a folder to remove items from it.)
Those conditions don't mean the file must be deleted immediately; Finder may instead report an error and refuse to trash the file at all.

If you've booted off a clone and start trashing items from your original volume, they will be moved to /Volumes/<originalName>/.Trashes/<uid>, assuming that folder can be created. (Only files you trash from the clone will be moved to ~/.Trash. Note that this is the clone's trash folder, not your original trash folder, because while you're booted from the clone, ~ is the clone of your home folder, not your original home folder.)

If /Volumes/<originalName>/.Trashes/<uid> cannot be created, or if you don't have write permission to it, trashed files will be deleted immediately. One gotcha is that once Finder makes that determination, it hangs onto the answer and doesn't re-check each time you try to trash something from that volume. If it says it'll trash a file by deleting it immediately, it'll keep on saying that for all files on that volume until you either unmount/remount the volume or quit/launch Finder again. The easiest fix is to log out (which quits Finder) and then log back in again.

If logout/login doesn't resolve the problem, you might try any of the following:

1. Remove your trash folder on the problem volume with:

UID=$(id -u)
sudo rm -rf /Volumes/"volumeName"/.Trashes/$UID


2. Remove all trash folders on the problem volume with

sudo rm -rf /Volumes/"volumeName"/.Trashes

Then logout/login to get Finder to re-asses the situation, and try trashing files again. Finder should re-create all the necessary folders with correct permissions.

Re: Trash Problem
artie505 #28339 03/10/14 06:48 PM
Joined: Aug 2009
Likes: 4
Offline

Joined: Aug 2009
Likes: 4
Originally Posted By: artie505
Edit: I suspect that in saying "DURP would actually be viable" you meant to say "repairing permissions would actually be viable".

Yes.

Re: Trash Problem
ganbustein #28340 03/10/14 06:58 PM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
Great explanation...as usual.

Would repairing home permissions ever rectify the situation our OP reported?


The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Re: Trash Problem
jchuzi #28341 03/10/14 07:38 PM
Joined: Aug 2009
Offline

Joined: Aug 2009
Originally Posted By: jchuzi
I had a situation where I had to restore my entire folder of photos from my Time Machine backup. I got a message that I did not have sufficient privileges to copy my own folder!

When your home folder was created, it was populated with a bunch of default folders: ~/Desktop, ~/Documents, ~/Public, ~/Music, ~/Library, ~/Pictures, etc. Apple doesn't want your grandmother renaming these folders, so it puts an ACL on all the pre-installed folders that says "group:everyone deny delete". That says than no one, not you, not your grandmother, and not Time Machine, is allowed to delete any of these folders.

Renaming a folder is tantamount to deleting it and re-creating it with a new name. If you can't delete something, you can't rename it either.

Moving a folder is tantamount to deleting it from where it is and re-creating it in the new location. If you can't delete something, you can't move it either.

Restoring something in place from Time Machine is tantamount to deleting its current incarnation and re-installing it from the backup. If you can't delete something, you can't restore it in place from Time Machine. (You can, however, restore it to a different place.)

Specifically, Time Machine cannot restore ~/Pictures in place. It doesn't have permission to do that.


Your photo library presents a special problem. The library contains a bunch of files (original, modified, thumbnail, iOS-sized) that are all inter-related, along with more files (databases) that keep track of these interrelations. If users go into the library and start renaming/moving/deleting individual files inside their iPhoto library, it can quickly become a useless tangle of no-longer-properly-interconnected files. Apple changed the iPhoto library from a simple folder to a bundle (a folder that looks like a file) to discourage users from shooting themselves in the foot.

Restoring individual files into the photo library is just as dangerous, if not done correctly. To make sure it is done correctly, Time Machine will refuse to restore files/folders into your iPhoto library. (It will also, for the same reason, refuse to restore files/folders into your Mail library.)

Time Machine knows how it was invoked. If invoked from Finder, it goes into "restoring files/folders mode", and is subject to the aforementioned constraints. But you can also invoke TM from within iPhoto (to restore photos) or from within Mail (to restore emails). When in "restoring photos" mode, it talks to iPhoto to make sure all the files related to a photo are restored together, and that iPhoto's database is updated appropriately. Similarly, when in "restoring email" mode, it talks to Mail.app to make sure the restored emails are properly linked into Mail's database.


There's no technical reason why restoring iPhoto's entire library (~/Pictures/"iPhoto Library") en masse in "restoring files/folders" mode should not work, as long as iPhoto is not running at the time. I haven't tried it, but I do know TM knows it should not do partial restores of this folder, and I'm willing to believe it believes it shouldn't do full restores either.

But the correct way to restore photos is to launch iPhoto first, and then invoke TM from within iPhoto. That lets TM and iPhoto coordinate their activities to do it correctly.

Re: Trash Problem
ganbustein #28342 03/10/14 07:57 PM
Joined: Aug 2009
Likes: 7
Online

Joined: Aug 2009
Likes: 7
Great explanation, but it does not apply to my situation. Had I known, I would have clarified.

I created a desktop folder and named it Photos. I store all my photos there, not in ~/Pictures. Am I correct in assuming that repairing user permissions would allow me to re-establish ownership (if necessary)?


Jon

macOS 11.7.10, iMac Retina 5K 27-inch, late 2014, 3.5 GHz Intel Core i5, 1 TB fusion drive, 16 GB RAM, Epson SureColor P600, Photoshop CC, Lightroom CC, MS Office 365
Re: Trash Problem
jchuzi #28343 03/10/14 08:18 PM
Joined: Aug 2009
Likes: 1
Offline

Joined: Aug 2009
Likes: 1
Since the Desktop is actually just a folder inside your home folder, it follows that this ought to work.


Photo gallery, all about me, and more: www.xeromag.com/franklin.html
Re: Trash Problem
artie505 #28346 03/11/14 02:22 PM
Joined: Aug 2009
Likes: 2
Douglas Offline OP
OP Offline

Joined: Aug 2009
Likes: 2
Artie, this has certainly been a learning experience. Had no idea my problem would generate such a response.

One further question. Rather than boot from my install disk, assuming I can find it, can I boot into my clone on an external HD, stick the install disk in, and repair the permissions for my Home Folder that way?

Thanks again

Re: Trash Problem
Douglas #28349 03/11/14 09:29 PM
Joined: Aug 2009
Likes: 15
Online

Joined: Aug 2009
Likes: 15
The only ways of which I'm aware to repair home folder permissions is by booting from your install disc in Leopard and Snowy or by booting into your Recovery partition in later versions of OS X.

Edit: And if perm repair doesn't work you ought to take a look at ganbustein's Terminal commands.

Last edited by artie505; 03/11/14 09:34 PM.

The new Great Equalizer is the SEND button.

In Memory of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire
Re: Trash Problem
artie505 #28352 03/12/14 04:55 AM
Joined: Aug 2009
Likes: 2
Douglas Offline OP
OP Offline

Joined: Aug 2009
Likes: 2
Tonight I reset the permissions on my home folder by booting from my install disk. Will see if that is a permanent fix. Will report back after a few days. If this does not work I'll give ganbustein's Terminal commands a try.



Moderated by  alternaut, dkmarsh, joemikeb 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.4.33 Page Time: 0.041s Queries: 58 (0.027s) Memory: 0.6940 MB (Peak: 1.4891 MB) Data Comp: Zlib Server Time: 2024-03-28 11:48:58 UTC
Valid HTML 5 and Valid CSS