An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Topic Options
#28320 - 03/08/14 02:20 PM Trash Problem
Douglas Offline


Registered: 08/04/09
Loc: Seattle, WA
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

Top
#28321 - 03/08/14 03:08 PM Re: Trash Problem [Re: Douglas]
artie505 Online


Registered: 08/04/09
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

Top
#28322 - 03/08/14 09:50 PM Re: Trash Problem [Re: artie505]
Douglas Offline


Registered: 08/04/09
Loc: Seattle, WA
Wondering why Repairing all Permissions with DU would not also fix them for the Home Folder.

Top
#28323 - 03/09/14 12:28 AM Re: Trash Problem [Re: Douglas]
artie505 Online


Registered: 08/04/09
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

Top
#28325 - 03/09/14 06:43 AM Re: Trash Problem [Re: artie505]
grelber Offline


Registered: 08/05/09
Loc: North of 49th ||
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.

Top
#28326 - 03/09/14 08:30 AM Re: Trash Problem [Re: artie505]
dkmarsh Offline

Moderator

Registered: 08/04/09

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

dkmarsh • member, FineTunedMac Co-op Board of Directors

Top
#28328 - 03/09/14 09:50 AM Re: Trash Problem [Re: grelber]
jchuzi Offline


Registered: 08/04/09
Loc: New York State
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

OS 10.14.6, 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

Top
#28331 - 03/09/14 04:09 PM Re: Trash Problem [Re: grelber]
tacit Offline


Registered: 08/03/09
Loc: Portland, Oregon, USA
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

Top
#28332 - 03/09/14 04:28 PM Re: Trash Problem [Re: dkmarsh]
artie505 Online


Registered: 08/04/09
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

Top
#28334 - 03/10/14 08:11 AM Re: Trash Problem [Re: grelber]
grelber Offline


Registered: 08/05/09
Loc: North of 49th ||
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?

Top
#28335 - 03/10/14 08:48 AM Re: Trash Problem [Re: grelber]
artie505 Online


Registered: 08/04/09
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

Top
#28336 - 03/10/14 09:25 AM Re: Trash Problem [Re: artie505]
grelber Offline


Registered: 08/05/09
Loc: North of 49th ||
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.

Top
#28337 - 03/10/14 11:30 AM Re: Trash Problem [Re: grelber]
artie505 Online


Registered: 08/04/09
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".


Edited by artie505 (03/10/14 11:35 AM)
Edit 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

Top
#28338 - 03/10/14 11:41 AM Re: Trash Problem [Re: Douglas]
ganbustein Offline


Registered: 08/04/09
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.

Top
#28339 - 03/10/14 11:48 AM Re: Trash Problem [Re: artie505]
grelber Offline


Registered: 08/05/09
Loc: North of 49th ||
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.

Top
#28340 - 03/10/14 11:58 AM Re: Trash Problem [Re: ganbustein]
artie505 Online


Registered: 08/04/09
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

Top
#28341 - 03/10/14 12:38 PM Re: Trash Problem [Re: jchuzi]
ganbustein Offline


Registered: 08/04/09
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.

Top
#28342 - 03/10/14 12:57 PM Re: Trash Problem [Re: ganbustein]
jchuzi Offline


Registered: 08/04/09
Loc: New York State
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

OS 10.14.6, 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

Top
#28343 - 03/10/14 01:18 PM Re: Trash Problem [Re: jchuzi]
tacit Offline


Registered: 08/03/09
Loc: Portland, Oregon, USA
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

Top
#28346 - 03/11/14 07:22 AM Re: Trash Problem [Re: artie505]
Douglas Offline


Registered: 08/04/09
Loc: Seattle, WA
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

Top
#28349 - 03/11/14 02:29 PM Re: Trash Problem [Re: Douglas]
artie505 Online


Registered: 08/04/09
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.


Edited by artie505 (03/11/14 02: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

Top
#28352 - 03/11/14 09:55 PM Re: Trash Problem [Re: artie505]
Douglas Offline


Registered: 08/04/09
Loc: Seattle, WA
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.

Top

Moderator:  alternaut, dkmarsh, joemikeb