Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > One folder wont delete

One folder wont delete
Thread Tools
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Aug 25, 2014, 12:37 PM
 
I recently had to delete a bunch of folders my new anitviurs sees as threats. One wont empty out of the trash. Real stubborn. Any recommendations on this? thanks.
OS 10.6.8
imac-2 core 27"/2009
4GB Ram
     
Senior User
Join Date: Dec 2013
Location: Kent, Washington (Up in God's Country!)
Status: Offline
Reply With Quote
Aug 25, 2014, 12:50 PM
 
Originally Posted by jeff k View Post
I recently had to delete a bunch of folders my new anitviurs sees as threats. One wont empty out of the trash. Real stubborn. Any recommendations on this? thanks.
It would help if you could let us know the exact message you are getting for the "problematic" folder/file/files.

In any event, here are the results of a google search I just did (Search term "Emptying the Trash on a Mac"):

https://www.google.com/search?q=Empt...x-a&channel=sb

Did you try "Secure Empty Trash" from the Finder menu? You could also try by holding down the Option key while selecting Empty Trash. If neither of those work, here are two of the ones from the google search that might be worth trying:

How to force empty Trash on your Mac using Terminal | iMore

Mac troubleshooting: What to do when the Trash won’t empty | Macworld
( Last edited by akent35; Aug 25, 2014 at 01:42 PM. )
Post maturely, and On Topic!
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Aug 25, 2014, 03:10 PM
 
First check that it is not locked in the Finder (Get Info for all files in the directory). Then run Disk Utility and check your disks - all of them - and repair if there are issues. If that doesn't fix it, take a look at the links akent posted above - specifically, the one from Macworld. The one from iMore is riskier. If even that won't do it, we'll have to break out the heavy artillery (It is possible in Mac OS X to make a file that is impossible to delete except if you do some extremely specific things), but let's cross that bridge when we get to it.
The new Mac Pro has up to 30 MB of cache inside the processor itself. That's more than the HD in my first Mac. Somehow I'm still running out of space.
     
jeff k  (op)
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Aug 25, 2014, 03:46 PM
 
Thanks guys.
The unlock trick, option secure trash did not work.
It was some backup folder in Time Machine, others with same name deleted. This one wont

Anyway, in trash, I renamed the top folder to the new name test, which was ok. I looked inside and the folder inside, says Mac HD, System, library, core services, and final thing is a file called boot.efi

Have no idea what this is, maybe Trojan horse put there by intern? Just a guess...Have no idea.

Should I just keep trying to rename, and delete? Will do DU now...
OS 10.6.8
imac-2 core 27"/2009
4GB Ram
     
Moderator
Join Date: Aug 2001
Location: Location: Location:
Status: Online
Reply With Quote
Aug 25, 2014, 04:22 PM
 
Reboot, then try to empty Trash.
OMG!!! We did it!!!!
     
jeff k  (op)
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Aug 25, 2014, 08:01 PM
 
Ok T and others thanks, I did the DU on every disc, including Mac HD, all ok.
Restart still wont delete.
I was able to rename all those folders (to test), but did not help.
That final file at the end of the chain, boot.efi would not rename. Anyone heard of that file?

My guess is the computer sees it at a system, and you cannot delete it. Any ideas before I click on those other links, have not checked them out yet, as I was swamped with the aforementioned.
OS 10.6.8
imac-2 core 27"/2009
4GB Ram
     
Administrator
Join Date: Jun 2000
Location: California
Status: Offline
Reply With Quote
Aug 25, 2014, 09:09 PM
 
You're looking at some old backup of the OS. boot.efi is a legit startup file, owned by root. You can log in as root and delete it, or do some Terminal kung-fu to get rid of it. The folders will probably delete once boot.efi is gone.

In the meantime, try Get Info on it. Click open the Sharing & Permissions pane. Click the lock icon at bottom and authenticate. Then try to add your own user name, or "everyone" to the privilege list, with read and write. If you can get it to take, you'll be able to delete afterwards.

If that doesn't work, log in as the root user, delete file. Or chown the file in Terminal (you'll have to su to the root user first) and then delete, possibly after adding write permissions.

Or you could boot from another hard drive / partition. Set OS X to ignore permissions on the first drive, delete the file, then set OS X to honor permissions on the first drive again.
     
jeff k  (op)
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Aug 26, 2014, 12:15 AM
 
ok R, I went again to Sharing/ Permissions, it would not let me make anything read/ write, and it would not let me add someone new or subtract anyone.

Your other ideas look pretty hairy, but I'll take the easiest one someone can offer.

Update, I read one of the articles from above, went to terminal, pasted in sudo rm -rf ~/.Trash/*

Entered my password, and it did not work.
OS 10.6.8
imac-2 core 27"/2009
4GB Ram
     
Administrator
Join Date: Jun 2000
Location: California
Status: Offline
Reply With Quote
Aug 26, 2014, 12:30 AM
 
sudo = superuser (root) do. Terminal would ask for the root user pass before doing. If you never created the root account, you'll be out of luck.

Create the root user account and take care of it. Then log out, back to your normal account. Chances are you'll use root in the future from time to time. Whenever you run into another weird permissions issue. Just don't use that account as your regular account.

Or you can use my alternate boot idea. Assuming you have an OS install on another disk, or on another partition.
     
Administrator
Join Date: Apr 2001
Location: San Antonio TX USA
Status: Offline
Reply With Quote
Aug 26, 2014, 07:06 AM
 
I'm curious which new antivirus you have that identified these files as "bad." Not that I'd argue with it, I'm just interested in which product you used.

Some AV products are better at pointing out corrupted files than others are, and i'll bet that these old OS backup files are in that category - or old enough that the current OS version can't use them. Either way, they are pretty much appropriate for deletion, though most people (and most AVs) don't ever look at these.

Glenn -----OTR/L, MOT, Tx
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Aug 26, 2014, 08:31 AM
 
Originally Posted by reader50 View Post
sudo = superuser (root) do. Terminal would ask for the root user pass before doing. If you never created the root account, you'll be out of luck.
Actually no. The password you are asked for when you do sudo is your own, but you have to be admin to do it. I do not have root enabled on my current setup, and have not had it since 10.3 or thereabouts, and sudo works just fine.
The new Mac Pro has up to 30 MB of cache inside the processor itself. That's more than the HD in my first Mac. Somehow I'm still running out of space.
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Aug 26, 2014, 08:39 AM
 
Originally Posted by jeff k View Post
That final file at the end of the chain, boot.efi would not rename. Anyone heard of that file?
That is a system file that is probably specially protected, as I alluded to in my earlier post. First: please confirm that you checked that file in the Finder -> Get Info and made sure it was not locked.

Second: Check the flags on that file by going to Terminal, typing
"ls -lO " and then dropping the file on the window. Please note the space after the capital O that must be there before you drop the file on.
The new Mac Pro has up to 30 MB of cache inside the processor itself. That's more than the HD in my first Mac. Somehow I'm still running out of space.
     
Administrator
Join Date: Jun 2000
Location: California
Status: Offline
Reply With Quote
Aug 26, 2014, 12:06 PM
 
Originally Posted by P View Post
Actually no. The password you are asked for when you do sudo is your own, but you have to be admin to do it. I do not have root enabled on my current setup, and have not had it since 10.3 or thereabouts, and sudo works just fine.
I've enabled root at some point on each install, so never tested this. Being able to sudo (do anything) with just an admin pass would be a security hole. Effectively every admin account can bypass all user security, provided they use Terminal. Or is this limited to the original admin account of an install?
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Aug 26, 2014, 01:32 PM
 
No, all admin accounts can do that, and it is not a security hole. Admin accounts have the right to execute as root, but only after an extra verification. Since any admin account can enable the root account and set its password, why would sudo be a security hole?
The new Mac Pro has up to 30 MB of cache inside the processor itself. That's more than the HD in my first Mac. Somehow I'm still running out of space.
     
Administrator
Join Date: Jun 2000
Location: California
Status: Offline
Reply With Quote
Aug 26, 2014, 02:24 PM
 
Among other things, it would let every admin access every other admin's files. Effectively, no access limits at that account level.

I suspect any admin account can create the root account, but once created, OSX would require the root password. So it's a free for all only when there's no root user.

edit: just tested this in Leopard. Tried to use sudo to list the root user folder, using my admin pw. No go.
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Aug 26, 2014, 03:12 PM
 
Originally Posted by reader50 View Post
I suspect any admin account can create the root account, but once created, OSX would require the root password. So it's a free for all only when there's no root user.
No, this is correct if you're trying to log in as root, i.e. use su and not sudo, but sudo works as I said - same as the authentication prompt in the OS. From the sudo man file:

sudo allows a permitted user to execute a command as the superuser or
another user, as specified in the sudoers file. The real and effective
uid and gid are set to match those of the target user as specified in
the passwd file and the group vector is initialized based on the group
file (unless the -P option was specified). If the invoking user is
root or if the target user is the same as the invoking user, no
password is required. Otherwise, sudo requires that users authenticate
themselves with a password by default (NOTE: in the default
configuration this is the user's password, not the root password).
The new Mac Pro has up to 30 MB of cache inside the processor itself. That's more than the HD in my first Mac. Somehow I'm still running out of space.
     
jeff k  (op)
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Aug 26, 2014, 03:37 PM
 
Thanks
The software is Sopho, was recommended by my web hoster, seemed to work nicely.

I was able to unlock the lock while in trash, but still would not empty.

P "Check the flags on that file by going to Terminal, typing "
that is over my head, don't know what check the flags means.

Also, my long user password is not the admin or root password? that is over my head too.

I take the easiest idea next and go from there. thanks for being patient everyone!
OS 10.6.8
imac-2 core 27"/2009
4GB Ram
     
Forum Regular
Join Date: Nov 2003
Status: Offline
Reply With Quote
Aug 26, 2014, 04:02 PM
 
Sorry, I still question the whole reason you're here. Did you say that this antivirus software said your TimeMachine backup was suspect? Don't ever touch your TM backup drive. Just let TM do it's thing and don't pay any attention to it. If you feel you must run antivirus, tell it ignore your backup drive.

When I've had stuck files, I had to pull them out of my trash. Just drag them to a junk folder on your desktop and type that same Terminal command with one simple trick for those of use that don't speak Terminal: sudo rm -rf [make sure you end with a space, then drag the offending file/folder onto the terminal window and it will automatically insert the whole proper path to the file] Hit return, type your computer password, then return one more time.

This does assume that you are the administrator of your computer. If this isn't your computer and it's managed by somebody else, there's not much/nothing you can do on your own.
     
Administrator
Join Date: Jun 2000
Location: California
Status: Offline
Reply With Quote
Aug 26, 2014, 04:03 PM
 
Originally Posted by P View Post
No, this is correct if you're trying to log in as root, i.e. use su and not sudo, but sudo works as I said - same as the authentication prompt in the OS. From the sudo man file:
My sudo test with cd failed. Another test with ls succeeded. I was able to list the root folder, using an admin pass. This is a user security hole in my opinion. An unimportant one if there is only one admin account. But if multiple admins share a computer, any one can access all the files belonging to the others. Just sudo in and read based on entertainment value.

Files admins might not want to share with all other admins:
emails
financial records
love letters
porn stash
employment records
VPN password
     
Administrator
Join Date: Jun 2000
Location: California
Status: Offline
Reply With Quote
Aug 26, 2014, 04:28 PM
 
Originally Posted by jeff k View Post
P "Check the flags on that file by going to Terminal, typing "
that is over my head, don't know what check the flags means.
Files can have a few special settings, which are not visible in a Get Info dialog. P is just telling you to list those settings in Terminal, then copy them to us so we can look at them.

ls (lowercase LS) = list directory
-l (lowercase L) = use long format (more complete info)
-O (uppercase O) = include file flags. Those are what we want.

Type "ls -lO ", drag n drop the boot.efi file into the Terminal window, and hit return. You'll get something like this:

-rw-r--r--@ 1 jeffk staff - 160 Aug 25 20:35 /Users/jeffk/.Trash/boot.efi

The file flags are that "-rw-r--r--@" jazz at the front. Execute the command, and copy the result line over to us. Then we can advise you about how to unlock the file for deletion.
     
jeff k  (op)
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Aug 26, 2014, 08:33 PM
 
"Did you say that this antivirus software said your TimeMachine backup was suspect"

No never said that, and I don't touch TM anything ever. The software identified 40 folders as threats, and only would not not empty out of the trash.

Not sure I want this out of the trash do I? Anyone else want to confirm POtty's Terminal solution.

Reader, wow, sounds very draining, can't follow it honestly. I need a simple step by step instruction.

I see many conflicting scenarios, all draining, would need something spelled out very easy.

That's the problem with super power users, what is so simple to them is rocket science, I'm pretty wiped out unless some can offer a simple solution, if not over to the genius bar, forums only go so far.
OS 10.6.8
imac-2 core 27"/2009
4GB Ram
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Aug 27, 2014, 04:29 AM
 
I get that I am not explaining what we're doing here, but the instruction is not so hard. A little background might help, maybe: The file system has a number of flags - some inherited from old Mac OS, some imported from FreeBSD - that control what you can do with it. These do not show up in the Finder except for the Locked file, the old read only flag from Mac OS. I am trying to get some information on the file that you cannot deleted.

Open the Terminal and type "ls -lO ", and then drag the file onto the window. This will fill in the path to the file into the window directly, so you don't have to type it. It does not move the file. When you have the path in the window, hit enter and see what it says. This is only information gathering, you are not doing anything active.
The new Mac Pro has up to 30 MB of cache inside the processor itself. That's more than the HD in my first Mac. Somehow I'm still running out of space.
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Aug 27, 2014, 04:37 AM
 
Originally Posted by reader50 View Post
My sudo test with cd failed. Another test with ls succeeded. I was able to list the root folder, using an admin pass. This is a user security hole in my opinion. An unimportant one if there is only one admin account. But if multiple admins share a computer, any one can access all the files belonging to the others. Just sudo in and read based on entertainment value.

Files admins might not want to share with all other admins:
emails
financial records
love letters
porn stash
employment records
VPN password
cd just changes your current working directory in the shell. It is a so-called shell built-in, not an executable, and sudo only works on executables (some other commands are also built-ins but also have executables so sudo can work on them, but for cd that does not make sense, as you can always cd anywhere with any account).

It is not a security hole in that it is expected, documented behavior that it works this way. Undesirable, certainly, but it is inherent in the design of UNIX that there are only two priority levels: regular user, and root. The solution is to encrypt your home directory to avoid the issue.

Also remember that there is no security without local security - if you share a computer, someone can pull the HD, move it to a computer they control and read freely. Or boot from another drive and do the same thing. UNIX access controls are intended to work on a network server that users log on to remotely.
The new Mac Pro has up to 30 MB of cache inside the processor itself. That's more than the HD in my first Mac. Somehow I'm still running out of space.
     
jeff k  (op)
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Aug 27, 2014, 03:44 PM
 
Problem solved.

I Google Onyx and chose the first one listed, Google Adword, free download, and then my antivirus brought up a new threat, said spyware something... Search Genie, then took over my homepage...

So after I dealt with that, I found MacUpdates Onyx page. Then it would not download, said it was not an identified developer.

Did a search on Macupdate for "empty trash:" or delete trash, and the first one up is called Trash it!

Also not identified developer, but I overrode that and took a risk.

Ran the software, (an to my surprise), the trash can was clear as a bell afterwards.
OS 10.6.8
imac-2 core 27"/2009
4GB Ram
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -4. The time now is 12:44 PM.
All contents of these forums © 1995-2014 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2014, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2