topics that matter; ideas worth sharing

share a tip, submit a link, add something new

How to defrag

April 18, 2001, 01:03 PM —  Network World — 

File fragmentation is one of the constants of Microsoft’s, and other, operating systems.

On a brand-new drive, the first files written are all written to contiguous parts of the drive, making for the fastest possible read times. Gradually, as more files are added, removed or changed, there is no longer adequate contiguous space, and the new files take whatever space is available. This leads to file fragmentation and longer access times to read the files, as well as longer time spent writing changes or new files.

To overcome this problem, you use a disk defragmenter utility. This moves parts of files and free space around until the files are using as contiguous a space as possible. Windows 2000 (like all Microsoft operating systems since Windows 95) includes a built-in defragmenter utility, which you should run from time to time.

You will notice, though, that some files are never defragmented by this utility. Among these are the NTFS Master File Table (and its mirror copy) and the Virtual Memory Paging file (the so-called "swap file"). Nonetheless, these will become fragmented over time. There are ways to remove the fragmentation, but they're relatively drastic -- so you should be sure to have decent backups before attempting these procedures.

The swap file is best defragmented by re-creating it. To do so, follow these steps (for Windows 2000):

Click Start, point to Settings, click Control Panel, and then double-click System.

On the Advanced tab, click Performance Options.

Click Change to open the Virtual Memory dialog box.

Change the paging file to another drive.

Reduce the minimum and maximum size of the original paging file on the drive you want to defragment to 0M bytes.

Restart your computer to have the system use the new paging file.

Run Disk Defragmenter on the original drive to consolidate the free space segments created by moving the paging file.

Re-create the paging file on the original drive.

Reduce the minimum and maximum size of the temporary paging file to 0M bytes.

Restart your computer.

Defragging the Master File Table also requires re-creating it, but you'll want to make doubly sure you have good backups, because the procedure will destroy all data on the drive! Nevertheless, it can increase access time to files.

First, you'll want to see how fragmented the file table is. Do this by performing a Disk Defragmenter analyze operation to generate a report. View the report and look for the section of the report called "Master File Table (MFT) fragmentation" (it’s under Volume Information). It might look like this:

Total MFT Size = 8512K

MFT record count = 8,504

Percent MFT in use = 99%

Total MFT Fragments = 4

Then get a copy of Microsoft's Knowledgebase article Q174619, "How NTFS Reserves Space for its Master File Table (MFT)":

http://support.microsoft.com/support/kb/articles/Q174/6/19.ASP

You'll use the data from the report according to the instructions in the article to adjust the NtfsMftZoneReservation value. But first you need to back up and reformat the volume in order to create a contiguous MFT using the higher zone reservation space, and then perform a full volume restore. This is not something for the faint of heart! Nevertheless, it can increase the pperformance of your system -- sometimes remarkably.

» posted by ITworld staff

Network World

I like it!
Post a comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
Resources
White Paper

Symantec Backup Exec 12 and Backup Exec System Recovery 8 deliver industry leading Windows data protection and system recovery. Download this whitepaper to find out the top reasons to upgrade and how to get continuous data protection and complete system recovery.

Webcast

Data and system loss — from a hard drive failure, malicious attack, natural disaster, or simple human error — can happen anytime. Don’t leave your business vulnerable. Make sure you have a secure recovery strategy in place. Symantec's latest backup and system recovery technology can efficiently restore critical applications, individual emails and documents and even restore your entire system in minutes in the event of a loss.

White Paper

Businesses face a growing challenge to ensure that the IT environment is properly protected. Backup Exec 12 integrates with other applications in the Symantec family of products, to complement your current data protection strategy, keep your data securely backed up and make it recoverable when you need it most.

Free stuff
Featured Sponsor

Get a broad understanding of important regulations and how you can make sure your site is in adherence.





Learn how VeriSign SGC-enabled SSL Certificates can help improve site security and customer confidence in the free white paper, "How to Offer the Strongest SSL Encryption." In this paper you will learn the differences between weak and strong encryption and what they mean for your site's performance.

Get VeriSign's free white paper: "The Latest Advancements in SSL Technology" and learn about the benefits of strong SSL encryption, Extended Validation (EV) SSL and security trust marks and what these SSL offerings can do for your site.

Now with Extended Validation (EV) SSL available from VeriSign, you can show your customers that they can trust your site. Learn about EV SSL benefits in this free VeriSign white paper.

More Resources