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

sketchygio

macrumors newbie
Original poster
Nov 1, 2009
18
0
So, while cleaning up my macbook pro from old files, I mistakenly get into the NO NAME partition that appears in the OS X partition, but which holds some kind of Windows XP directories. I don't know how I managed to do so, but I somehow deleted a folder under NO NAME/Documents and Settings/[user name] and all the files in that directory.

Not much harm was done, since it seems as though the folder was merely duplicated into the trash and still remains in its original directory in NO NAME. The problem is that every time I try to delete it from the trash it says I don't have permissions. It's only folders and they're all unlocked and I am logged on as admin. I've tried dragging the folder out of the trash but it merely duplicates it (although I have no issues deleting the duplicate). So I have folders that have no use being in or outside the trash, which are proving to be very difficult to delete. I tried verifying my disk fwith Disk Utility, but it resulted ok. Any suggestions?
 
This command in Terminal.app will force empty your user's trash:

rm -fr ~/.Trash/*
 
Essentially. More precisely it says "The operation cannot be completed because you do not have sufficient privileges for some of the items". After that, I have to click Continue 9 times or so for the dialogue box to disappear. There are no actual files in the folders. I'm assuming it to be some error related to the folders being from Windows XP. More strange to me, is the fact that the folder gets cloned when it's moved out of the trash.
 
You lack write permissions so cannot delete nor move the files, which explains why a copy is made when trying to move the files. Try:

sudo rm -fr ~/.Trash/*

'sudo' will override permissions assuming your user is a sudoer.
 
That was a good suggestion. I hadn't thought about that, but still no cigar. Any other ideas?
 
At times, when I've been unable to delete a file from the trash I reboot my machine and that seems to do the trick. But I usually get a file still in use message. Have you tried undeleting the folder from the trash?
 
PS: I'm logging off soon. If xlii's & my suggestions above don't do the trick, probably somehow another user owns those files (check "ls -l ~/.Trash" to verify), which would be odd since the files are in your trash, but anyway, in this case either become that user or root, or boot into single user mode & then: rm -fr /Users/XYZ/.Trash/*

where "XYZ" = username where files are stuck in trash.
 
Thanks for all the suggestions so far/

At times, when I've been unable to delete a file from the trash I reboot my machine and that seems to do the trick. But I usually get a file still in use message. Have you tried undeleting the folder from the trash?

Yup, several times. Like mentioned above, trying to remove the files from the trash causes them to be duplicated, leaving one copy outside the trash and the original inside it.

Try this command:

chmod -R u+rw ~/.Trash/* && rm -fr ~/.Trash/*

No effect :confused:

PS: I'm logging off soon. If xlii's & my suggestions above don't do the trick, probably somehow another user owns those files (check "ls -l ~/.Trash" to verify), which would be odd since the files are in your trash, but anyway, in this case either become that user or root, or boot into single user mode & then: rm -fr /Users/XYZ/.Trash/*

where "XYZ" = username where files are stuck in trash.

I logged as root through terminal and ran the command. Didn't see to do anything. Also, when I checked "ls -l ~/.Trash" it didn't list anything in terminal. But upon checking the trash, the faulty folders are definitely still there.
 
I logged as root through terminal and ran the command. Didn't see to do anything. Also, when I checked "ls -l ~/.Trash" it didn't list anything in terminal. But upon checking the trash, the faulty folders are definitely still there.
When logging in as root, you need to give the full path, e.g.: /Users/XXX/.Trash/*

where "XXX" = the username of the user with the files you're trying to delete

as you're logged in as root, "~" shows root's folder
 
When logging in as root, you need to give the full path, e.g.: /Users/XXX/.Trash/*

where "XXX" = the username of the user with the files you're trying to delete

as you're logged in as root, "~" shows root's folder

You don't even to logged in as root for that; just use sudo and it's the same.
 
You don't even to logged in as root for that; just use sudo and it's the same.
The OP already indicated that "sudo rm -fr ~/.Trash/*" did not work. What would you recommend in this case? I agree that logging in with whichever account created the "mess" & running this command should work.
 
All right. Still going at it. Thanks for the continued help.

When logging in as root, you need to give the full path, e.g.: /Users/XXX/.Trash/*

where "XXX" = the username of the user with the files you're trying to delete

as you're logged in as root, "~" shows root's folder

I ran "/Users/XXX/.Trash/*" as root (where XXX is the username, and there really is only one, so I can't go wrong), but I got back
"sh: /Users/XXX/.Trash/*: No such file or directory" I'm not sure I understand the purpose of the command but doesn't seem to have an effect.


The OP already indicated that "sudo rm -fr ~/.Trash/*" did not work. What would you recommend in this case? I agree that logging in with whichever account created the "mess" & running this command should work.

I only have one account on my mac partition, which is also the admin "XXX". However, it seems like the folder in the trash belongs to my windows XP partition username "YYY". Could that be the reason why I am not being allowed to delete it?
 
"/Users/XXX/.Trash/*" is the path to all files in XXX user's trash without any command. The entire command is:
rm -fr /Users/XXX/.Trash/*

In case you're running this command as an admin user (not root), then use sudo:
sudo rm -fr /Users/XXX/.Trash/*
 
I found that sometimes when you delete a file from an NTFS disk, you may have this problem. If you have paragon NTFS installed, under mac os you can try "utility - disk utility - repair disk" to repair the xp disk. Otherwise, you can boot into the xp system, and go to "start - run - "cmd" " and use check disk command: chkdsk. to repair the xp disk.
 
Long delay, but I'm still afflicted

Really sorry for this super-delayed response. Got side tracked.

Anywas, I did try your proposed solutions.

"/Users/XXX/.Trash/*" is the path to all files in XXX user's trash without any command. The entire command is:
rm -fr /Users/XXX/.Trash/*

In case you're running this command as an admin user (not root), then use sudo:
sudo rm -fr /Users/XXX/.Trash/*

Tried both, to no avail.

I found that sometimes when you delete a file from an NTFS disk, you may have this problem. If you have paragon NTFS installed, under mac os you can try "utility - disk utility - repair disk" to repair the xp disk. Otherwise, you can boot into the xp system, and go to "start - run - "cmd" " and use check disk command: chkdsk. to repair the xp disk.

Don't have paragon. Tried the chkdsk, but Windows found no errors in the disk. I could try to get a hold of paragon, but if Windows failed to repair its own disk, would this really work?

Also, I don't believe the error exists withing the Windows partition. Sure, it originated from files which belonged originally to that partition, but the problem occurs in the Mac partition.

Still open to suggestions.
 
I'm having the same problem

Although I don't know exactly what the OP is saying as to how the file originated, this is how my file originated:

I was copying files from a friends XP PC to restore her computer after a virus. I copied her files onto my external hard drive. I did her restore, restored her files and deleted them from my hard drive.

When ever I plug my external into my macbook, one lone folder from her computer is n the trash and gives me the same error... I dont have the privledges/permissions to delete. I've tried the option + empty feature. Not working. Folder is EMPTY. If I move it out of trash, it just duplicates itself. The duplicate will delete when I empty trash, but the original will not.

I don't know what to do. Also, I am still somewhat new to mac, it's been almost a year since I started using mac as my primary computer, so I am comfortable with terminal but not completely, so if you have suggestions, a little more detailed walk through would be appreciated...


to the OP, did you ever resolve this issue? If so, what did you do?
 
My Fix

I finally just decided to try plugging my hard drive into my PC. I had it set to show all hidden folders and deleted the folders that said something like .trashes or whatever.

After I plugged my hard drive back into this mac, the undesirable folder was gone, finally. I should have tried this a long time ago! lol.

Even tho the folder came from her PC, i was able to delete it on mine...
 
The trick here may be that the file is not in the user trash, but somewhere else (another volume, one of the rarely used special trash folders, etc). Try dragging one of the files into a Terminal window and see what path it specifies.

jW
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.