Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Defrag--why doesn't it actually 'de-frag'?

Status
Not open for further replies.

jsteph

Technical User
Oct 24, 2002
2,562
US
I've been trying to defrag my Win2k workstation and it always leaves bars 'red' (fragmented) in the graphical display. I thought that if there was room, it would use that room and re-write the file into a contiguous block. I have huge amounts of what seem to be (according to the graphical display) contiguous free space. Certainly blocks larger than the largest file that remains fragmented.

Most of the un-de-fragged files I'm seeing are NOT system, read-only, or otherwise unmovable--although some of the ones listed below are r/o log files, but others not listed are simple text files I created and checked their attributes and they're clear.

It's like defrag is just lazy or stupid and doesn't do them. Sometimes if I run it again right away it gets some files that it missed. I didn't see the setting that said 'Only partially defrag and then give up', so I don't think that's checked. Why won't it simply defrag the files? Below is a curious example of the frag report:
Code:
Fragments       File Size       Most fragmented files
2               77 KB           \WINNT\Debug\UserMode\userenv.log
38              20 KB           \WINNT\system32\config\software.LOG
2               8 KB            \WINNT\system32\config\default.LOG
4               8 KB            \WINNT\system32\config\SECURITY.LOG
3               1 KB            \WINNT\system32\config\SAM.LOG

Most interesting is the last item--a 1K file in 3 fragments--I have 4K cluster size so how does that happen??
Thanks for any help or insight into this
--jsteph
 
One thing is, that defrag on Windows is a freeware version of a program called "Disk keeper". I know that the program that comes bundled with windows is alot less functional, intentionaly.
Less than 1% total system fragmentation isn't going to affect the speed of your machine, so I don't know if it anything to be concerend about.
 
I honestly do not see the issue you raise. The NTFS vs. FAT32 standard calls for much less rigourous defrag settings, and I suspect this is in part what is happening.

Since your did not complain about the MFT, or pagefile, obviously the standard and native defrag is doing at least a reasonable defrag job.

I certainly do not want anyone playing with the %winder%\system32\config folder. MS had the same idea. This is the folder that contains your registry, and in the design the notion was to leave it alone. You cannot afford an error or interuption here.

The wonderful folks at sysinternals offer several utilities to force a defrag of files that the windows utility will refuse to do. See, for example, :
But personally, I would leave the \system32\config folder alone myself.
 
splixx,bcastner,
Thanks, and I agree that it's not a huge issue. But I may have been unclear when the list that I posted started with the ...\config files--those are (or should be) system/read-0nly files so I understand them not getting defragged.

What I had noticed was files--some of them text files of my creation that were not r/o or system, that simply were left fragmented, but if I ran it again it would catch them.

The other issue was more of a technical question after looking at the sam.log above: How does a 1K file on a system with 4K clusters have 3 fragments?
--Jsteph
 
There is some discussion on this at I've used their DIRMS program, thought, without much luck. My W2K server is still very fragmented.

Another program to look at is the PageDefrag at the Systernals site that bcastner listed above ( This will defrag your SAM files.

James P. Cottingham
[sup]
There's no place like 127.0.0.1.
There's no place like 127.0.0.1.
[/sup]
 
I'm having a similar problems - When I Defrag a users laptop the image representation of the drive shows massive fragmentation at the end - if I drag again it just shifts the fragmentation around!
I've tried the utils but with no avail, any idea's?
 
How full is the hard drive? You may not have enough space to defrag all the files.


James P. Cottingham
[sup]
There's no place like 127.0.0.1.
There's no place like 127.0.0.1.
[/sup]
 
it's got 39% free space...

i ran contig again and defragmented the drive - it now reporting an average file fragmentation of 1.0005 per file.

if i re-run MS defrag it still shows this fragmented area.

i've run hard drive diags to confirm the HDD if fine, all ok.

 
A couple of more things to try:
1) From the command prompt type: (W/o the quotes) "Chkdsk c: /f". CHKDSK stands for Check Disk. The /f tells CHKDSK to fix any errors. You should recieve a message stating that the drive is locked, do you want CHKDSK to run on next boot. Press Y. Then reboot. This will fix any problems with file structure, etc.

2) Down load System MEchanic, install it and run it. It's fully functional for 30 days. It'll clean out temp files, 0 length files, clean your system registry, etc. In System Mechanic 4 there is a defrag. YOu can either do a quick defrag or an optimized defrag. Choosing the optimizing defrag will rearrange your drive to move most frequently used files/programs to where they can be accessed the fastest. Be forwarned, it will take a long time to run, depending on how large your drive is and how fast your cpu is.

If the above doesn't help recover some space, reboot into safe mode and try defragging there. You should also know that some files are placed at certain places on your HD and CANNOT be moved. They are where they are because the system or programs expect to see data in certain places.

Also check the defrag log after you've defragged. What files are locked? How large are they? Can they safely be deleted?

I have an NT 4 server that is approx 45% fragmented and will never get any less than that due to the large files that reside on the drive. Really slows things down. (They are images sent from a remote sie via web services and NO I can't delete them, as they eventually make their way to an optical storage unit).
 
Thanks for your reply... the user has teken his laptop home now so i can't work on it, but your tips are very handy i'm sure i'll use them very soon!

Thanks Again

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top