Monday, November 2, 2009

Boot-Time Defragmentation

I wish I had lots and lots of money to buy new equipment every few months, but I don't, never have, so I tend to use computers long past their "Best Before" dates.

Like the HP Pavilion zd8000 laptop I'm working on right now.

Yes, in these modern days of 64-bit Windows 7 and Core 2 Duo processors and giant drives, I'm running Windows XP on a 3.4GHz Pentium 4 with 2G (gasp!) of RAM and a 100G drive. It's my "main machine", the one I lug around to clients, the one I do almost all of my work on. With seven different versions of SQL Anywhere, plus Oracle 10g, SQL Server 2008, Visual Studio, blah blah blah... hundreds and hundreds of thousands of files.

And yes, my computer runs hot. Much too hot to hold in my lap. I even carry a little portable fan with me, to keep it from overheating and shutting down. And battery life sucks, less than one hour on a brand-new battery. But it's fast, fast, fast...

Over time, as more and more software is installed and removed, more files created and destroyed, performance on this laptop starts to slip. Such was the case this weekend when it became just too unbearable to wait 10 or 20 seconds for Wordpad to open a tiny text file.
Memories of mainframe, memories of 4.77Mhz.
No, there's no viruses or spyware or rootkits running, the router and firewall and Norton 360 and Windows Update take care of that. No apparent disk fragmentation, Diskeeper takes care of that (every time the screen saver kicks in, Diskeeper does some defragmentation).

I say "apparent" because if you go hunting around in the Diskeeper menus, you see there's a feature called "boot-time defragmentation"...

Tip: Don't check "Produce a summary log file" if you don't have a locally-attached drive that will be available during the boot period, other than the drive being defragmented. In other words, no network drives and (I think) no USB drives. Diskeeper won't warn you, but the boot-time defragmentation will skip most of the steps and you'll have to start over. You can specify a floppy drive A:, but who has floppies any more? No summary log for me, my laptop only has the C: drive.
The Diskeeper docs promise that the boot-time defragmentation process will do lot of work the regular defragmentation doesn't do, and that does seem to be the case. The reboot process took longer than an hour including before-and-after CHKDSK runs; the hard drive light was on solid for the whole time.

Here's part of the display output:

Boot-time Defragmentation Report

*** STAGE 0 ***
Stage skipped; MFT already defragmented.

*** STAGE 1 ***
Moved 3 files
Moved 1 attributes

*** STAGE 2 ***
Info: Paging file is not fragmented; skipping paging file processing
Located 335866 files...
Need 53421 clusters for folders & attributes

*** STAGE 3 ***
[xx%] Moving data file
Moved 12011 files from consolidation target areas

*** STAGE 4 ***
[xx%] Moving folder file
Moved 4417 folders to target area
Moved 5 attributes to target area

*** STAGE 5 ***
Moved 4 files
Moved 1 attributes

Contiguous Uncompressed Folders Moved: .......................... 4524
Contiguous Uncompressed Files Moved: ............................ 10805
Non-resident Attributes Moved: .................................. 10
Contiguous Compressed Folders Moved: ............................ 206
Contiguous Compressed Files Moved: .............................. 875
Fragmented Compressed Folders Moved: ............................ 1
Fragmented Compressed Files Moved: .............................. 24

Diskeeper boot-time processing completed.
Press ESC to reboot system.
Tip: When Windows asks to run CHKDSK because "One of your disks needs to be checked for consistency", let it run. Otherwise, Diskeeper will refuse to run any regular defragmentation steps and you'll have to reboot and let CHKDSK run.
After the boot-time defragmentation Diskeeper still showed a few "Pink - low performing system files"; not a lot, and much fewer than beforehand. Another regular defragmentation run got rid of almost all the pink areas, now it's all beautiful "Blue - high performing files and folders"...

I don't have screenshots from before all this, but here's what it looked like beforehand:
  • No "Red - low performing files and folders" at all, probably because Diskeeper runs regularly during screen saver periods, but

  • A large number of "Pink - low performing system files" areas that did not go away no matter how many times I did full manual Diskeeper defragmentations.
So how's performance now? A lot snappier, files and folders seem to open much more quickly, or so it seems. No hard numbers though :)
Tip: There's a wealth of information about Windows disk fragmentation on the Diskeeper site, including Myths of Fragmentation which includes this gem: "A freshly-installed operating system starts off with its files so badly fragmented that a simple defragmentation can decrease the boot time from 153.9 seconds to 111.8 seconds."

1 comment:

Breck Carter said...

So far, so good... after doubling the size of the Windows paging file to 4G via Control Panel - System - Advanced - Performance - Settings - Advanced - Virtual Memory - Change (whew!)

Not sure that was necessary but Norton Ghost 14 was falling over in a heap (see below). Now it works, maybe the paging file helped, maybe it was the reboot.

The new Ghost is really really sensitive... really really fast, like an F1 car is fast, with all the implications.

-Error E7B70001: Win32/Win64 API DeviceIoControl(IOCTL_VSNAP_SET_SNAP_VOLUMES) failed.

--Error EBAB03F1: Insufficient system resources exist to complete the requested service