Automated Hard Drive Defragmentation

I tend to ignore defragmenting my hard drive until I belatedly realize it probably looks like swiss cheese by now:


This is a companion discussion topic for the original blog entry at: http://www.codinghorror.com/blog/2005/12/automated-hard-drive-defragmentation.html

Yeah, I work with VMs a lot and having their disk image files fragmented can really kill performace, so I’ve been playing with defrag utils a bit. SysInternals also do a “contig” util that does single-file defrags and that is quite useful for VMs. I’m currently a fan of PerfectDisk after testing DiskKeeper and getting annoyed that it would regularly put the big files in its “too hard” basket (and it’s the big files that I care about). However it has better options for playing with the MFT etc. Interested to see whether there are better options.

I had been using similar VBScript to defrag my HD regularly :slight_smile: Except that I need to exclude a drive (“S” to be exact for my source codes) being a result of “subst”.

Microsoft’s new Windows OneCare Live will do this for you. It will also backup important files and delete “unnecessary” ones (scary).

a href="http://www.windowsonecare.com/Default.aspx"http://www.windowsonecare.com/Default.aspx/a

“Wouldn’t it be nice if the operating system took care of defragmentation all by itself in the background when I’m not using the computer?”

Um… I thought it does? Or what else is that lengthy hard disk rattling I’m hearing occasionally when the HD isn’t otherwise busy?

Have you tried leaving your PC alone for a few minutes with a fragmented HD and see what happens?

Well, PowerToys for Windows XP has an option called “Optimize hard disk when idle”.

“— allows Windows to rearrange files on the hard disk when the computer is not in use to improve performance.”

It seems to be off by default though. At least on my machine.

And by PowerToys I mean TweakUI to be specific…

A nice feature of the newer versions of Diskeeper is that they will stop themselves if disk activity becomes high… so if you start a high-demand activity while a background defrag is running, the defrag will back off until the disk demand drops.

Mac OS X has had it for awhile (I bet you never get tired of hearing that):

a href="http://macslash.org/article.pl?sid=03/10/29/190237"http://macslash.org/article.pl?sid=03/10/29/190237/a

Windows is just trying to do what linux has been doing right for years (cleaning out all the temp files, etc). Except it’s not necessary to defragment in linux.

I can’t believe you wrote that and didn’t mention Buzzsaw and DIRMS from http://www.dirms.com/

“the operating system took care of defragmentation all by itself in the background when I’m not using the computer?”

What if the FS was designed to have minimal fragmentation?

Who ever defrags their ext3, reiserfs, xfs… partitions?