Mac filesystem and defragmentation

2

Since the Mac OS is running on something kind of like Linux does that mean that it also doesn't get fragmented?

tony_sid

Posted 2010-08-08T14:54:17.973

Reputation: 11 651

Just a side node. OS X is based on BSD not Linux ... – Matteo – 2013-08-16T07:43:08.143

Answers

3

HFS+ filesystem - used by Mac OS - avoids reusing space from deleted files as much as possible, to avoid prematurely filling small areas of recently-freed space that causes fragmentation.

OS X 10.2 and above feature delayed allocation for HFS+ volumes. This means that a number of small file allocations can be combined into a single large allocation in one continuous area of the hard disk.

One cause of file fragmentation is usually continually appending data to existing files, especially with resource forks. With faster hard drives and better caching, as well as the new application packaging format, many applications simply rewrite the entire file each time. Mac OS X 10.3 Panther can also automatically defragment such slow-growing files. This process is sometimes known as "Hot-File-Adaptive-Clustering."

Aggressive read-ahead and write-behind caching means that minor fragmentation has less effect on perceived system performance.

So, in normal usage there's no need to defragment hard disks manually. However, if the disks are almost full, and you write large files (such as editing video), there's a fair chance the disks could become fragmented. In such a case, you might benefit from defragmentation.

One point to note is that OS X by itself has no disk defragmentation utils, so some third-party disk utilities are needed for manual defragmentation. Another option to defragment a hard drive without any third party tools is to back up all files, erase the hard disk, (reinstall the OS if operating with the startup disk) and restore backed up files.

(The information above based on Apple's guide about disk optimization.)

Jawa

Posted 2010-08-08T14:54:17.973

Reputation: 3 349

4

In general you don't need to run any defragmentation tools on a HFS+ filesystem.

More information from Apple: http://support.apple.com/kb/HT1375

ksoderstrom

Posted 2010-08-08T14:54:17.973

Reputation: 236