Jump to content

Unable to empty trash - permissions problem


Recommended Posts

Guest theeldergeek
Posted

I cannot delete a folder from my trash as I do not have the correct permissions to do so.

 

I have tried the "getinfo" and change permissions from there, but I can only set myself to "read only".

 

I am an admin on the local machine (although the 'trash' folder resides in my network home)

 

I realise I am going to need to go down to terminal level, but I am unsure how to proceed. My guess is "sudo chown" ...

 

I have tried sudo chown and I get a password prompt, which I input, but the procedure fails with "Operation not permitted"

 

Assistance required! :confused:

Posted

sudo chmod -R 777 (should then prompt for you to re-enter your local admin account password)

sudo chown -R user:group

 

Is your network home on a Mac Server, or a Windows Server?

Posted

If you move the folder back to its original location and use batchmod

 

Home of BatChmod

 

Download and install the above util and you should be able to drag and drop the problematic folder onto the util and set perms etc as relevant and apply that

 

Also check to see if there is anything inside of the folder that is having the issues ie permissions or locked files etc

Guest theeldergeek
Posted
sudo chmod -R 777 (should then prompt for you to re-enter your local admin account password)

sudo chown -R user:group

 

Is your network home on a Mac Server, or a Windows Server?

 

Network home is on an xserve

Guest theeldergeek
Posted
sudo chmod -R 777 (should then prompt for you to re-enter your local admin account password)

sudo chown -R user:group

 

Grrrrrr!!

 

I still can't get it to work.

 

I am putting this into terminal :

 

sudo chmod -R 777 tim /Network/Servers/./Volumes/Data/Machomes/tim/.Trash

 

(I am getting the path by dragging the offending file into terminal and then deleting text back to '.Trash')

 

It returns me to the prompt.

 

Then I put :

 

sudo chown -R user

 

Initially, I had to put a password in. I put my password is as I am an admin on the machine. Now, when I subsequently input the commands, I'm not getting prompted for a password.

Posted (edited)
Grrrrrr!!

 

I still can't get it to work.

 

I am putting this into terminal :

 

sudo chmod -R 777 tim /Network/Servers/./Volumes/Data/Machomes/tim/.Trash

 

(I am getting the path by dragging the offending file into terminal and then deleting text back to '.Trash')

 

It returns me to the prompt.

 

Then I put :

 

sudo chown -R user

 

Initially, I had to put a password in. I put my password is as I am an admin on the machine. Now, when I subsequently input the commands, I'm not getting prompted for a password.

 

you doing this from the xserve itself either remoted into the xserve or on the xserve itself or you doing this from a client apple mac ?

 

Also what type of account are you logged in as on the xserve, an AD domain account, local admin account on the xserve or what exactly ?

Edited by mac_shinobi
Guest theeldergeek
Posted
you doing this from the xserve itself either remoted into the xserve or on the xserve itself or you doing this from a client apple mac ?

 

Also what type of account are you logged in as on the xserve, an AD domain account, local admin account on the xserve or what exactly ?

 

I'm doing it from my own client machine, which I think is probably wrong, otherwise you'd not be asking me :)

 

We don't have our Mac network bound to AD; I can log into the xserve using Remote Desktop as a local admin if need be.

Posted
I'm doing it from my own client machine, which I think is probably wrong, otherwise you'd not be asking me :)

 

We don't have our Mac network bound to AD; I can log into the xserve using Remote Desktop as a local admin if need be.

 

I would try that and try above advise again

Guest theeldergeek
Posted
If you move the folder back to its original location and use batchmod

 

Home of BatChmod

 

Download and install the above util and you should be able to drag and drop the problematic folder onto the util and set perms etc as relevant and apply that

 

Also check to see if there is anything inside of the folder that is having the issues ie permissions or locked files etc

 

I'm afraid BatChmod didn't do the trick, however, I can't move the folder out of Trash, it just copies it.

Guest theeldergeek
Posted
I would try that and try above advise again

 

I did just that, with no obvious success.

 

However, whilst on the server (remotely) i then went to Finder > go folder > path to .trash

 

I saw the files that were in my trash there, so dragged them to the trash on the xserve. I was then able to empty the remaining problem free files from the trash on my client machine.

 

I haven't tried emptying trash on the xserve, but that can wait!

Posted
sudo chmod -R 777 tim /Network/Servers/./Volumes/Data/Machomes/tim/.Trash

 

First problem... no username for chmod. The above command should NOT have "tim" after the 777... Only chown requires username, but then it requires username and group name... so for us (where ours are Windows Network accounts) to chown a file for myself it'd be:

 

sudo chmod -R 777 [this makes the folder read/write/execute allowed for everone, and the -R makes it recursive, so anything inside that folder also ends up the same]

sudo chown -R mcoyles:"HORBURY\Domain Admins" [this sets myself as the owner of the folder, with -R as above]

 

It'll only prompt you for password the first time you sudo a command in a terminal session. You're then authenticated as able to sudo for the remainder of the session, so it won't prompt you for it again unless you quit terminal and reopen.

 

So... time to get all logical.

 

Open a terminal...

 

ls -l /Network/Servers/./Volumes/Data/Machomes/tim/

 

Copy and paste the output of ls -l to the thread so we can see the current permissions and ownership on the file.

Guest theeldergeek
Posted

Copy and paste the output of ls -l to the thread so we can see the current permissions and ownership on the file.

 

ls -l /Network/Servers/server.domain/Volumes/Data/MacHomes/tim

 

drwxr-x---+ 10 tim staff 296 Nov 16 15:38 Desktop

drwxr-x---+ 11 tim staff 330 Nov 3 16:03 Documents

drwxr-x---+ 7 tim staff 264 Oct 16 15:18 Downloads

drwxr-x---+ 49 tim staff 1622 Sep 16 12:14 Library

drwxr-x---+ 7 tim staff 264 Jun 30 14:42 Movies

drwxr-x---+ 5 tim staff 264 Oct 29 15:05 Music

drwxr-x---+ 5 tim staff 264 Mar 20 2009 Pictures

drwxr-x---+ 4 tim staff 264 Mar 13 2008 Public

drwxr-x---+ 6 tim staff 264 Mar 13 2008 Sites

 

Is that what you require?

 

The offending file that wouldn't delete, has gone now (via an alternative method) but I am extremely grateful for your explanation, particularly as I had entered 'tim' where I shouldn't!

Posted
You can also chown just the user or group name. Chown -R username /folder to own. For groups, slightly different chown -R :group name /folder for group to chown.
  • 3 weeks later...
Guest theeldergeek
Posted
Ah... can't show you then.... n/mind!!

 

 

You ain't gonna believe this, but I've done it again, and deleted a users folder which now won't empty from the trash!

 

I have thus far done :

 

sudo chmod -R 777

 

at which point I have entered a password, which was seemingly accepted.

 

I am doing this on the xserve via Remote Desktop.

 

I am in terminal, have changed the directory to .Trash and when I type :

 

ls -l

 

I get

 

drwxr-x--- 14 067 staff 476 1 Dec 14:05 03jmorley.old

 

however, when I type

 

sudo chown -R tim /03jmorley.old

 

I get

 

No such file or directory

 

Clearly I am doing something wrong.

 

Help!

Posted (edited)

If you cannot delete the files from the recycle bin on the server then they may be locked by another process, you will need to restart the server and empty the bin.

 

 

Also if you are in the current folder with 03jmorley.old in then your path is wrong.

 

 

sudo chown -R tim ./03jmorley.old

sudo chown -R tim 03jmorley.old

sudo chown -R tim /.Trash/03jmorley.old (for the local server).

 

Also look in .Trashes if it exist.

 

Edit: you may need ~/.Trash/03jmorley.old etc if your folder is on a remote server

Edited by DMcCoy
Posted (edited)
I am in terminal, have changed the directory to .Trash and when I type :

ls -l

I get

drwxr-x--- 14 067 staff 476 1 Dec 14:05 03jmorley.old

however, when I type

sudo chown -R tim /03jmorley.old

I get

No such file or directory

 

Clearly I am doing something wrong.

 

The / that you've put in front of the filename is causing it to go back to the root of the drive to look for the file. Head into terminal, into the .Trash directory,

 

ls -l (to confirm you're in the right place)

 

You should see exactly as you posted above:

 

drwxr-x--- 14 067 staff 476 1 Dec 14:05 03jmorley.old

 

If you do, then copy and paste the following into terminal:

sudo chown -R tim 03jmorley.old && chmod 777 03jmorley.old && rm 03jmorley.old

 

&& joins commands together so you can run them in one hit. The above changes the owner to you, changes the permissions to full access, then removes the file.

 

For common trash issues with permissions etc - http://www.thexlab.com/faqs/trash.html

 

@DMcCoy - Ideally server reset shouldn't be necessary to unlock a file... run lsof and it'll return all processes using that file, which you can then kill -9 to get rid of those processes and remove the lock on the file. Reset is only necessary if the process locking the file is "login_window" or "kerneltask" or similar... as to kill those will log you out.

Edited by Marci
Posted
On leopard if a file is locked (not sure if just read only files or in use files) but holding down the alt key whilst emptying the trash will empty it even if the files are locked.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...