Why does Windows Defragmenter do nearly nothing on a disk with 23% empty space?

8

1

While trying to defragment a 80 GB NTFS (4 KB cluster size) volume on Windows XP, I encountered a strange problem: the defragmentation process is very quick, but also very useless. Graphically, I could see some files moving all around, but the fragmentation level remains the same.

Here's what it looks like after the volume has been defragmented:

The picture is a screenshot of Windows Defragmenter on Windows XP, with two graphical views of a disk: before and after; both are quite similar, and present a heavy defragmentation

I know there is a 15% free space limit. Actually, the volume is free at 23%.

Of course, Windows Defragmenter shows a bunch of files it was unable to defragment. Some are large (up to 1 GB), but not too large to be unable to move them during defragmentation. Not counting, I imagine, hiberfil.sys and pagefile.sys (they are immovable, aren't they?).

How do I diagnose this issue?

PS. Installing other defragmentation software products, as suggested on a similar question, is not a solution in my case.

Arseni Mourzenko

Posted 2011-09-09T21:53:17.837

Reputation: 1 700

15% is not a hard limit, just a rough estimate. – user1686 – 2011-09-09T22:31:27.463

1It's possible that the fragments are just big enough to where the cost of moving them together is equal to or greater than the benefit of moving them together. – surfasb – 2011-09-09T23:42:33.497

Are the large undefragmentable files by any chance open? Can you mention some of the really-fragmented large ones? – William C – 2011-09-10T00:24:54.510

@William C: those are users personal files (including those of not logged in users). They aren't used during defragmentation. – Arseni Mourzenko – 2011-09-10T09:56:41.190

Answers

5

The defragmenter does not have anywhere to move the big files to: all free space is somewhat evenly distributed in small chunks, so there wouldn't be any improvement if $VERYBIGFILE changed from, say, 20 close pieces to 10 scattered-all-over pieces.

One of the steps done by the defragmenter is file compaction, in which contiguous but separate files are shuffled around to form a single block of data. Try running this a few times, and it should get better over time.

You can also try contig -v somebigfile to defragment files one by one.

user1686

Posted 2011-09-09T21:53:17.837

Reputation: 283 655

4

Try rebooting into Safe mode, and then turn off as many services as possible. Open files will not moved or defraged, so the idea to to run with as few processes as possible.

Or remove the drive, and install it (as a data drive) on another PC for defraging.

sawdust

Posted 2011-09-09T21:53:17.837

Reputation: 14 697

1

You can disable hibernation and it should delete the hiberfil.sys. If not, you can manually delete it once hibernation is disabled. You can also disable your pagefile. Once those two large, undefragmentable files are gone, you might have better results defragmenting. Once, thats done you can reenable the pagefile and hibernation. Hopefully, after the volume is defragmented, the two other files will be placed in contiguous files.

Keltari

Posted 2011-09-09T21:53:17.837

Reputation: 57 019

1

Sysinternals has the Defrag Page File utility. I'm not sure how it'll work with the disk being arranged as it is, but it's probably worth a try to get those bigger files arranged and out of the away so that your standard defrag can more effectively get at the other files.

music2myear

Posted 2011-09-09T21:53:17.837

Reputation: 34 957

1

If defragging in safe mode doesn't help, then either

  • Empty your prefetch and superfetch folders. (Shudder!) These folders tell Defrag not to defragment certain files, which is the exact opposite of what you want,

or

  • Remove the drive and defrag it whilst connected to another computer. This makes sure that open files are as few as possible and that Defrag doesn't consider your PF data.

William C

Posted 2011-09-09T21:53:17.837

Reputation: 2 149