Do you really need to defragment your hard drive with modern versions of Mac OS X (eg. 10.4 / 10.5)?
The answer really, in most cases, is no.  A simple reboot or logout / login may solve the problem with very little effort. Apple has even written a tech note, specifically on this topic, see Tech Note # HT1375.
In summary, if you have a reasonable amount of free space on your hard drives, often Mac OS X’s efforts are enough to prevent fragmentation. But here are a few tips based off that Tech Note:
- Always format your drives as Mac OS Extended (HFS Plus), if you do not need to share data with non-Macintosh systems. HFS Plus attempts to avoid reusing space from deleted files, which helps reduce the amount of fragmentation.
- If you are running MOSX 10.2 or greater, the OS defaults to using delayed allocation, which also assists by taking groups of small allocations and writing them to a single large allocation in a empty section of the drive.
- MOSX 10.3 (Panther) and higher, use “Hot File Adaptive Clustering” to automatically defragment files that constantly being appended to.
- MOSX aggressively caches both hard drive reading (read-ahead) and writing (write-behind) which means that minor fragmentation has very little apparent effect on system performance.
- Do not use File vault if you are manipulating large files in your encrypted home folder. This includes your desktop!!! Instead save the large files outside of your home directory….
- Try to keep at least 15% of your hard drive space free. For a 300 gigabyte hard drive that would work out to be 45 Gb free minimum. This allows the OS to perform any clean up tasks it needs to, and gives it room to be able to automatically defragment files as it encounters them…
This does not mean that MOSX can’t get into a state where the drive is fragmented… So defragmentation tools can still help, but they may also hinder. MOSX consists of a tremendous number of Small to medium size files, approx 72,000+ files, and defragmenting many of those rarely access files will take quite a bit of time for very little gain.
Try either Logging Out and Logging back in, or rebooting. Often slow system performance is caused by an application that has a memory leak, and Logging Out/In or rebooting will force the majority of that memory to be released back to the OS.