Summary: Defrag organizes the data on your disk for faster and more optimal access. If it crashes it's probably a problem with the disk's data.
I am unable to defragment my computer. I used to be able to do this but some 6 months or so ago, I noticed I could no longer do so. I could start the process but every time I got to around 10% defragged the computer would reboot. Sounds silly I know but I run XP on a Celeron 26000 and have tried everything I know to fix, short of re-installing. I am at a loss. Could you please shed some light on my problem? Have you come across this before?
•
I do have some ideas, yes. My guess is that there's something wrong with the data on your hard disk or the disk itself. The good news is that in all likelihood we should be able to repair it.
•
I would guess that the most common cause of the defragmenting software crashing is a "logical" problem on the disk. By "logical" I mean a corruption of the data on the disk, like the directory entries or the disks lists of areas that aren't in use.
My first step would be to run CHKDSK. Specifically, "CHKDSK /F".
Fire up a Windows Command Prompt (usually in Start, All Programs, Accessories, and type in CHKDSK C: /f (I'm assuming C: is the drive you want to defragment). It'll probably ask if you want to schedule the CHKDSK for the next time you reboot, to which you would say yes:

Reboot your machine, and allow CHKDSK to run to completion. Once your machine has completed booting back into Windows, try to defragment again.
If it still fails, I would next re-run the CHDSK command, this time using the "/R" switch (CHKDSK C: /R). This should perform a more thorough scan of your hard disk looking for errors and repairing them if it can.
If it still failed, I would next run the System File Checker to make sure that the files that comprise Windows itself are intact. Since the disk defragmenter is a part of Windows, if some component of this tool has been corrupted, this should repair it.
Finally, if things are still failing, then I'd seriously consider a hard disk repair and recovery tool such as SpinRite. It's not free, but it has a stellar record of repairing hard disks that have or are on the verge of failing. Since I believe that the disk defragmenter is most likely crashing because of problems with the disk, a run of SpinRite, followed by another run of CHKDSK, would be close to my last best guess at repairing this situation.
Related:
Ask Leo! - What is the System File Checker, and how do I run it?
Ask Leo! - How do I fix a cyclic redundancy check error when I try to copy a file?
Article C3031 - May 20, 2007
I had the same problem when I was using Windows ME. Defrag would go to only 10% and bounce back to zero and start over. Again at 10%, back to zero again. I don't remember who, but some computer tech. like yourself told me that the programs running in the background were part, if not all of my problem. He said to turn off everything I could and try again. It worked fine and everytime after I would automatically turn things off and had no more problems. I don't know if it is any help but it worked for me.
Posted by: Len at May 25, 2007 7:18 PMLeo,
Posted by: David at May 25, 2007 7:35 PMDoesn't "defrag" require a certain amount of free space to run...possibly that could be the problem? Altho I guess you'd get an error for that, I'm not sure. Just a suggestion.
After turning off everything that comes on automatically or timered, screensaver was the ultimate culprit.
Posted by: VIC at May 25, 2007 9:35 PMI had a somewhat similar problem some time ago, and it turned out to be something as simple as a screensaver or other software configured to activate automatically.
Posted by: Ken Power at May 27, 2007 4:32 PMIt was too far back for me to remember details, but ensuring that nothing could activate the drive whist defrag was functioning did stop it from continually restarting before completion, and occasionally crashing.
It also helped when I installed "Diskeeper", which takes care of defrag automatically, and works so much faster than the built in MS service.
Sometimes that reboot at the 10% level is because of something running in the background -- anti virus, etc. Boot into Safe Mode and then run the defrag program. It should run just fine then.
Posted by: Clive at May 29, 2007 10:22 AMHad the same issues some time ago. I suggest running defrag in 'safe mode' or, as was my cure, disable the antivrus software. Thanks.
Posted by: chris cafferata at May 30, 2007 7:28 AMMy system started shutting down when running defrag (no reboot). Later it shut down when Spybot was running. I checked out the CPU Usage via the Task Manager and found Spybot was utilizing the CPU at 100%. Checked out Defrag and found a similar situation. Hmm, I built this computer about 2 years ago and haven't cleaned it up. When I opened it up it was cruddy. I cleaned it up and restarted the system and no shutdown problems anymore.
Hope this helps and causes others to clean up their computers.
Posted by: Dave at May 30, 2007 11:07 PMThe defrag on my computer crashed on my machine several months ago and would also reboot after a few minutes. After reading your article and trying the "chkdsk c: /r" command my computer was totally cured of its ailments. Thank you Leo for your comprehensive help.
Posted by: steve at September 13, 2007 8:49 AMI have a similar problem my comp is basically a gaming comp with duel core and dual graphics cards, after i had to repartition due to a error checking crash the defrag would start get to 25% then just crash suddenly
Posted by: Mike at December 18, 2007 11:11 AM