Google

Thursday, April 3, 2014

How Auto-Defragmentation Occurs on Mac OS X based Computers

As far as fragmentation is concerned, Windows users have an upper hand because of the inbuilt ‘Disk Defragmentation’ tool that is used to improve the performance of computers when they come across an unusual state of gradual performance downfall. On the other hand, Mac machine lacks such a tool in Disk Utility (i.e. the Mac inbuilt disk management toolbox, found at Applications/Utilities/Disk Utility).
 

Disk Utility is helpful in some cases like fixing corruption in a volume and/or its permissions, drive partitioning tasks, and more. However, when it comes to carry out defragmentation on Mac, Disk Utility is helpless. Mac users believe that the ‘so-called’ excellent Mac machine they are using does not come across any such issue, which also is a statement of Apple Inc. Well, hard drives do undergo fragmentation, no matter which computer they are installed on. Even Mac machine experiences performance downfall issues due to fragmentation.
Auto Defragmentation of Mac
 

According to Apple’s statement, Mac machines do not experience fragmentation since they are smart enough to deal with it automatically. The statement indirectly points to the HFS+ file system that is used to format the hard drive installed on the Mac machines. In fact, the HFS+ file system scans each file being opened for fragments, and then defrags it automatically, if necessary. However, the criteria is applicable only to the files below 20MB of size. Therefore, the users himself has to defragment Mac files above 20MB of size, which obviously requires a commercial defragmentation tool.
 

How Fragmentation Occurs
The term ‘fragmentation’ is associated with the algorithm that a computer operating system implements to save data on the hard drive. On Macintosh based computers, the HFS+ file system is assigned the task to allocate a block to each file saved by the user, where the term ‘block’ refers to a small region of the space on the hard drive, which is intended to store a file individually as well as efficiently. However, a number of blocks contain free spaces due to implementation of an inefficient block allocation algorithm.
 

The free or leftover space in a block on the hard drive is termed the ‘fragment’.
On the other hand, when a large file is saved, Mac file system breaks it into a number of segments, and then these segments are stored individually in multiple blocks on the hard drive. The blocks occupied by the segments of a file are linked to each other logically. However, the inefficient block allocation algorithm fails to store these segments contiguously. Consequently, the file segments are stored in multiple blocks non-continuously.
 

Imagine a large file is stored on the Mac. Undoubtedly, since the size of this file is larger than that of the storage blocks available, the HFS+ file system will break the file into segments of smaller sizes. Consequently, some of the filled blocks contain free space because of their smaller size, while many ones are filled efficiently. The state of the hard drive caused when free spaces are present inside the filled regions of the hard drive is termed as internal fragmentation.
 

As mentioned above, the HFS+ file system is responsible for blocks allocation on the hard drive on Mac machines. Macs often come undergo inefficient utilization of the blocks when a poor storage allocation algorithm is implemented. Consequently, the segments of a file are stored non-contiguously. In such a state, the unfilled blocks are available outside the allocated region though. However, they fail to store files because of their smaller size. Such a state of the hard drive is termed as external fragmentation.
 

Since the HFS+ file system cannot store large files in the available blocks, it breaks all such files into segments, and then stores them. In this state, the segments of the files are scattered; and it is thus, termed as data fragmentation.
 

Defragmenting Mac Drive
“Defragmentation refers to a mechanism to rearrange the blocks of the hard drives in a logical order in order to reduce the response time of data, thereby dealing with the fragments appropriately.”
 

Disk Utility in Mac OS X is able to fix disk related problems; however, it lacks defragmentation tool. In order to be able to deal with fragmentation, you must have a commercial defragmentation tool. However, the developer – Apple denies for any such requirement for Mac systems, as the HFS+ file system itself is able to deal with fragmentation in an efficient manner. For this, it scans each file thoroughly for fragments when it is opened. In case a file is found as highly fragmented, it defrags that file automatically. However, the files it scan and defrags automatically not more than 20MB of size, which means the users need to defragment Mac file that are above 20MB of size.
 

Mac OS X does not allocate recently emptied blocks to save new files. In fact, it shifts all such blocks backwards in order for henceforth allocation. This minimizes the odds for fragmentation to occur. Also, it adds all frequently accessed files to hot file zone, which makes all these files available again at a much faster rate.
 

As discussed earlier, the HFS+ file system on Macs defrags the files automatically when they are opened. However, it does not mean that all files meet the required criteria with no failure. In fact, the size of the fragmented file can be up to 20MB of size in order to be defragmented automatically by the HFS+ file system. In other words, Macs OS X is not able to defrag large files (such as movies, Mac applications, and HD videos), and therefore requires professional defragmentation tool.
 

You can download a defragmentation app from the Internet, as this not only enhances the performance of your Mac system considerably, but optimizes the free space as well. However, make sure the application you use is reliable and you have proper information about how it is used to defrag the Mac drive. If you do not, then you must go through the software user manual. Or else, consult the experts for required help of any kind.