Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

September 17, 2001 12:00 AM

Disk Defragmenter

Windows IT Pro
InstantDoc ID #22244
Rating: (5)
Keep your Win2K system from going to pieces

The first lesson of disk fragmentation and defragmentation is how to use the jargon. No self-respecting IT professional uses the word defragment. The correct word is defrag, as in "I need to defrag my drive." Next, familiarize yourself with Windows 2000's built-in manual defrag tool—Disk Defragmenter (a lite version of Executive Software's full-power Diskeeper product). Disk Defragmenter works with Win2K APIs to gather fragmented files' segments and reassemble the pieces into files that reside in contiguous clusters on the disk. You can improve Disk Defragmenter's usefulness by knowing when it's important to defrag and the best way to go about doing so.

Fragmentation generally occurs after more than half of a system's disk space is occupied. At that point, files you add to the disk fill the empty spots left by files you've deleted. Often, this empty space isn't sufficient to contain an entire new file, so the file is fragmented (i.e., saved in separate pieces). The more fragmented the files on a system's hard disk, the slower the computer's performance for file input and output. Some experts believe that a fragmented disk also increases the chance of lost clusters and file segments (especially when you have an unexpected shutdown).

What the Tool Can (and Can't) Do
Disk Defragmenter works on both FAT and NTFS drives. (Don't believe the rumor that you don't need to defrag NTFS drives.) To defrag your drives, the program works hand-in-hand with Win2K APIs. Disk Defragmenter finds file fragments and loads them into memory, then writes the data to a part of the drive that has enough free space to hold all the fragments. Win2K tracks this new location and writes the location information back to the FAT in a FAT system or the Master File Table (MFT) in an NTFS system.

You can't use Disk Defragmenter to defrag the FAT, MFT, paging file, hibernate file (if the computer uses one), or registry. Also, the built-in defragger works only on the local computer. Therefore, you need to invest in a third-party program if you want to defrag system files, defrag remote drives, or schedule defrag tasks to occur automatically on multiple machines. (However, a few workarounds exist to help you defrag the paging file or schedule defrag tasks. See the sidebar "Work Around the Limits," page 124, for information about these workarounds.) The three most popular full-strength defrag products are Diskeeper, Symantec Speed Disk, and Raxco Software's PerfectDisk 2000. For a comparison of these products, see Tom Iwanski, "Enterprise Defragmentation Utilities," February 2001.

When (and When Not) to Defrag
I suggest that you run Disk Defragmenter on your systems immediately after you install the OS and before you install any software. Additionally, whenever anyone removes many files from a drive—especially during a software uninstall—defrag the drive immediately.

Then, defrag drives monthly or weekly, depending on how many files users delete and save on their computers. Computers that hold many data files—especially systems on which users frequently delete and save small files—are primary candidates for weekly defragging. Users who primarily use graphics or presentation software don't usually delete and save many small files, so monthly defragging should be sufficient for these users' machines.

Regular defragging is effective but can be onerous. As I mentioned earlier, you can't run the built-in program remotely, and you need Administrator permissions to launch Disk Defragmenter. Users generally don't have Administrator permissions, so you must assign an administrator to perform the task manually on each user's system. (Chalk up another reason to store data files on your servers instead of on local machines—as if data backup weren't enough motivation.)

Don't defrag servers that are running Microsoft Exchange Server, Microsoft SQL Server, or any ongoing Microsoft BackOffice type of application. These applications always have open files (e.g., transaction log files) that you shouldn't disturb. Disk Defragmenter can't defrag open files, so to defrag the server, you'd need to stop the services; doing so wreaks havoc. Instead, use the applications' built-in tools for cleaning and compacting files. (Usually, these tools can rebuild indexes and help get rid of the holes that result from deleted information.) Enterprisewide applications' defrag restrictions reinforce the benefits of dedicating servers to such applications rather than mounting the applications on servers that also provide file and print services.

Getting Down to Business
To open Disk Defragmenter, select Start, Programs, Accessories, System Tools, Disk Defragmenter. The main interface, which Figure 1 shows, displays information about the volumes on the computer.

Related Content:

ARTICLE TOOLS

Comments
  • Anonymous User
    7 years ago
    May 08, 2005

    Go to this site to re-install disk defrag.
    http://www.andreasroom.com/blog/archive/2004/01/18/defrag.aspx?Pending=true

  • Anonymous User
    7 years ago
    Mar 05, 2005

    I have the EXACT same problem as the first guy. i tried disk keeper on my XP home and when i uninstalled it, my original defragmenter wont open because of some snap-in failing to load or locate, i cant remember...but this is a good article. maybe add a section on re-installing your default defragger :) since microsoft has NOTHING about it documented.

  • Anonymous User
    7 years ago
    Mar 04, 2005

    Leaving free space between files gives Individual files room to grow. If you tend not to edit your files much, but download big files a lot, it's better if your free space is consolidated, allowing room for larger files to be created.

  • Anonymous User
    8 years ago
    Dec 18, 2004

    When I defragment...
    All the fragment are not removed...
    usually there is one or two left...why is this?

  • Anonymous User
    8 years ago
    Oct 15, 2004

    There is no need to make the files contiguous. On a drive that has lots of writing and growing files, its good to have the white gaps - it gives the files rooms to grow without getting fragmented.

    The only time you would want to have everything completely contiguous is if all you ever did was read the data, and never wrote anything.

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.