Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Remove hidden core dump files to restore drive space System
A few months ago, I had a crash involving iTunes from which I could recover after the usual fsck at restart. However, one thing would not come back: 1.4Gb of my hard disk seemed to be lost. I tried many attempts with Norton Disk Doctor, File Buddy, etc., to locate new files and solve the issue. Just today, I finally found the culprit.

There's a hidden folder in OS X called /cores. This folder contains core.XXX (with XXX being a number) files which apparently are images of the computer memory that are left for debugging reasons after crashes or forced restarts. In my case, about 30 files of weights ranging from 30 to 70Mb were present.

Although I couldn't find a way to avoid these files from being created, I found an easy way to delete them. First, you'll need to run as root. You can access the /cores folder through the Go -> Go to folder... menu, and then type "/cores." Now, trash the size-eaters, and restart. Done, happy again.

[robg adds: In looking at the cores folder on my machine, I fond only one file, but it was 933mb in size (from April, 2003)! I was going to use the Terminal to trash it, but noticed that my admin account was the owner. So I just dragged it to the trash from the Finder (just to make sure it worked), emptied the trash, and bingo, 1gb of drive space was restored. So in my case, root wasn't required. Even if it were, you might find it easier (and safer) to just delete the files from the Terminal (after doing cd /cores) by typing sudo rm name_of_core_file.]
    •    
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[38,388 views]  

Remove hidden core dump files to restore drive space | 16 comments | Create New Account
Click here to return to the 'Remove hidden core dump files to restore drive space' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Remove hidden core dump files to restore drive space
Authored by: ddelo on Oct 03, '03 11:29:57AM

If you add "limit coredumpsize 0" into your ~/.tcshrc or ~/.cshrc file, it should eliminate those files



[ Reply to This | # ]
Schedule core dump removal with cron
Authored by: mfuhrer on Oct 03, '03 12:46:36PM
I prefer to leave core dumps enabled (I occasionally use them in conjunction with ddd - easy fink install, btw - for debugging my own programs) and look to cron for periodical clean-up. By adding the command

rm -f /cores/core.*

to your crontab file, along with relevant scheduling information, you prevent the core files from building up over time. More about cron and crontabs in this hint.

[ Reply to This | # ]
Schedule core dump removal with cron
Authored by: trekan on Oct 03, '03 01:51:34PM

If you want to have the core files for debug purposes, I'd rather delete them with this command in the crontab:

/usr/bin/find -name /cores/core.* -ctime 1 -delete

This only deletes core files older than 24 hours.



[ Reply to This | # ]
Schedule core dump removal with cron launchd
Authored by: tedw on May 14, '09 07:35:58PM
I feel obliged to point out that for OS X, launchd is always preferred to cron.

[ Reply to This | # ]
Remove hidden core dump files to restore drive space
Authored by: Krioni on Oct 03, '03 11:30:10AM

Um, either you or some other program must have turned that on. Apple's default is for core dumps to be limited to 0 bytes, which means you should have none. What were the dumps for?



[ Reply to This | # ]
Remove hidden core dump files to restore drive space
Authored by: asterisqume on Oct 03, '03 12:45:31PM

I'm the author of this "hint". I have no idea on what these were for. Have you an idea on how to turn this feature off? I don't remember having turned it on any time, but i try many utilities, so i might have done that by accident. It happened again, though since i deleted that gigabyte.



[ Reply to This | # ]
Remove hidden core dump files to restore drive space
Authored by: NetCurl on Oct 03, '03 12:03:59PM

Ya, I didn't have any at all, and I do recall reading or seeing somewhere that cores were supposed to be eliminated by default with the OS install. I'm not sure how they would get turned on by accident, but on two machines I found none at all.



[ Reply to This | # ]
Remove hidden core dump files to restore drive space
Authored by: mm2270 on Oct 03, '03 12:04:31PM

I found nothing in my cores directory. Seems to be empty. I'll take that as a good sign, although I'm always looking for ways to gain more HD space...



[ Reply to This | # ]
Current limits
Authored by: MattHaffner on Oct 03, '03 12:55:39PM

You can check your current limits with the 'ulimit -a' command in bash (type 'help ulimit' for more info) or the 'limit' command in tcsh.

The core should be zero. I did some basic hunting and didn't find any obvious setting in /etc, although you could also check the files /etc/csh.* or /etc/profile* and /etc/bashrc to see if there is a limit command in there that something or someone put in.



[ Reply to This | # ]
core-settings in /etc/rc.common
Authored by: voldenuit on Oct 03, '03 03:14:47PM

The place to look for is in /etc/rc.common, at the end of the file, here's the relevant snip :

# Enable coredumps if requested.
##
if [ "${COREDUMPS:=-NO-}" = "-YES-" ]; then
ulimit -c unlimited
fi

To make sure there is nothing wrong with your defaults you should grep all files involved in startup (etc/rc*, StartUpItems...) for ulimit.
My /cores directory was completely empty and I like it that way :-)



[ Reply to This | # ]
core-settings in /etc/rc.common
Authored by: MattHaffner on Oct 06, '03 12:40:50PM

Wow, I don't know how this escaped my 'grepping' :)

Anyway, just to complete the thought for those that don't like tinkering that much, placing this line in your /etc/hostconfig file will **enable** core dumps:

COREDUMPS=-YES-

Make sure it's either not there (the default) or is set to -NO- if you don't want them.



[ Reply to This | # ]
Remove hidden core dump files to restore drive space
Authored by: glowurm on Oct 03, '03 01:03:34PM

One file, hidden (named with . previous to characters) and less than 4K in size. Good spot to watch, and investigate for missing space, but not applicable here.

Personally, my big drive-eater is all the legacy apps and OS versions I've been maintaining on my system until recently. Three partitions on my OEM drive ate up 10 GB of space for old proggies and systems. I've recently used Carbon Copy Cloner to clone those to disc images on my new Maxtor (for back-up purposes, in case I actually need something) and re-formatted the whole thing.

<sarcasm>That gave me lots of space back.</sarcasm>

<brag>Now I honestly don't know what I'm going to do with the 30 GB of space free on my OEM drive. I've got that in addition to ~40 GB free space on my new Maxtor, and am sure I'll fill it up soon but *hate* to think of that much junk. And it's always junk.</brag>



[ Reply to This | # ]
30 core files?!!!
Authored by: repetty on Oct 03, '03 02:57:32PM

"In my case, about 30 files of weights ranging from 30 to 70Mb were present."

Thirty core files? Bud, you've got some significant issues.

Kinda reminds me of Nero fiddling while Rome burned.

--Richard



[ Reply to This | # ]
Remove hidden core dump files to restore drive space
Authored by: x827 on Oct 03, '03 04:40:53PM

I found my cores file empy, but I found another hidden file
at /private/cores... what is this file for?

It has two files in it called 'cores.199' and 'cores.200' date from 5/2002 and 6/2002.

BF



[ Reply to This | # ]
Remove hidden core dump files to restore drive space
Authored by: ralphthewizard on Oct 05, '03 02:26:46AM

Well, I found 30 some files at 2.42 Gb. For some reason, removing them restored slightly over 3 Gb to my system.

This is something I'll be keeping an eye on in the future.



[ Reply to This | # ]
Remove hidden core dump files to restore drive space
Authored by: Straitsfan on May 14, '09 04:35:55PM

Hi:

Just came across your post about core files. I'm learning about them as well in my Unix book for OS 10 by Dave Taylor. I did a find for all my core files and found these:

/Applications/.metadata/.plugins/org.eclipse.debug.core
/Applications/.metadata/.plugins/org.eclipse.jdt.core
/Applications/.metadata/.plugins/org.eclipse.pde.core
/Applications/eclipse/p2/org.eclipse.equinox.p2.core
/Users/chrislandalusa/Documents/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/Chapter03_Listing01/org.eclipse.jdt.core
/Users/chrislandalusa/Documents/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/first project/org.eclipse.jdt.core
/Users/chrislandalusa/Documents/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/ShowAFrame.java/org.eclipse.jdt.core
/Users/chrislandalusa/Documents/workspace/.metadata/.plugins/org.eclipse.debug.core
/Users/chrislandalusa/Documents/workspace/.metadata/.plugins/org.eclipse.jdt.core
/Users/chrislandalusa/Documents/workspace/.metadata/.plugins/org.eclipse.mylyn.bugzilla.core
/Users/chrislandalusa/Documents/workspace/.metadata/.plugins/org.eclipse.team.cvs.core
/Volumes/WINDOWS/Documents and Settings/Chris/.metadata/.plugins/org.eclipse.jdt.core
/Volumes/WINDOWS/Documents and Settings/Chris/.metadata/.plugins/org.eclipse.debug.core

I don't think, given the locations, that theses are core files from a crashed program (unless I'm reading them wrong). Are they? or are they files for my eclipse application that also have a .core extension?

I went to the /core folder on my mac and found nothing there.



[ Reply to This | # ]