How Does Disk Defragmentation Work?
-
What is Disk Defragmentation?
-
Disk defragmentation is a process that cleans up the data on your hard drive. As you use your computer, by creating, editing and deleting files, your drive becomes fragmented. Defragmentation optimizes the data that is stored on your drive so it runs faster and, often times, has more free space. Disk defragmentation must be done when no other programs are running, to prevent new files from being written to the drive, and should be scheduled to run when you will not be using the computer for several hours.
How Fragmentation Occurs
-
Your hard drive is made up of small chunks, known as sectors, that can only hold a certain amount of data. A single file can use a single sector or thousands of sectors, depending upon its size. When you write data to your hard drive, the files are stored in the first available spot, which can lead to a file being spread out at unconnected sectors throughout the drive. Over time, files become more and more spread out over the drive. Once this happens, your drive is fragmented, and it takes much longer to read data as the drive must search for the disconnected pieces over a very large area.
-
The Defragmentation Process
-
Disk defragmentation works by rearranging these disconnected sectors so the pieces of each file are closer together. The defragmentation program reads each sector of the drive and marks them as movable, unmovable or unwritable. Once every sector of the drive has been marked, the program goes through the files again to defragment them. During this process, the program finds the other pieces of each file and moves them as close together as possible. Most drives cannot be fully defragmented, due to unmovable or unwritable sectors, but the defragmentation process will allow the drive read files at a much faster rate.
Unmovable and Unwritable Sectors
-
Since both unmovable and unwritable sectors are skipped during the defragmentation process, a drive that has too many of these sectors can never be effectively defragmented. Unmovable files are files that are necessary for the computer to function. These include operating system files and the drivers that control your monitor or keyboard. If these files are very fragmented, the drive should be formatted and the operating system reinstalled. Unwritable sectors are portions of the drive that have been damaged on the surface, through too much use or a physical impact. Drives that have many damaged sectors should be replaced.
-