Power Tools For Disk Defragmenting

Disk Defragmenter

For the most part, the Disk Defragmenter application (located at %SystemRoot%\system32\dfrg.msc) that comes with Windows XP does a decent enough job of defragmenting a hard drive for most users.

But if you’re a developer, you are not like most users, often dealing with very large files and installing and uninstalling applications like there’s no tomorrow.  For you, there are a couple of other free utilities you should have in your utility belt.

Recently I noticed my hard drive grinding a lot.  After defragmenting my drive, I clicked on the View Report button this time (I normally never do this out of hurriedness).

Disk Defrag Dialog

This brings up a little report dialog.

Defrag Report

And in the bottom, there is a list of files that Disk Defragmenter could not defragment.  In this case, I think the file was simply too large for the poor utility.  So I reached into my utility belt and whipped out Contig.

Contig

Contig is a command line utility from SysInternals that can report on the fragmentation of individual files and defrag an individual file.

I opened up a console window, changed directory to the Backup directory, and ran the command:

contig *.tib

Which defragmented every file ending with the tib extension (in this case just one).  This took a good while to complete working against a 29 Gig file, but successfully reduced the fragmens from four to two, which made a huge difference.  I may try again to see if it can bring it down to a single fragment. 

I ran Disk Defragmenter again and here are the results.

Disk Defragmenter

Keep in mind that the disk usage before this pass with the defragger was the usage after running Disk Defragmenter once.  After using contig and then defragging again, I received much better results.

PageDefrag

Another limitation of Disk Defragmenter is that it cannot defragment files open for exclusive access, such as the Page File.  Again, reaching into my utility belt I pull yet another tool from Sysinternals (those guys rock!), PageDefrag.

Running PageDefrag brings up a list of page files, event log files, registry files along with how many clusters and fragments make up those files.

Page Defrag

This utility allows you to specify which files to defrag and either defragment them on the next reboot, or have them defragmented at every boot.  As you can see in the screenshot, there was only one fragmentted file, so the need for this tool is not great at the moment.  But it is good to have it there when I need it.

With these tools in hand, you are ready to be a defragmenting ninja.

What others have said

Requesting Gravatar... James Avery Oct 09, 2006 9:35 AM
# re: Power Tools For Disk Defragmenting
I am usually a big proponent of free tools, but if you really want a defragged hard drive check out Diskeeper.
Requesting Gravatar... Haacked Oct 09, 2006 9:35 AM
# re: Power Tools For Disk Defragmenting
I've seen that mentioned all the time. I assume you are really happy with it?
Requesting Gravatar... Robb Allen Oct 09, 2006 11:46 AM
# re: Power Tools For Disk Defragmenting
I owe the guys at Sysinternals my first child. I'm thinking about sending them the second one because their utils are that damned handy. I don't know what I'd do without Regmon, Filemon, and Process Explorer.
Requesting Gravatar... Braden Oct 10, 2006 5:24 PM
# re: Power Tools For Disk Defragmenting
I'm with James. I have Diskeeper installed and it just works...I never have to bother. The "Set it and forget it" really does do as it says.
Requesting Gravatar... Christopher Steen Oct 10, 2006 11:40 PM
# Link Listing - October 10, 2006
My Favorite Little Function - FixUrl [Via: Stephen Wright ] Generate Google Earth KML using ASP.net...
Requesting Gravatar... Jim Parzych Oct 11, 2006 5:43 AM
# re: Power Tools For Disk Defragmenting
Dirms

http://www.dirms.com/
Requesting Gravatar... Steve Harman Oct 11, 2006 7:28 AM
# re: Power Tools For Disk Defragmenting
I've got to agree with James and Braden... Diskeepr has been in charge of my HDDs for the past couple of years and I love.

Since configuring a custom "Set It and Forget It" defrag schedule, I've not had to manually defrag a single time.
One thing to note tho... if you plan to run Diskeeper on your Win Servers, you'll need to pony up for the Server edition.
Requesting Gravatar... lb Oct 12, 2006 3:26 AM
# re: Power Tools For Disk Defragmenting
i tried something yesterday called 'perfectdisk' and it worked a treat. 30 day trial.
Requesting Gravatar... Sayne Apr 29, 2008 10:52 AM
# re: Power Tools For Disk Defragmenting
Excellent! I ran a regular windows defrag last night, and was left with 29 files - a total of 36GB and ~100,000 file fragments that the defragger wouldn't touch. Even after it ran, it still recommended I defrag. How useless can something be? It took some time, but I contig'd each of the files that couldn't be defragged (sadly they were spread all over the disk, several different file types), then ran the regular defrag again and now its actually making some progress. thanks for the link, that's a drive saver :)

What do you have to say?

(will show your gravatar)
Please add 2 and 4 and type the answer here: