Helping people with computers... one answer at a time.

When you defrag files the pieces of the file are physically arranged for quicker access. But you can't defrag some files. At least, not easily.

My wife's computer shows several fragmented files remaining after a defrag. She has tried uninstalling some programs but some will not uninstall. What can I do to help rid her of this problem or is there a program that will help with this?

My first reaction is to suggest not calling it a problem. It's not at all uncommon to have some files that refuse to defrag, and that's quite alright.

Let's look at some of the reasons, and some of the ways to force the issue if you still feel you need to.

Defragging, or more properly, defragmenting, is the process of taking all the parts or "fragments" of a file on your hard disk and making sure that they are physically next to each other, and in order. Files don't need to be that way ... the first part of your file could be on the outer rim of the hard disk, the next part somewhere on the inner portion, and other parts scattered in between. The "problem" that defragging solves is when all those pieces are next to each other and in order, the hard disk has to do a less work to access the file.

"The most common cause for files not getting defragged is that there's not enough free space on the hard disk to do so."

There are several technical approaches to defragging, but most require that you have enough free space on your hard disk for a copy of the largest file that needs defragging. Typically defraggers just require some percentage of free space, like 10% or 15%.

If there's not enough room for a second, temporary, copy of the file then the file cannot be defragged. The most common cause for files not getting defragged is that there's not enough free space on the hard disk to do so.

The second most common cause is that the file is in use by some program. That's why most defragging utilities suggest you close down all running programs prior to attempting to defrag. One of the things you can do when you run into this situation is to look at the list of files that were not defragged and see if they are in use. This article: How can I find out who is using a "file in use"? explains how. If you can, you can then shut down the program that has the file open, and try defragging again.

The next problem is that the operating system, as part of its normal workings, often has files open, and that therefore cannot be defragged. One very common example is windows paging or swap file. The folks out at Sysinternals.com have a free utility, PageDefrag for just this purpose. It can schedule a defrag of the system files on your next boot, before the system is actually running.

Similarly, booting from a CD such that the operating system is running from the CD and not your hard drive might also be an option to allow a normal disk defragger to run.

But my question is - why bother?

Defragging the files you can defrag easily, and regularly, gets you 95% of the performance gain you're looking for anyway. Jumping through these extra hoops to get the system files defragged is typically just not worth it, unless you've determined that these files are severely fragmented. And that's rare.

My recommendation is to simply do the normal defrag every so often. If you leave your computer on all the time, this article, What is 'defragging', and why should I do it? even includes instructions on setting up an automated defrag every night, which is exactly what I do.

Article C2704 - June 26, 2006 « »

Share this article with your friends:

Share this article on Facebook Tweet this article Email a link to this article
Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

54 Comments
Carl Goodwin
June 30, 2006 9:11 PM

I just reformatted my hard drive, and my machine says the same thing when I defrag after all my programs are re-installed. Funnily enough though, there are no programs in the list of "un-defragged programs", even though it says to look in the list!

Dave
July 2, 2006 1:52 PM

Sometimes the easiest solutions are the best. Try defragging in "safe mode" and turning off your screensaver. Altho, as Dave says, you have to have enough free space on your harddrive for the defragger to work right.

dave
July 2, 2006 1:55 PM

ooops, sorry, i meant "as Leo says" mahbad!!

frank pearce
July 5, 2006 3:39 PM

just did a defrag and this file wouldn't defrag.....\system volume information\restore{12920...... what does it mean wasn't like it a few days ago help thanks

sacred
August 3, 2006 7:55 AM

delete all restore points and try defragging again :D

ryan raven
January 1, 2007 12:56 PM

how do i defrag system files?

Leo Notenboom
January 1, 2007 1:00 PM

Your question is answered in the article you just commented on.

ryan raven
January 3, 2007 8:19 AM

how can i remove resered system space?

joe holes
January 3, 2007 8:20 AM

i have a bunch of blue files scattered in large chunks and they wont seem to move closer together in one big chunk any ideas?

art
January 4, 2007 9:38 PM

Do nothing. Blue chunks is what you want. That there are spaces between chunks means nothing.

charlie
January 5, 2007 7:59 PM

Thanks for the info Just one question. I have a red line as well can broadband be the cause.Will a virus do it. (sorry thats two)

Charlie
January 5, 2007 8:02 PM

Sorry Leo I forgot to add Ihave 87% free space

ryan raven
January 6, 2007 4:07 AM

i know this has nothing to do with what we are talking about but im buying new motherboard woth a LGA775 socket will my 478 fan fit? and if u want good performace with diskeeper buy perfect disk as well and do loads of reboot times with it.

carl
February 26, 2007 2:44 PM

all my system files are evreywhere any way to move all system files into 1 chunk?

THOMAS BUCKLEY
April 26, 2007 8:38 AM

i have 37% free space on harddrive, but a lot of red fragmented files that won't defrag,is there any way i can get rid of most of these

Carrie
May 2, 2007 2:24 AM

I have tried everything to defrag my XP laptop E drive which is the recovery drive..it is down to 6% which is too low. I deleted a ton of games and empieted the trash bin. Nothing happened. Can you help and is my computer going to crash?

greg
May 6, 2007 4:14 PM

My laptop will not defragment at all. I am running XP. I start the defrag and nothing happens. Can you help?

Joseph
August 6, 2007 1:24 PM

What would cause files not to defragment is not the lack of free space because i have 79% of free
space and my computer is slowing down more and more everyday what should i do!!!

mercgal
August 19, 2007 11:36 AM

The following file won't defrag f28ebf0cde5a4d16a78b376afd10a98c.sdf
Can anyone tell me if this is safe to remove? It is found in the Docs & Settings\All Users\Application Data\Microsoft\eHome\EPG\
Thanks for any help.

Lil Brat
September 6, 2007 12:05 AM

I cannot defrag my C: drive because the files that need to be defragmented are no longer in my computer (so i think)... A lost file (recovery was done) to obtain deleted files after a master reboot was done. (not by me ) lol... anyhow I cannot delete these files so I cannot defragment them either. My Hard drive says I have space available but when i go to defrag. there is blocks of red fragmented files that wont defrag so it is lagging my computer... Any help on how to remove these files will be appreciated...I have 31 % of free space but I shoud have 100 GB free...The files that are stuck are jpg's and mov files... can anyone help me ? I have windows XP Home Edition

Drakonis
October 10, 2007 10:19 PM

Did NOT answer the question.
The built in WinXP defrag won't run period without 15% free space. But even then, some files won't defrag. That is the question to which no answer was given. 10 gigs on a 60 gig hard drive is more than enough for a defrag..yet some files will not defrag. for example.

This article was a waste of my time....

Leo A. Notenboom
October 11, 2007 3:23 PM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Apparently you didn't read the entire article. There are more reasons listed
there than just disk space.

Leo


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFHDqJBCMEe9B/8oqERAsHsAJwPlPMmh7tFzyJ92BhRgiKKv3OZlgCeJWPD
E+yAYX9WquRMpX+KNIQCtd0=
=pnLA
-----END PGP SIGNATURE-----

Bobcat
October 15, 2007 7:48 AM

Leo's explanation is correct : the available free space has to be atleast twice the size of the largest file to be defragmented. So the actual percentage of free space is not the only factor, but the size of the fragmented file is important too.

There are also some system files like the Master File Table (MFT) that cannot be defragmented by the windows defragmenter, but requires a third party utility. While defragging some of the other system files may not be important, the MFT and paging files need to be defragmented for the best performance. Essentially, defragment the 'normal' fragmented files and the MFT, and you're all set.

I use an automatic defragmenter that defragments my 3 drives as and when necessary quietly in the background, so remembering to defrag or scheduling one for late nights is not a factor. I like it much more than the old conventional manual defrag or scheduled defrag because it automatically and intelligently tackles fragmentation in the background, without interrupting my computing. And I dont waste *my* time defragging 2x160GB and 1x 250GB worth of drives..

Mack leyland
December 20, 2007 10:19 AM

My C drive , which contains the operating system and all programme files will not defrag, I can acces the defrag menu but once I select defrag it hangs at 15% there is 19GB free space on that drive.

Joe
January 22, 2008 10:38 AM

Yes, I read the article, but still unsure where my problem, "based on its size" fits in.
I have an IMAGE file that won't defrag that consists of 16,583 Fragments and its size is 46,023 MB. I have a 111 GB drive with 48% free space. Can this be a major contributor to why my machines are running slow? If so, what can I do to fix it?

Thank you,

Joe

Leo A. Notenboom
January 22, 2008 5:58 PM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Wow... that's a big file. 45gig on your 111gig hard drive..
that one file is taking up nearly half your space. Yes, I'm
not at all surprised that the file wouldn't defrag.

There's no way for me to know whether its fragmentation is
responsible for your system slow down - that depends too
much on how you use your system and what else is running
on it.

And what it is one does with a 45 gigabyte file.

Leo


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFHlp9SCMEe9B/8oqERAhlKAJ9Xqypx9mgfxPPklCbIlwogDe0HTwCeP9GI
CPLU3gPOxEUgPGBWjeBulZc=
=KGgi
-----END PGP SIGNATURE-----

liascos
January 24, 2008 11:11 PM

my xp craptop wont even start to defrag at all.
60 gig drive with 17 gigs free.
but the analize and defrag buttons are dead.

Chris
April 3, 2008 11:53 AM

I'm surprised that you recommend defragmenting your hard drive every night. Do you WANT your hard drive to die from all that extra work? Once a month, or even 3 months is PLENTY.

Leo A. Notenboom
April 3, 2008 2:18 PM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

First, I don't believe that defragging really shorten's the
drive's life appreciably.

That being said, I did drop back to once a week, just
because nightly defragging was of little benefit.

Leo


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFH9UmxCMEe9B/8oqERAgaAAJ9FJmf+WanexQ/EbAVomixCMZVf9gCeNV8D
Fdl8Zh6+4N2+E4lWWaBNQx4=
=ROIe
-----END PGP SIGNATURE-----

Ruud van Gaal
April 8, 2008 8:49 AM

The hint for PageDefrag is reason enough alone for this article.
Almost 10 years ago, I had a bunch of SGI O2's where a defragger would be active around 3am-5am. It would start, defrag, then remember where it was for the next day. Things like this should be part of the OS; it really helps your system's speed and Microsoft would be better off with some good news about their currently flaking OS. ;-)

Jerry Spinazzola
June 23, 2008 3:28 PM

My Sony desktop has always defragged using the XP home utility until only the past month or so, when I got the "Some files did not defrag" message" and worse, since the report box, which is made not to be maximized in size showed only the start of the file path: \docs & settings\name etc. which is all I could see. Printing didn't help, but after saving the report I found that the stubborn file is a db file used by Google Earth. The full path is Documents and Settings\MyName\Local Settings\Application Data\Google\GoogleEarth\dbCache.dat. In the past I have always done a disc cleanup followed by a empty recycle bin, then a defrag, which has worked fine. My 80G drive is partitioned C/D from the factory with most space on D due to "Click to DVD" software and the OS is on the 13.97G of the C drive, which had 21% free (3.03G) space the 1st time I got the files not defragged message (and 17% now), which seems to be enough space to double copy the largest file. The report says the Google file is 395Mb, 105 fragments, and the timing seems to coincide with a recent updating of Google Earth to a new version. Windows Explorer shows a 409.6Mb dbcache.dat file & another smaller 2Mb index file. I have an external 250G backup drive also. So, my questions are: Should I uninstall/re-install Google Earth? Is there another available defrag utility I can use if the PageDefrag utility above won't (will this work-don't think this file is a paging file?); and will it work on a file of this type? Or should I ignore the issue, since it seems the only slow-down would be when using Google, which does seem to run more slowly even though I have FIOS internet?

Leo
June 24, 2008 5:46 PM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I would ignore it. The effect of having that one file
fragmented are nearly neglible.

Leo


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFIYZVmCMEe9B/8oqERAkuXAJ4rbbFPRHiN32j0v1i5J3netBB9AQCfT0WP
I3FOjf2CrRIMYC6v/EKRINg=
=Bejo
-----END PGP SIGNATURE-----

Russ
June 27, 2008 4:41 PM

This is great information, but my issue is slightly different. Yesterday, for the first time, I got the message that some files did not defrag, but NO FILES were listed in the log. In the past, when a file did not defrag, it was listed and I was able to resolve it. Did another defrag today, same issue. Thanks.

Luke
July 17, 2008 12:56 AM

Hi there!

I use the windows disk defragmenter on my XP. It only gets to 40% and then comes up with that error message saying that some files could not be defragmented.
I recently reformated my harddrive (as it was running too slow) and i got this message before (and after) the reformat.

I have 50% (35Gb) free space on my hard drive...

Can you offer any advice?

Cheers!

Penny
July 17, 2008 6:18 AM

Zipped files won't defrag. That was the problem when I was getting the same message. May be something to look for.

Leo
July 17, 2008 10:22 AM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

".zip" files defrag just fine. Defragging doesn't apply to
the files within a .zip.

Some files won't defrag typically because they're too big,
or perhaps because they're exclusively locked by an
application or by the operating system. For example normal
defrag programs cannot defrag the paging file - that
requires extra steps (and it's typically not worth it
anyway.)

Leo


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFIf3/XCMEe9B/8oqERAr6LAKCEO8r+AOqTZhZCu/0NmwrYYwwCNwCfSgIt
DMMomoOMB/Ufn+tZTSv0LnM=
=AVBI
-----END PGP SIGNATURE-----

Tom
September 6, 2008 5:19 AM

You have some good advice, Leo. My hats off to ya!

Eternalbodom
September 8, 2008 2:32 PM

I installed MS XP SP3 upon virtual PC over Vista, the Virtual PC has Elastic virtual Hard drives, and all the files within the .vhd are less than 1.5gb, neverthenless, the .vhd weights about 3.5gb, I defragged it, i notieced most of the files were nicely aranged one next to other excepting some small pieces over there.
At sight I saw the space between most of the files and the small files over there was a bit more than the space used by most of the files, that makes me think, if I defragged those files, the page files, I may reduce the .vhd size about 1.5gb!, so, I need a Defragmeter thet defraggs it all.

Jim Rowbottom
September 21, 2008 8:05 PM

I'm getting the same "some files would not defrag" message. However, my concern is that I have a huge amount of fragmented files and Windows XP keeps saying I still need to defragment. I have some very big audio recording files and I'm wondering if they're just too big to fix. Also, I'm using Norton System Works Speed Disk to optimize and it's taken days just to move 10% of the files. Should I move some of the files to my other drive and try to defragment a little at a time? I'm moving pretty slow in that drive and I need to be fast in the studio. Thanks for all your great advice, keep it up!

Jimmy Moore
October 24, 2008 11:44 AM

I have 57.23 gigs total on my NTFS,hard drive with only 13.24 gigs, (23%) free space. There's an enormous amount of fragmented files, (about as much as total contiguous files and unmovable files combined.) Up until a few weeks ago, when I defragged, I got a pretty clean slate and had plenty of free space, but the fragmented file(s)started growing and has continued to grow and my free disc space has dropped from 34% down to the current 23%. I've checked and none of my files are in use by another user,entity, etc. I've exhaused my defragging efforts and my question is - What happens when I run out of space? Is my computer going to lock up or what? Thanks, Jimmy

Fragmentation is not related to free space. In you case I would absolutely investigate where your hard disk space is going, but focusing on fragmentation is not going to get you there. I would have you start with this article: Where's my disk space going?
- Leo
25-Oct-2008

ali sherif
November 1, 2008 12:10 PM

i have windows xp .i clicked MY COMPUTER then SHARED DOCUMENTS and opened .nothing happend !!

Robert Newbold
November 28, 2008 8:21 AM

How do you consolidate the system files so you have larger free contigous space on your drive?
It is impossible for my page file to be in a single fragment because I have unmovable system files scattered over the disk. I have jkdefrag, contig and pagedefrag. I also have format but I'd rather not use! It's not very important but I'd like to know how.

colleen Wright
February 17, 2009 5:14 PM

is there a way to reverse the defrag?? i did a defrag yesterday and now my computer wont play sound and some files are missing???

Nope. And besides, a defrag doesn't do anything that would result in those behaviours. I suspect you have other issues at play here. Might be time to run a CHKDSK on your hard drive, for example.
- Leo
18-Feb-2009

Apocalypse-r
July 1, 2009 11:15 PM

theres a tip you can use to help force a file to defrag. it works with any reasonable small (less than about half your remaining space) file not locked by the operating system, even the most severely fragmented (3000+ fragments per 100 megabytes) files. If you have already run the windows defragger, it will at least have made some attempt to group free space together, even if it cant get all the files. So, you copy and paste the file into the same folder. This will force the OS to allocate space for another file, and it will choose the largest spaces available. It will then assemble the fragments of the original into the large spaces it allocated, which (barring the most severe of space shortages and file fragmentations) will usually drastically reduce the number of fragments in the copied file. When the copy is finished, delete the original and rename the copy to what the original was called. This will often jump start the defragger should you decide to run it multiple times, because it will no longer choke on the heavily fragmented ones at the top of the list (which you did this to =])

BarbaricFellow
November 10, 2009 4:01 AM

Either paste and copy the file in the same place again. OR..look at the file's properties for something like "this file is from another computer and is locked" Its rare but happens once in a while with downloads from certain sites (or copies of the file)) Then unlock it and all is ok again.
After 6 years of using Diskeeper these are the only "tricks" I needed to know.

(XP pro servp.3)

SoloSymphony
December 11, 2009 2:23 AM

I've seen people comment here and there about moving single files or bunches of files from one drive to another to defragment them; through the inherent process, if the destination HDD is sufficiently defragmented (or empty) the files should neatly lay out in a smooth order on the disk platters - that is my understanding.
I have just under 3TB (yes, that's Three Terabytes) of HDD space across a handful of External and internal drives.
With the speed of file transferring over connections like SATA-3Gb/s (yes, even one of my external drives is that fast), being so fast, shouldn't it be like the holly-grail of Defragging options just to hop-skip-and-jump entire HDD's worth of data from one drive to another (preferably to an empty or well defragmented one)... automatically defragmenting in the process?

BRENDA BULLARD
January 26, 2010 8:48 AM

disk def. has detected that chkdsk/f. is scheduled to run the volume. hppalvion
please check chkdsk/f.

LindyLoo
July 3, 2010 2:33 AM

My pc has just told me (for the first time since I purchased it several years ago and after many defrags) that it cannot defrag all the files. My pc has 77% free space. I recently downloaded a programme from Nokia, which I later uninstalled because it didn't to what I wanted it do and also made my pc run slow, and I ran a wash programme I have that allegedly removes any residues left after uninstalling programmes. I only got the "cannot degrag all files" report from the next time I degragged after uninstalling this programme, so wonder if it was that which is affecting it. I ran the defrag again with everything shut down but it still came up with the same message. It says all of the files it cannot degrag are in \documents and settings\All Users Application. I'm not much of a pc expert. Is it worth trying to get these particular files to degrag? Will whatever/wherever they are have any long term impact on the performance of my pc?

Nope. Not enough of an impact to waste any time on.
Leo
03-Jul-2010

swc1971
January 12, 2011 11:01 AM

I only have 16% available space (46.64GB used and 8.99GB free). Report told me following: Volume fragmentation info: total fragmentation 15%; file fragmentation 30%. all of them are in my itunes folder. I went in and unchecked read only hoping that would help but it didnt. Do i need to further attempt to defrag this? I have already deleted all the files and programs I feel comfortable deleting to try to free up more space.

Eugen
May 13, 2011 8:22 AM

Mein Gott! I have 17% fragmented files on my laptop, and all of these fragmeted files (147 fragments!) are on the "System Volume Information". How can I defragment the System Volume Information? Please, help me.

Did you try pagedefrag as mentioned in the article you commented on?
Leo
14-May-2011

Darlene
June 7, 2011 6:51 PM

My AVG Internet security 2010 reports that I"m protected and up to date, but windows defender warns that the malware moniter is off. When I update the program it reads completed successfully, and gives a error code. How can I resolve this problem?

gelatogirl
October 14, 2011 1:45 PM

I have 1 GB free on my laptop's 136 GB hard drive. This is after I have completely emptied my hard drive of photos, videos, documents, pictures, etc. (moved to external hard drive). I'm not aware of any huge programs on my computer, and it was set to defrag every week automatically. Recently, I tried to defrag manually, and it said I had 70% fragmentation. It took a few hours to go through the process, and when it was finished, it still said I had 70% fragmentation. I know you said lack of hard drive space would reduce ability to defrag, but any advice would be appreciated!

We'd have to examine which files are still fragmented. Chances are it's the system files: Why won't some files defrag?
Leo
15-Oct-2011
Mike
February 2, 2012 12:32 PM

The question for me is "why won't some files defrag under NTFS?" I've been using defraggers since PC Tools Compress v.4.21 (way back in the DOS era--also when dinosaurs roamed the earth) and every FAT-based defragger I've used (PC Tools Compress--all versions, Norton Speed Disk, MS-DOS 6.x Defrag, Win9x Defrag--at least in Safe Mode) not only defragmented every single file, but if I wished (and I usually did) it "compacted" the files so that all of the files were together and all of the free space was together (which of course made defragmenting larger files easier). I have mostly been out of the Windows "loop" for the past several years as a Linux user, but dip back into the Windows world now and then. I have yet to find an NTFS defragger that will do what the FAT/FAT32 defraggers could do routinely. They only defrag files to the extent that there is EXISTING contiguous free space to do it with. They don't move anything to create contiguous free space. And files are still scattered (many of them still fragmented) all over the hard drive.
Are there NTFS defraggers which will do the complete job like the FAT defraggers have? If not, why not? Particularly, does it have anything to do with the nature of the NT File System? Thanks. Sign me "Baffled".

I don't believe this is a FAT versus NTFS thing at all. The concept is pretty similar on both. What has changed is the OS which is now locking some files in use thus preventing them from being defragged at all. But again, that's true of either FAT or NTFS. I'm not aware of a tool that not only defrags but moves all defragged files together physically in a single pass (or looking at it the other way: defrag the free space). If it matters that's typically done by simply defragging multiple times. (I've done it and 2-3 times seems to do the trick.) I agree it would be nice, but the files (not the file system) and the way that Windows uses them over time is so much more complex than it was years ago I'd expect the benefits thereof to be somewhat transitory anyway.
Leo
06-Feb-2012
William C. CURTIS
March 16, 2012 10:05 AM

Leo: Remembeer I don't know what the hell I'm talking about. I'm only a typist with benefits! But since most of us have far more memory than we need why doesn't M/S program windows so there is routinely a 'buffer' between progams for fragmented files? More to this suggestion if you are interested.

Actually ... it does! The real issue is that so many files are being accessed that it's not always as globally useful as one might think.
Leo
17-Mar-2012

Comments on this entry are closed.

If you have a question, start by using the search box up at the top of the page - there's a very good chance that your question has already been answered on Ask Leo!.

If you don't find your answer, head out to http://askleo.com/ask to ask your question.