On Windows, disk fragmentation happens a lot of times, and when a user switches to Mac, the Mac disk defrag or defragmentation is one of the first things the user wants to know.
One of the first things that a person using a computer will realize is that within six months after buying a new computer, it will slow down appreciably. This can be due to any number of things. The hard disk might be full, a lot of programs have been loaded, there are a lot of items on the list of startup programs, or even because of undeleted temporary files or the existence of zombie processes. For those who use Windows for heavy graphics programs or those who have lots of files being added and deleted almost daily, hard disk fragmentation might have occurred.
The following are 10 things a new user needs to know about Mac disk defrag:
10. The more files you have, the more fragmented your disk becomes
Fragmentation is when the hard disk is full of files, which are not stored in single contiguous blocks. There are several reasons why this happens. When you first write on the hard disk, as much as possible the files are written as a single contiguous block of data. When the file is read, the hard disk spindle reads these blocks almost without moving around the hard disk, which is a very fast way of reading the file. When the hard disk starts getting full, and files are also being erased, there are instances when a large file has to be broken up into several blocks of data in order to be stored in the hard disk.
9. Working with large files causes more fragmentation
Another way that fragmentation occurs is when a hard disk is relatively full, and then a large file is edited. This results in partial rewrites. The portions of the file that were not edited do not need to be re-written. The portions that were edited out would be deleted, and instead of writing over the deleted portions, the edits would be written elsewhere on the disk. This is done to allow for undoing the revisions.
8. Mac’s Hierarchical File System Plus was designed to solve fragmentation
Not all computers, however, need to defragment their hard disks. That is not to say that fragmentation occurs, only that whatever fragmentation does happen resolves itself internally as part of the file system. The Mac OS X uses the Hierarchical File System Plus (HFS+), which is a based on the older HFS system used on the Macintosh Plus and later systems, up to Mac OS 8.1. The advantage of HFS+ is that it is a journaling file system, which helps in data recovery in the event of a power interruption while the hard disk is writing data to the disk. The methods used by a journaling system also enables the file system to be able to defragment on the fly, or while the computer is running.
7. Rewriting and not overwriting works faster, with almost no fragmentation.
Because of the way data is written on a hard disk, there will always be some point when files will become defragmented. The approach used by HFS+ is to make keep the old files, intact while writing the new files elsewhere. This makes sure that a deleted file can be recovered if the need arises. Only when the space is needed will the deleted file be overwritten. This timing of the overwrite is dependent on the hard disk free space. The smaller the free space available, the bigger the chance that the deleted file will be overwritten.
6. HFS+ always tries to write the file on a contiguous block
In terms of fragmentation, the file system will try to find a contiguous block of free space, which will have enough space to fit the new file. This also works for any file undergoing revision. The newer version will be written as a whole, instead of in pieces. This also allows for faster writing and file saving.
5. Using aggressive read-ahead and write-behind prevents fragmentation
Current hard disk technology also makes fragmentation less of a problem. Because of current hard disk algorithms on read-ahead and write-behind caching of data, minor fragmentation does not affect system performance unlike before.
4. Defrag-on-the-fly with the Mac
Just in case a file is fragmented, it will be defragmented during times when there is low hard disk activity, However, there are conditions when defragmenting-on-the-fly is resorted to:
● File size is less than 20 MB
● The file is not currently in use.
● File permission is not read-only.
● The file is fragmented.
● System is running for at least 3 minutes.
If the above conditions exist, the fragmented file is rewritten into a single contiguous block, without the user noticing it.
3. No fragmentation happens when using solid-state drives
Some of the most popular Macs nowadays use solid-state drives (SSD). These are the MacBook Air and some models of the MacBook Pro. SSDs are not like hard disk drives (HDD). Instead of having a hard disk’s spinning at several thousand RPMs, an SSD is more like SD and CF cards and use the same technology. These make the SSD faster than HDDs. SSDs also run colder than HDDs, are a lot quieter, and they also use less power. SSDs also do not need to be defragmented, but for an entirely different reason. Because an SSD’s sector can only be overwritten a finite number of times, defragmenting it will only make accelerate the degradation of the media. And because it does not have any moving parts, defragmenting an SSD will have no effect on making it read or write faster.
2. Small frequently used files are usually placed on a hot zone and defragmenting is bad for these files
Mac OS X is a Unix variant and this file system uses a lot of small files. When possible, these small system files are stored on a disk’s hot zone which also happens to be the fastest part of the disk. Running a disk defrag program will most probably move these files out of the hot zone and might register a slight dip in hard disk performance.
1. Backup and delete would give a better performance boost than a defrag.
Backing up files before deleting them from the hard disk can lead to better hard disk performance. With more free space, more and bigger files can be stored as a whole instead of fragmented parts. For most computers, whether Mac or Windows, having 10% free space or less leads to significant performance degradation. You can have this by doing mac disk defrag regularly.