Quentin Stafford-Fraser's blog

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).

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.

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.

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.

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.

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!

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!

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!!

@ 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.

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?

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)