Should I defragment my hard drive?

I received an email from a client this morning with that question. It’s good one for writing this blog entry. First, here is a little background. James purchased his first Macintosh a couple of years ago. He is a long-time and very experienced Windows user.

The question of defragmenting hard drives also comes from long-time Mac users who recently made the switch to Mac OS X.

In the case of Windows computers and Macintoshes running Mac OS 9 and earlier, over time, hard drives slow down when the user tries to open, save or copy large files. On those computers, files are stored around the hub of the drive in the order in which they were saved.

The directory file on the hard drive keeps track of where files are stored and it keeps track of free space.

When a file is edited, the new version is saved to a different area of the hard drive. The directory is updated, and the space where the old file was stored is marked as free space.

When the user saves a file to the hard drive, the directory looks for the first space large enough to fit the new file and uses that space. If there is extra space from the old file, that area is left empty.

Over time, as files are written and rewritten and as files are deleted, there are more and more little chunks that are too small for new files to be written into. Then the OS for the computer begins dividing large files into smaller chunks or fragments to be able to store them. The directory then has to remember where the fragments are stored and it has to pull them together when the file is opened or copied.

There are utility programs that can be used to clean up this file mess. They are called disk optimizers or disk defragmenters. They re-write the files stored on the hard drive to put files of the same type together. In the process they eliminate the free space so that there is room for new large files. They also put files that are stored in fragments back together.

In Mac OS X, files are arranged in bands around the drive, depending on their function. In between the bands, there is free space for future files of the same type. Defragmenting utilities tend to pack all the files, regardless of their type, tightly around the hub.

Mac OS X is written so that it uses some of its free time to keep your hard drive organized. When your computer is on but asleep, Mac OS X is working in the background to defragment and rearrange the files to keep your hard drive running at its best.

An optimizing or defragmenting program will rearrange the files according to what its programmer thinks is “right.” When you quit the program, Mac OS X will take over again and rearrange the files the way the engineers at Apple determined was “right.” This is not good!

There are some drives situations in which it is you want to use a defragmented drive. If you are trying to capture audio and video files for serious editing in programs like FinalCut or Logic, it is best to use an empty drive as a working drive for capture and editing. Because there are no other files, these large files will not be fragmented as they are written.

After you are finished editing the file, you move it to a regular hard drive for storage and the working drive is erased the drive with Apple's Disk Utility before new files are added and processed.

It is also helpful to have an empty drive for Photoshop to use for the temporary files it produces as you edit images. If Photoshop is working correctly, the temporary files are deleted when you quit. If the temporary files are not discarded properly, erasing the hard drive where the temporary files are store can speed up Photoshop.

Apple has an area on its web site called Support. It stores articles about questions like this one. This article is a little old--but things have not changed. If you would like further information, read:

http://support.apple.com/kb/HT1375

There are lots to things to know about Mac OS X. While there are lots of articles and resources available, some of us do better with hands-on learning. If you would like a bit more help, consider booking a tutorial session with me at Dr. Mac Consulting. The cost is $60 per hour and we will cover just what you want to learn. Give us a call at 408 627-7577 or send us a message at urgentrequest@boblevitus.com.

--Pat
blog comments powered by Disqus