Lion Finder crashing repeatedly

Geeky post to help those who might be Googling for this stuff. To anyone who saw the title and came here hoping to read about an accident-prone safari guide, my apologies.

I know people have mixed experiences with Mac OS X Lion, but for me it’s been almost all good, and I’m very happy with the upgrade.

I did, however, run into a curious problem today on one of my machines, which took a while to sort out. The Finder was crashing and rebooting repeatedly, each time asking me if I wanted to restore the windows it had been displaying before.

I tried all sorts of things: moving stuff off the desktop, deleting the Finder’s preferences file, unmounting drives, booting in safe mode… but in the end it proved to be the Trash that was causing the problem.

I started Terminal (which is always in my Dock, but you can start from Spotlight if you don’t have a Finder running) and did:


sudo rm -rf ~/.Trash

…after which my world came back to normality again. (You’ll need to type your admin password).

Hope that’s useful for someone out there!

Enjoyed this post? Why not sign up to receive Status-Q in your inbox?

41 Comments

I copied and pasted it in and it worked! Thank you!

Just wanted to let you know this saved me! I was reading everywhere that I was going to have to do a re-install, or all kinds of nasty time consuming things, but your solution fixed it. Thank you!

Another fix here too! It happened after I deleted the Chax scripting addition, and all hell broke loose. Deleting the trash fixed it. Thanks for the post!

WORK!!! Thank you very much!!

Thank you so much! This just saved from having to restore Mac OS X Lion. The Apple Care support call has proven to be totally worthless!

Hello pleaseee help..!!! i have done all you said but when i try to type my pass nothing happen..!! I’m not able to write anything..!!

    Well, Daniel, the password won’t be displayed as you type it, for security reasons. And then, when you press return, the command may take a little while to run.

    But you should then get the Terminal prompt back again, after which you can close it.

Thank you so much!!!

I wish this worked for me. I’m having the same exact problem described. Upon startup of the finder it just goes on to a continuous loop of crashing and not allowing me to access anything. Basically it freezes me out while it loops. So the odd part is that I reinstalled Lion without removing user accounts with no improvement. Then I re-named the user account’s Library folder so that the system would create a new one and even that didn’t work. And yet when I created a new user account/admin it works fine. Not to mention all the usual diagnostics on hardware and file structure.

I had this same problem today on a clients computer. Except it was not the same. While the symptoms were the same, the solutions did not work. I believe I found the issue, and hopefully it will be a more general fix for everyone.

The problem I had was with the Desktop Folder, however, not the trash, and I have seen a few posts with people having this issue with their desktop as well. I tried deleting the trash, and finally removed everything in Desktop folder and placed it in a new folder and voila, it stopped crashing. I then went to fix another problem, it was a scanner issue, and as soon as I saved a file to the desktop, it started crashing again.
I used the command line to remove all the files, and it stopped crashing again.

I found through this process that opening the folder on a remote mac caused finder to crash as well. A thought suddenly occurred… we have a REAL SOLUTION, and this should be broad enough to cover nearly all the cases.

SOLUTION:
CORRUPT .DS_Store file.

.DS_Store files store folder attributes such as window and folder positioning.

every time your computer wants to display the contents graphically, it uses this file, hence the issue. If your trash folder was opened when you closed finder and it’s going to cause a crash if the .DS_Store file is corrupt. My issue was the desktop, which meant that every time the Finder Launched, it would try to display the desktop and crumble.

If a folder for some reason does not have this file already, the system will generate a new one. If it is already there it modifies the existing one.

For any folder that crashes Finder when opened
From the Commands Line type

cd …{folder path}/

if you the command “ls” you will not see the .DS_Store file, the . in front means it is hidden. Some solutions I read suggested this can be cause by files or folders having been allowed to have the same name for some reason. So you do want to navigate to the folder in question from the command line and double check it’s contents.

If all looks good, and you don’t see any duplicated files you can proceed to find and delete the .DS_Store file. If you want to see it, you can use the command “ls -a” which means list all files including hidden. You should see it there at the top of the list.

Now type: “rm .DS_Store” and as long as you don’t see your computer complaining, the file should be removed. You can double check by typing “ls -a” and as long as you have not opened the folder again in finder, the file will be gone.

If you were able to do this on the machine with the problem, you are likely as I did to see the loop stop immediately and finder return to normal.

I hope this helps.

@Ben Z –

This is the most comprehensive and clever response I’ve ever read. It completely solved the issue we were having on my girlfriend’s MacBook. Thank you.

A TL;DR Version for any readers who are having a real stress-fest over this:

1. Open Terminal

2. type: cd desktop

3. type: ls

4. Check for duplicated files, if there’s a duplicate type: rm [enter duplicated filename]

(If no duplicates proceed to step 5)

5. type: ls -a (which means “list” everything, including hidden ones)

6. look for .DS_Store in list (this is the culprit)

7. type: rm .DS_Store

Voila!

Ben Z. and JonnyW… if the Apple Store has Genius you two are savants! I spent upteenth hours desperately trying to fix this issue and 2 hours at the ‘so called” Genius bar. It was a total joke. Your fix was AWESOME and I’m really thankful for your efforts and talents.

Best.

Ben Z and JonnyW, I keep getting a “command not found” message when I type in “cd …{folder path}/” or “cd desktop” in the command line or terminal window. What am I doing wrong?

Any harm in deleting ALL .ds files on your disk? Easy to do with EasyFind; just find and Destroy.

Oh. My. God. I’m at the end of Day 2 of reading forums and manuals and reinstalling and trying EVERYTHING ELSE, and finally I find the solution here. Thank you Ben Z and JonnyW, I almost fell off my chair when this worked.

I’m just a clueless user, I’d never even heard of Terminal, let alone seen it, let alone typed any commands. I’d tried a few other suggestions from other forums, mostly to do with .Trash, and I’ll admit my eyes were glazing over reading Ben Z, so a special thanks to JonnyW for simplifying it for me.
This is how green I am – I couldn’t get it to work the first few times because for “ls” I was typing capital i followed by s, instead of the small l. Just rereading from Ben that it stands for “list” made me realize what a goose I am. And then it all worked. Cheers all round.

Cheers JonnyW

It worked and you saved my bacon

This is great. solved my finder crash problem too. Thanks for the fix!

I had to register just to thank you Ben Z and the simplification of JonnyW – you have literally saved me from despair – thank you so much, I hope someone is paying you large amounts of money for being genii!

Hi All,

I’m going crazy and been working on this issue for just too long !! I’m sure JonnyW and Ben Z solution will solve my finder crashing as well as all application by the way except safari ( weird ! ) , but my issue is that I can’t even launch TERMINAL … What ca I do.Please help me I’m so close to throwing my iMac by the window.

    If you can’t even do it using Spotlight, then you may need to log in from another machine (assuming you have remote login enabled).

    If you can’t do that, then the next thing to try would probably be one of the following:

    • To boot up from a different system disk (e.g. a clone on an external drive) and mount your hard disk from there, then you can find your home folder and edit it as described. If you don’t have a bootable external drive, you could get a drive and install the OS on it from the system DVD, then boot from that.
    • To put your machine in Target Disk Mode so you can mount its drive using another machine.
    • To boot into single-user mode, mount the hard disk in read-write mode, cd to your home folder and carry out the required commands from the console.

    The details for any of these are probably beyond the sensible scope of a blog post comment, though, so if they sound scary or baffling I would go and find expert help!

JonnyW – You are the MAN, sir. Googled for hours and hours, tried numerous solutions – not of which worked – tried yours and BAM, fixed in 10 seconds. Thanks man!

I enter “sudo rm -rf ~/.Trash” in Terminal, I get:

WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type “man sudo” for more information.

To proceed, enter your password, or type Ctrl-C to abort.

Password:
Sorry, try again.
Password:
Sorry, try again.
Password:
Sorry, try again.

I don’t have a password (never had one), but it still doesn’t work. I just leave it blank and press enter.
Should I put a password in for this to work?

Hoping for a reply. Thanks!

Okay. Sorry. Yeah. I put a password in. It worked. Thanks!:-)

superrrrrrrrrr……spent the whole month finding the solution…..Awasome!!!!!

Thank you very much… you have saved my live:-)

Delete all .DS_Store files inside your Homedirectory:
In Terminal type
find ~/ -name .DS_Store -delete

Thank you Quentin,

I was in panic mode until I read your blog. Worked like a charm.

I read many sites but none of them even came close to mentioning this fix.

Jerry

I’m currently having an issue with my finder quitting, and I need to find out how to remove DS_Store file. Each time I try to empty the trash on my dock, the finder quits and I have to reboot the CPU. Please help!!

Thank you so much!
Had this problem after transferring files and my finder quitted.
But now i see this al not an uncommon problem at all.

@ Ben Z @ JonnyW @matti – Your combined genius solutions worked! 😉 It took a while for me to believe that it actually worked! I’ve just been staring at that little finder waiting for it to pop up again & taunt me…ha ha. Oh my goodness I was in a state of panic as all other attempts I tried failed miserably. Thank you, thank you so much. Whew!

I have tried removing all the .DS_Store files (within my home directory) with no success. Everything is fine for about half an hour, then Finder crashes and I can’t open any applications that aren’t already open. I can’t even reboot as it gets stuck on the shut down spinner so I have to force power down.

Has anyone got any other suggestions?

Thanks.

    Theo – that sounds like something possibly more serious – or at least a more general problem.

    Have you tried more general remedies? (e.g. rebooting into the recovery partition, and using disk utility to repair the disk and the permissions)

    Or checking whether all the things being loaded at startup really need to be? You could also try booting into safe mode and see if it happens then.

My finder also keeps restarting continuously. Deleting the .DS_store file in the desktop folder and even all .DS_store files did not help. It however seemed to lessen the time between restarts ?! Any ideas?

OMG….. God has bless me with your wise-ness….it works

An update (I’m now on Mavericks and it happened this morning):

Any app that interacts extensively with the Finder can cause this – examples include:

  • Dropbox
  • Google Drive
  • FileTransporter Desktop

If you have anything like that running (e.g in your login items, in your toolbar), try stopping it and see if that helps.

In my case, FileTransporter was the culprit, and searching their knowledge base led me to this article.

https://support.filetransporter.com/article/AA-00398

Incidentally, the command they suggest:

sudo update_dyld_shared_cache -force

followed by a reboot, seems to have made a lot of other things work more happily too. May be worth trying for other reasons if it’s been a long time since your last clean operating system install.

this is nice but after i remove the culptrit .DS_Store it comes back in under a minute.

Got Something To Say:

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

*

© Copyright Quentin Stafford-Fraser