Defragmenting Paging File


With Diskeeper (7.0.413) I wanted to defragment the paging File on my system-partition.

Some info:
I have WindowsXP Pro, is located at volume F (NTFS).
The Paging File is also located on this volume (only on this volume).
Volume F is 6 GB big, 1.16 GB is free.
Paging File is 1.15 GB big (system-controlled)

When I run ‘Boot Time Scheduler’ on this volume (all options enabled) I get the following Summery File:

Diskeeper® NTFS Boot-Time Defragmenter Version 7.0 Build 145 20011217
Copyright © 2001 Executive Software International, Inc.

Minimizing Paging File Fragments…
Directories -> MFT Mirror end…
Pausing at end…
Minimizing MFT Fragments…
Summary File Set To: C:\DIRCON.TXT

Boot-time defragmenter detected that this volume is slated to have CHKDSK run,
Boot-time defragmenter cannot run on a dirty volume. Please run CHKDSK /f
Failed to initialize for volume F: – volume probably not mounted or is not NTFS
Exiting –

Can anyone tell me whats the problem ??
I really want to defragment the Paging File…

Thanks in advance !!

It seems like there are some corrupt data on your F drive. Windows XP uses CHKDSK instead of the Scandisk utility that came with previous versions of the OS such as 95, 98 & ME.

To run CHKDSK, bring up a DOS prompt (start->All Programs->Accessories->Command Prompt). In the DOS screen, type ‘CHKDSK F: /F’ and when requested to run CHKDSK upon the next boot, press ‘Y’. Reboot your PC and allow the CHKDSK utility to boot. You may need to repeat this if it fails to start as sometimes CHKDSK won’t run upon bootup, but it does the next time.

After CHKDSK has fixed the problems (if any), run your Defragmentation tool again. Hopefully this should do the trick. :wink:

This is telling you that something is wrong with the file system, lost clusters, cross linked files, etc. You need to save any critical files that you can’t afford to lose. Then open a dos window on a drive other than F and then run the command chkdsk /f f: The /f command means fix and the f: specifies the drive to be fixed, drive f in this case. If f is a system drive you may get a message that you have to do this on the next manual reboot. If that’s the case do it. Then after reboot, chkdsk will run and hopefully fix the problems. Then you can run the pagefile defragmentation. You can do all of this in one step by using the Boottime defragmentation option in diskeeper. You can also “defrag” your pagefile by deleting it and rebooting and then adding it back. Good Luck and Happy Christmas!

I did an chkdsk-scan and after that I ran the Paging-File-defragmenter.
I got a summery file that noted that there was not enough continious free space to move the paging file.

Maybe the second option by blackwolf is more easy…
Then I just have to delete the pagefile.sys-file in the F:-root ?? (is this possible, 'cause the system is using it, right ??)
Run diskeeper to make free-continious-space and reboot ??

Well… tomorrow I will try if this works…
Happy Christmas 4 u 2 too !! :smiley:


I could also make the partition bigger by using Partition Magic so that there is enough continious-free-space…

Your problem is that you have the paging file set to different min and max sizes. This should be a separate issue from the damaged sectors. Set your paging file to 20-20MB and reboot, then run checkdisc. If you cannot recover the damages sectors, it’s time for a new HD. Once you have resolved that issue, then re-create the paging file and be sure to set min=max size. It will never fragment again. God only knows why M$ defaults to different min/max sizes, but it’s a bad way to manage it.

Rdgrimes is absolutely correct that the failure to pass the chkdsk test and the fragmented page file are separate issues. You replied “I did an chkdsk-scan…” It is important to note the results of this chkdsk. Did it pass? Make sure that you get this step correct before you do any thing else. Once you get the disk to pass chkdsk, you can go on to the pagefile issue. The pagefile is actually deleted on the reboot and not when you are using it. That’s the purpose of the reboot. You can usually add the pagefile back without rebooting since you are not using something that you don’t yet have.
Back to the passing of the chkdsk program for a bit. This is usually caused by a program, Win XP is a program, being shut down or closed improperly and not indicative of an impending hard drive failure, but it can be! Windows 9X is famous for hanging up and making you press the reset button to get it running again. Then they have the gall to tell you, when scandisk is running, that it was your fault, that you should have shut the system down properly, when they should have displayed an apology for making such a crappy os! Windows XP does this sometimes too, but nothing like 9X. You might want to run chkdsk on all of your drive partitions just to make sure that they are ok.

The did the following:

Changed PF to 20min-20max… reboot
Analysed with diskeeper that PF is small…
Runned command and typed: chkdsk f: /f /v /r /x… answered yes… reboot
Watched the info on my display on reboot… “0 kB in damaged sectors”… autoreboot
Watched summery info on this boot: “The volume is not damaged”…
Defragment F:\ with Diskeeper…
Changed PF to 1150min-1150max… reboot
Analysed with diskeeper that PF is not fragmented…

I get this in return:
It is much better now… :smiley:

I runned the ‘Boot Time Scheduler’ again, with all options enabled, to defragment the PF… rebooted…
Then I got the no-continious-free-space-error again, but there IS enough continious-free-space… :frowning: (see link)

Thanx for ur help but 1 last question: Is there a way to get my PF in 1 piece ???

I am assuming that Diskeeper will not get the pagefile into one piece by using the Boot-Time Defragmentation option. I hate to admit it, but I also have gone to extremes to get the pagefile into one piece. It appears from you screen snapshot that you have three fragments. You can try this. Delete the pagefile again. Then copy a file or files just large enough fill up the area just past, or up to the Reserved System Space, the light-green diagonally striped area in your link. CD images are good for this. Defragment the disk again, only if necessary, to make the disk space contiguous. Then put the pagefile back. I usually set it to the size recommended by Microsoft. Use the analyze option to verify that your pagefile is in one segment. Then delete the file(s) that you copied. This is a perverted way to go about this, but it has worked for me.
You can also relocate the pagefile to another disk with more space. If you do make sure that it’s on a fast drive. It appears the Microsoft Windows XP doesn’t look at the free space globally, but rather piecewise when the pagefile space is assigned and that Diskeeper can’t fix it. I am not sure how much performance gain that you will get by this or any at all for that matter. It may be just the makings of a “pretty picture.”

I think the botom line here is that you don’t have enough space for a PF that large. Diskeeper needs enough space to move the entire file, and it isn’t there. The only other option i can suggest is to move other files off the disc, then defrag with the large PF, then move the other stuff back. Partition Magic can fix this too, by moving free space from the adjacent partition into “F”.
I also agree that there is likely no performance hit from have a few fragments in the PF.
Performance Monitor can tell you if you really need that much PF too.

I could solve this by using Rdgrimes’ advice, only then I have to resize the partition behind the volume F, that is 56 GB big and almost full so I dont want to do that… takes too long.

The making of a better picture [;)] is finally solved by using Blackwolf’s 2nd option. Moved PF to C:, defragmented F: and then switched PF back to F:.

This is the result:

PS: I’ve read at TweakXP that the PF must be 1,5 times the amound of RAM.
I got 768 MB so PF-size must be aound 1152 MB, also recommended by windows.
Rdgrimes, how do u see with M$ Performance Monitor that the PF is too large??

I’ve read at TweakXP that the PF must be 1,5 times the amound of RAM

That’s just outdated information, and don’t forget that M$ is the one that set it to different min and max sizes. This all dates back to Win9x.
Performance monitor can monitor virtually every system parameter, but what you want to monitor is committed RAM, available RAM, and paging file use. You can save the monitor setup and run it from your desktop whenever you are doing heavy tasks. When you see how much paging file you are really using you can set it there. My guess is you’ll rarely see it get over 25% usage. And don’t forget that Windows will gladly inform you if you run out of virtual memory.
The ONLY reason to say that 1.5 x RAM is necessary is if you intend to analyze memory dumps after a crash. When’s the last time you did that? I keep mine set to never do a memory dump. Anyway, you don’t have room on your system drive for the memory dump file! :frowning:
Considering the state of the volume in question, it’ll be impossible to defrag as it is. I would cut the PF in half and use the monitor to see if you can reduce it even more. The alternative is to move the paging file to a second physical drive, which is where is should be anyhow.

You could always use PageDefrag for Windows NT/2K/XP from sysinternals, its free and easy to use :slight_smile:

you can grab it from here