Disk fragmentation answers

Captain Code

Moderator
Staff member
Mod
http://www.kernelthread.com/mac/apme/fragmentation/

Found this article linked from a slashdot story on HFS+ disk fragmentation. The author has created a program to test disk fragmentation and concludes that HFS+ is very good at not fragmenting, and shouldn't require defragmenting ever.

He doesn't say what would happen when the disk is fairly full, and how well it would auto-defrag.
 
OS 10.3 performs it's automated defragmentation tasks overnight. Would it work if I leave my computer on overnight, but log out?
 
d54321k :
If you would read the linked article, you would see some relevant information about when optimization takes place, which is generally when needed, and on-the-fly.
The night-time tasks are the automated cron tasks (daily/weekly/monthly) which AFAIK, have nothing to do with file system optimizing per se, and are basically cleanup tasks.
 
There are two automatic file optimization routines that take place in Panther. Both take place only on the boot volume and require the use of HFS+ (Mac OS Extended) disk format and that journaling be turned on.

Automatic File Defragmentation.

When a file is opened, if it is highly fragmented (ie. 8+ fragments) and the file is under 20MB in size, it will be automatically defragmented. This is accomplished by the file system just moving the file to a new location. While this does defragment relatively small and badly fragmented files, it tends to contribute to more disk/volume fragmentation, a performance tradeoff.

Adaptive Hot File Clustering

On drives over 10 GB in size for a period of 60 hours, the file system keeps track of files that are read frequently (for a file to be considered as a hot-file, it must be less than 10MB and never written to - in other words system and application executable files). At the end of this period, the the files that have been read the most times are moved to the "hotband" of the disk. The "hotband" is that part of the disk which is particularly fast given the physical characteristics of the disk and will vary from brand to brand and model to model.

The size of the "hotband" depends on the size of the disk and is allocated at the rate of 5MB of hotband space for each GB of disk. So a 120 GB Hard Disk would have a "hotband" of 600 MB. "Cold" files that were in the hotband will be moved out of the hotband to make room for the hot files. As a side effect of being moved into the hotband, the hot files are defragmented.

Question

If Panther optimization is as good as the slashdot article would indicate, why is it that my boot drives tend to become extremely fragmented over time? I will also admit that as long as there is plenty of free space on a drive, I have not observed any noticeable performance benefit from defragmentation. On a crowded drive with minimal free space, that is another story altogether.
 
DeltaMac:
I read it. But it said that on-th-fly tasks happen to small files (under 20 mb). I couldn't find anything about large ones, like DVD VOB files, etc..
 
Back
Top