Home > Windows Server Tips > Windows Storage Management > Guide to using chkdsk to detect file and folder corruption
Windows Server Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

WINDOWS STORAGE MANAGEMENT

Guide to using chkdsk to detect file and folder corruption


Brien M. Posey, Contributor
07.12.2007
Rating: -4.71- (out of 5)


Expert advice on Windows-based systems and hardware
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Testing your backups is an important part of protecting your data. But simply proving that you can restore a backup does not guarantee the integrity of the data.

File or folder level corruption can occur gradually, and by the time Windows produces an error message it is often too late to completely fix the problem. By the time Windows generates an error, you'll have been backing up corrupt data for some time.

The trick to protecting your data's integrity is to occasionally test the disk volume to make sure that corruption is not occurring. If you do detect some corruption, it may not be too bad, since you detected the problem early on, rather than waiting until the problem got to the point that it triggered a Windows error.

Oddly enough, the best tool for detecting file and folder corruption seems to be chkdsk. Several third-party disk utilities also do a good job of detecting file or folder problems, but many can only function outside of Windows.

While researching this article, I attempted to use Norton Disk Doctor (part of Symantec's Norton Systemworks) to check the integrity of a drive on one of my servers. But Windows would not allow Norton Disk Doctor to have direct control of the hard drive, meaning that a Norton Disk Doctor scan would require the machine to be shut down. Though a great tool, Norton Disk Doctor is impractical as a mechanism for occasionally scanning a volume for corruption, since shutting down servers is usually frowned upon.

There are three reasons why chkdsk is a good tool for detecting file and folder corruption:

  1. It can run as a part of the Windows operating system, so there's no need to shut down your server to run it (unless you're repairing a volume).
  2. It is a command-line utility, so it can be scripted to run when you want it to.
  3. It won't make any changes to the volume that it is scanning unless you specifically tell it to.

There are three steps to configuring Windows to periodically run chkdsk against a volume. Step #1 is to open a Command Prompt window and run chkdsk manually, i.e., enter the chkdsk command followed by the drive letter that you want to scan… chkdsk C: ). The reason you should initially run chkdsk manually is because, depending on the size of the volume you're scanning, chkdsk could take hours (or even days) to complete. Chkdsk could also place an extra strain on a hard disk that is already performing at or near its maximum capacity. Because of these factors, I recommend running chkdsk manually the first time so you can see how it will affect your server.

Step #2 is to schedule chkdsk to run automatically. This is easier than it sounds. Microsoft provides the AT command as an interface to the Schedule service. This allows you to run a command at a specific date and time. Keep in mind that, for the AT command to work, the Schedule service must be running.

The full syntax of the AT command is as follows:

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE]
    [ /EVERY:date[,...] | /NEXT:date[,...]] "command"

\\computername     specifies a remote computer. Commands are scheduled on the
                   local computer if this parameter is omitted.
id                 is an identification number assigned to a scheduled
                   command.
/delete            cancels a scheduled command. If id is omitted, all the
                   scheduled commands on the computer are canceled.
/yes               used with cancel all jobs command when no further
                   confirmation is desired.
time               specifies the time when command is to run.
/interactive       allows the job to interact with the desktop of the user
                   who is logged on at the time the job runs.
/every:date[,...]  runs the command on each specified day(s) of the week or
                   month. If date is omitted, the current day of the month
                   is assumed.
/next:date[,...]   runs the specified command on the next occurrence of the
                   day (for example, next Thursday).  If date is omitted, the
                   current day of the month is assumed.
"command"          is the Windows NT command, or batch program to be run.

To see how this works, imagine that you wanted to run the CHKDSK C: command every Friday at 3:00 AM on a machine named Server1. To do so, you would use the following command: AT \\Server1 3:00 /Interactive /every:Friday chkdsk C:

Now that you know how to automate chkdsk, it's time for the Step #3: to make the results usable. Otherwise, chkdsk will simply run and then terminate, and you'll never know the outcome of the scan unless you happen to catch a glimpse of the screen at the end of the scan. I will show you how to export the scan results in my next article in this series.

About the author: Brien M. Posey, MCSE, is a Microsoft Most Valuable Professional for his work with Windows 2000 Server, Exchange Server and IIS. He has served as CIO for a nationwide chain of hospitals and was once in charge of IT security for Fort Knox. He writes regularly for SearchWinComputing.com and other TechTarget sites.

More information on this topic:


Rate this Tip
To rate tips, you must be a member of SearchWindowsServer.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
Windows Storage Management
Moving dynamic disks to a new Windows server
A first look at Storage Explorer for Windows Server 2008
Give your system memory a boost with x64
Backup and recovery for data migrated to networked storage
Disk management basics for iSCSI deployments
Making financial sense of disk-to-disk backup solutions
Moving structured data sources to networked storage
Making the move from DAS to SAN and NAS
Data Protection Manager 2007: Relief from branch office backup headaches
Case Study: Building a low-cost SATA array

Windows Data Storage Administration Tools
eZines and eBooks for Windows server professionals
Windows scripting secrets for disk quota management
Top 10 Windows storage management tips of 2007
Exploring the Windows Server 2003 Resource Kit: Compress.exe and Expand.exe
How to use the g4u network-based hard disk cloning utility
When to use third-party tools in place of NTBACKUP
CDBurnerXP 4.0: A CD/DVD/ISO freeware tool for Windows
Data backup utility mkisofs uses UDF disk-image format
Create batch file to log chkdsk results
Create custom boot sector manually with Boot Build utility

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2004 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts