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

Deleting large files System
You may have problems deleting large files. In my case, with OS X 10.3.9, I could not delete a 2.49 GB database file created by Entourage. It would cause a kernel crash, which can be very disheartening.

The problem may be journaling, that useful file system tool that keeps your data relatively safe from major corruption. It turns out that it cannot handle large files. Turn journaling off temporarily by opening Disk Utility (normally in the Utilities sub-folder of the Applications folder). Select the partition on which the large file has been "trashed." Then, under File select the Disable Journaling item, or just type Command-J to disable it. If there is an Enable Journaling option under File instead of Disable Journaling, then journaling is not your problem, and this hint won't help.

Return to the Finder and try emptying the Trash again. You can re-enable journaling by returning to Disk Utility, and selecting Enable Journaling under the File menu again, or by typing Command-J.

I do not not know whether there is some inherent limit to the file size, or whether the problem is that journaling needs enough free disk space to copy the file. In my case there was roughly 2.7 GB of free space available, more than the 2.49 GB file size, but not by much.
    •    
  • Currently 2.75 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[21,045 views]  

Deleting large files | 15 comments | Create New Account
Click here to return to the 'Deleting large files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Deleting large files
Authored by: wheeles on Oct 19, '07 07:44:57AM
I'm not sure whether it will work in this case, but when I used to manage large UNIX-based systems, if I ever wished to free up space taken by a huge log file and free the space immediately, I would execute:
cp /dev/null full path of file to be deleted
This would set the file's size to 0 and then it could be deleted without having to wait for the system to deallocate the space used.

[ Reply to This | # ]
Deleting large files
Authored by: wheeles on Oct 19, '07 07:50:27AM

I just tried it on a 3.5GB file and it worked fine.



[ Reply to This | # ]
Deleting large files
Authored by: seika7 on Oct 19, '07 10:18:00AM

I deleted a 10.3 GB Entourage database without any problems on a MacBook Pro running 10.4.10.



[ Reply to This | # ]
Deleting large files
Authored by: seika7 on Oct 19, '07 10:19:46AM

BTW, that was using the Trash/Empty Trash, not the command line.



[ Reply to This | # ]
Deleting large files
Authored by: Fairly on Oct 20, '07 07:50:59PM

That makes no difference. Setting the file size to 0 effectively deallocates the space anyway. And nothing is ever overwritten unless you're trying to do a purge or an srm. They're totally equivalent.



[ Reply to This | # ]
Deleting large files
Authored by: 6GTXEK on Oct 19, '07 08:14:09AM

I don't think it's correct to say journaling can't handle deleting large files. I delete much larger files (with less than the file size worth of free space) all the time and certainly don't get kernel panics. There must be another reason you encountered that problem. You've probably already done so, but if not, it would be a good idea to check your filesystem with Disk Utility and/or some third party disk test/repair programs. It could be some damaged structure causing the problem.

Definitely file a bug report with Apple, though! Deleting a file should NOT cause a kernel panic under any circumstances.



[ Reply to This | # ]
Deleting large files
Authored by: thegooch49 on Oct 19, '07 09:57:21AM
This is very true, regarding journaled file system. I had a 60GB log file (long story). When trying to delete it via the GUI, I got a kernel panic. The machine wouldn't start up after that. When I removed the drive, and plugged it into a good machine, the 'good' machine got a kernel panic. It was bad. The trick was to boot into single user, and disable journaling via CLI. That did the trick. I found this information in the thread below, and it saved my drive (and data)

http://forums.macosxhints.com/showthread.php?t=55973

[ Reply to This | # ]
Deleting large files
Authored by: garywade on Oct 19, '07 01:08:57PM

The problem, as I've determined, is RAM-based. I had set up journaling some time back on my iBook that had 384 MB and would face kernel panics when I started doing some web browsing. My guess, since no one at LaCie (the maker of the hard drive) or Apple responded to my requests for assistance, was that when I accessed a file that was bigger than my RAM, the kernel panic happened.

And, with your posting that demonstrates the larger file size, I would imagine you've got a 2 GB system, which is why you don't get the
kernel panic until that point.



[ Reply to This | # ]
Deleting large files
Authored by: dbs on Oct 19, '07 01:26:23PM

I'd guess your filesystem was corrupted before you tried to delete it. You can try fsck or DiskUtility, but your best bet is DiskWarrior. There is no reason filesize should make a difference for the type of journaling Apple does as far as I know. My understanding is that it journals the catalog data, not the file data. So it will write to the journal "starting delete of file x" and then when file x finishes deleting it will write "deleted file x". That shouldn't matter how big the file is, unless it's journaling data regarding the fragments. I don't know the answer to that.



[ Reply to This | # ]
Deleting large files
Authored by: Makosuke on Oct 19, '07 04:58:23PM

This hint may well be useful to some people, but the problem isn't as simple as "not enough free space on drive + Journaling" or "not enough RAM" -- I've deleted files larger than the total installed RAM on a journaled system with less free space than the file size many times without issue.

In fact, I can't think of ANY time I've had an issue deleting a large file, and I routinely move around multi-gigabyte disk images or raw video.

Probably better phrased as "If you get a panic trying to delete a large file from the Finder, try this..."



[ Reply to This | # ]
Deleting large files
Authored by: Anonymous on Oct 19, '07 05:31:02PM

Agreed. This is more likely to do with an unchecked disk.

* boot into single user mode (command-S)
* follow the prompts or type fsck -yf; exit; exit
* delete the file



[ Reply to This | # ]
Deleting large files
Authored by: RobertWGoodrich on Oct 19, '07 11:47:27PM
Thanks for the suggestion, wheeles . I had tried something similar:

cat /dev/null >! {filename}

and it also caused a kernel panic.

fsck and Disk Utility both exonerate disk corruption, although I did not try Disk Warrior. It may well have shown something, and I should probably run it just in case; it's overdue.

Thanks for all the suggestions and discussion. I posted more details on:

http://discussions.apple.com/thread.jspa?threadID=1183439&tstart=30

Bob

[ Reply to This | # ]
Deleting large files
Authored by: Quantumstate on Oct 20, '07 05:24:56AM

On my MBP 10.4.10 there doesn't seem to be any way to turn off journaling. grayed-out.



[ Reply to This | # ]
Deleting large files
Authored by: Quantumstate on Oct 20, '07 05:37:37AM

And BTW, Robert's core problem was lack of free space.

Journaling requires a minimum amount of free space in order to work, normally a bit more than the file being worked on.



[ Reply to This | # ]
Deleting large files
Authored by: gauvins on Dec 07, '07 02:00:21PM
I had a similar problem. Disabling journaling did the trick. In terminal:

To disable journaling for a volume called MyDisk, you would execute:

sudo /usr/sbin/diskutil disableJournal /Volumes/MyDisk

(quoted from KOVALIK HERE: http://forums.macosxhints.com/showthread.php?t=55973)

Delete the offending file(s). To restart journaling, terminal:

sudo /usr/sbin/diskutil enableJournal /Volumes/MyDisk

Looks like if the file is larger than the RAM *and* there is something wrong with it (mine was a video file resulting from an aborted process) there will be a kernel panic.

[ Reply to This | # ]