Tuesday, 20 November 2012

Windows Defrag

Defragmenting the Windows hard drive

 Defragmenting the hard drive. Before we go into defragmenting the hard drive it will be useful to explain what fragmentation is and how it occurs. On a hard disk information is stored in segments called sectors, each sector is 512 bytes in length. The Windows operating system stores files in units of multiple sectors called clusters or allocation units. Typically a cluster will be 4 kilo bytes. Files are placed on a Windows disk in the first available space and are allocated complete clusters. So if we have a file that is 1kb long it will occupy one cluster, a 5kb file would occupy two clusters a 21kb file will occupy six clusters. In a perfect world files would occupy consecutive clusters making ready and writing the files faster. As we use a computer we are continually adding and removing files. Consider what would happen in a simple system or three 3Kb files on a disk that had four clusters numbered one to four. Each file would occupy one cluster, file on occupying cluster one and file two occupying cluster two and so on. If we deleted the second file, cluster two would become empty, if we later added a fourth file that was 7Kb long. The fourth file would need to occupy two clusters. When we write the file the operating system will see cluster two as empty and write part of the file there. As the fourth file needs two clusters the second bit of file four would go into cluster four. The two parts of file four and not next to each other. We call this fragmentation. So now we know what fragmentation is and that it slows down the system, how do we get rid of it?

 Defragmenting a drive

 There are many freely available tools to defragment a drive, indeed Windows comes with the graphical Disk Defragmenter dfrgui.exe and the command line Defrag.exe. Both are good, free and already on your Windows PC!

Defraggler options
Defraggler options
However I prefer a third party tool called df.exe for scripting and defraggler as a gui tool. Both have more options than Windows built in defragmenters and both come from Piriform www.piriform.com. With Defraggler you can select to defrag file, folders or the entire drive. There are many options available. Defraggler is also portable. If a drive has not been defragmented previously, especially one that is heavily fragmented, say 20%, it will benefit from several consecutive runs of the defragger. What happens when you run a defragger is that the program woks out how best to shuffle the files around to achieve least fragmentation. It never does a perfect job, but each attempt will take it a step closer to that goal. Once you get down to say 5% fragmentation you are at the limits of practicability and will get diminishing returns for each re run.

So how often should you run a defrag, well that depends and really may be just a mater of opinion. I would suggest that once a drive is reasonably defragmented then keeping it that way can be achieved by defragging once every month or two.


  1. Excellent blog here! Also your website loads up very fast!
    What web host are you using? Can I get your affiliate
    link to your host? I wish my website loaded up as fast as yours lol

    my web page - proxykat

  2. Thanks for your kind comments. Glad you like it and hope you find it useful.

  3. Hope to pay increasingly on the off chance that you have windows that are difficult to reach or high windows. regcleaner windows 10

  4. they are often the ones that know who offers a good window cleaning service and who is reliable.solar calculator

  5. application software, although the programs may call zero to many other distinction is arbitrary, and often programs. Programming software provides some useful tools like text editor, compiler, interpreter, linker and debugger etc.hard drive recovery tool