Defragment Everything at Boot Time

2

1

Is there any defrag tool which defrags every fragmented file at boot time? So far, all of the tools I have seen only defragment the page file, MFT and system files at boot time.

Nyx

Posted 2012-09-03T21:54:42.183

Reputation: 340

That's because otherwise booting the system would take far too long. – Ansgar Wiechers – 2012-09-03T21:57:06.830

Whenever I defragment my HDD, there is always a significant amount fragmentation leftover. I think this is because files are in use during the defragmentation process. – Nyx – 2012-09-03T22:00:47.637

@Marv wouldn't that make boot times really slow? – Moab – 2012-09-03T22:16:08.623

@Marv Possible. If you want to do a full defragmentation, you have to stop all non-vital services before running defrag. Defragmentation is somewhat overrated nowadays, though. As long as you have sufficient free disk-space and fragmentation remains below 15-20% your system should be fine. The only thing I'd really keep an eye on are registry and pagefile fragmentation. – Ansgar Wiechers – 2012-09-03T22:26:49.053

@Moab Only if I did it at every boot. – Nyx – 2012-09-03T22:43:09.283

@AnsgarWiechers Do you know a good registry defragmenter? – Nyx – 2012-09-03T22:43:27.880

1

Windows XP and Windows 7 should automatically do this at boot-time, only on Windows 2000 I have used Sysinternals' PageDefrag.

– Ansgar Wiechers – 2012-09-03T22:49:59.260

@AnsgarWiechers Windows does Not defrag at boot time, no version...Vista and W7 defrag on a schedule while windows is running. – Moab – 2012-09-03T23:20:02.193

@Marv any reason it has to be done at boot time? – Moab – 2012-09-03T23:20:43.210

@AnsgarWiechers, actually, XP doesn’t defrag the registry hives; PageDefrag is a great tool for it. Vista and up do indeed defrag them, so PageDefrag is unnecessary (though it can be run if so desired). – Synetech – 2012-09-04T14:03:35.047

Answers

3

I don’t know about defragging utilities with a built-in option to run on boot (Keltari offered one suggestion), but I would strongly recommend against automatically defragging on boot. When Windows boots, there is a lot of disk access as it loads the system, the user profile, the autorun programs, etc. If one of these programs is thrashing the hard-drive to defrag it, the whole system will get bogged down to a horrible degree (unless you are using an SSD in which case you shouldn’t be defragging at all).

A better option is to have an auto-defrag run at a later point after the boot process has finished.


Windows Vista+ added a new startup type to Windows services that allows them to be run automatically, but after Windows has booted. You could create a Windows service that runs the defrag program and set it to Automatic (Delayed).


An even better solution is to use a startup-scheduling program like Startup Delayer (figure 1). With it, you can configure it (and most of your other autorun programs) to automatically run on startup, but in a delayed, staggered manner so that the system doesn’t get bogged down and is responsive immediately. For this, you would want to set it to be the last item (e.g., ~2-3 minute delay) so that it the system has stopped most of its disk access by the time it runs.

Of course you will have to check the help-files of whatever defrag tool you like to see what command-line switches it uses (though usually running the executable with the drive-letter is usually sufficient, e.g., defrag c:).


(If you have a lot of fragments after defragging; then boot into safe-mode (in which programs are not autorun), and perform a regular defrag at that time so that files are not locked.)


As Ansgar suggested, you can configure PageDefrag (figure 2) to defrag the registry hives, page and hibernation files, event logs, etc. during the pre-boot. (It can run in Vista+, but is unnecessary.) You can also use (once every two or three blue moons), NTREGOPT (figure 3) to compact the registry hives (works in Vista+).



With this set of tools, you can keep your system in top condition.


Figure 1: Autorunning Windows’ defrag program:

enter image description here

Figure 2: PageDefrag’s options

enter image description here

Figure 3: NTREGOPT compacting a registry hive

enter image description here


If you must perform an actual defrag at boot, boot-time defragging is an actual selling point of UltimateDefrag.

Synetech

Posted 2012-09-03T21:54:42.183

Reputation: 63 242

1

UltraDefrag has boot time defragmentation. I have used it in the past, but not recently. It is free and open-source.

Keltari

Posted 2012-09-03T21:54:42.183

Reputation: 57 019