Home > Articles > Home & Office Computing > Microsoft Windows Vista & Home Server

This chapter is from the book

This chapter is from the book

Checking Your Hard Disk for Errors

Our hard disks store our programs and, most importantly, our precious data, so they have a special place in the computing firmament. They ought to be pampered and coddled to ensure a long and trouble-free existence, but that's rarely the case, unfortunately. Just consider everything that a modern hard disk has to put up with:

  • General wear and tear— If your computer is running right now, its hard disk is spinning away at between 5,400 and 10,000 revolutions per minute. That's right, even though you're not doing anything, the hard disk is hard at work. Because of this constant activity, most hard disks simply wear out after a few years.
  • The old bump-and-grind— Your hard disk includes read/write heads that are used to read data from and write data to the disk. These heads float on a cushion of air just above the spinning hard disk platters. A bump or jolt of sufficient intensity can send them crashing onto the surface of the disk, which could easily result in trashed data. If the heads happen to hit a particularly sensitive area, the entire hard disk could crash. Notebook computers are particularly prone to this problem.
  • Power surges— The current supplied to your PC is, under normal conditions, relatively constant. It's possible, however, for massive power surges to assail your computer (for example, during a lightning storm). These surges can wreak havoc on a carefully arranged hard disk.

So, what can you do about it? Windows Vista comes with a program called Check Disk that can check your hard disk for problems and repair them automatically. It might not be able to recover a totally trashed hard disk, but it can at least let you know when a hard disk might be heading for trouble.

Check Disk performs a battery of tests on a hard disk, including looking for invalid filenames, invalid file dates and times, bad sectors, and invalid compression structures. In the hard disk's file system, Check Disk also looks for the following errors:

  • Lost clusters
  • Invalid clusters
  • Cross-linked clusters
  • File system cycles

The next few sections explain these errors in more detail.

Understanding Clusters

Large hard disks are inherently inefficient. Formatting a disk divides the disk's magnetic medium into small storage areas called sectors, which usually hold up to 512 bytes of data. A large hard disk can contain tens of millions of sectors, so it would be too inefficient for Windows Vista to deal with individual sectors. Instead, Windows Vista groups sectors into clusters, the size of which depends on the file system and the size of the partition, as shown in Table 15.1.

Table 15.1. Default Cluster Sizes for Various File Systems and Partition Sizes

Partition Size

FAT16 Cluster Size

FAT32 Cluster Size

NTFS Cluster Size

7MB–16MB

2KB

N/A

512 bytes

17MB–32MB

512 bytes

N/A

512 bytes

33MB–64MB

1KB

512 bytes

512 bytes

65MB–128MB

2KB

1KB

512 bytes

129MB–256MB

4KB

2KB

512 bytes

257MB–512MB

8KB

4KB

512 bytes

513MB–1,024MB

16KB

4KB

1KB

1,025MB–2GB

32KB

4KB

2KB

2GB–4GB

64KB

4KB

4KB

4GB–8GB

N/A

4KB

4KB

8GB–16GB

N/A

8KB

4KB

16GB–32GB

N/A

16KB

4KB

32GB–2TB

N/A

N/A

4KB

Still, each hard disk has many thousands of clusters, so it's the job of the file system to keep track of everything. In particular, for each file on the disk, the file system maintains an entry in a file directory, a sort of table of contents for your files. (On an NTFS partition, this is the Master File Table, or MFT.)

Understanding Lost Clusters

A lost cluster (also sometimes called an orphaned cluster) is a cluster that, according to the file system, is associated with a file, but that has no link to any entry in the file directory. Program crashes, power surges, or power outages are some typical causes of lost clusters.

If Check Disk comes across lost clusters, it offers to convert them to files in either the file's original folder (if Check Disk can determine the proper folder) or in a new folder named Folder.000 in the root of the %SystemDrive%. (If that folder already exists, Check Disk creates a new folder named Folder.001 instead.) In that folder, Check Disk converts the lost clusters to files with names like File0000.chk and File0001.chk.

You can look at these files (using a text editor) to see whether they contain any useful data and then try to salvage it. Most often, however, these files are unusable and most people just delete them.

Understanding Invalid Clusters

An invalid cluster is one that falls under one of the following three categories:

  • A file system entry with an illegal value. (In the FAT16 file system, for example, an entry that refers to cluster 1 is illegal because a disk's cluster numbers start at 2.)
  • A file system entry that refers to a cluster number larger than the total number of clusters on the disk.
  • A file system entry that is marked as unused, but is part of a cluster chain.

In this case, Check Disk asks whether you want to convert these lost file fragments to files. If you say yes, Check Disk truncates the file by replacing the invalid cluster with an EOF (end of file) marker and then converts the lost file fragments to files. These are probably the truncated portion of the file, so you can examine them and try to piece everything back together. More likely, however, you just have to trash these files.

Understanding Cross-Linked Clusters

A cross-linked cluster is a cluster assigned to two different files (or twice in the same file). Check Disk offers to delete the affected files, copy the cross-linked cluster to each affected file, or ignore the cross-linked files altogether. In most cases, the safest bet is to copy the cross-linked cluster to each affected file. That way, at least one of the affected files should be usable.

Understanding Cycles

In an NTFS partition, a cycle is a corruption in the file system whereby a subfolder's parent folder is listed as the subfolder itself. For example, a folder named C:\Data should have C:\ as its parent; if C:\Data is a cycle, C:\Data—the same folder—is listed as the parent instead. This creates a kind of loop in the file system that can cause the cycled folder to "disappear."

Running the Check Disk GUI

Check Disk has two versions: a GUI version and a command-line version. See the next section to learn how to use the command-line version. Here are the steps to follow to run the GUI version of Check Disk:

  1. In Windows Explorer, right-click the drive you want to check and then click Properties. The drive's properties sheet appears.
  2. Display the Tools tab.
  3. Click the Check Now button and enter your User Account Control credentials. The Check Disk window appears, as shown in Figure 15.3.
    15fig03.jpg

    Figure 15.3 Use Check Disk to scan a hard disk partition for errors.

  4. Activate one or both of the following options, if desired:
    • Automatically Fix File System Errors— If you activate this check box, Check Disk automatically repairs any file system errors that it finds. If you leave this option deactivated, Check Disk just reports on any errors it finds.
    • Scan for and Attempt Recovery of Bad Sectors— If you activate this check box, Check Disk performs a sector-by-sector surface check of the hard disk surface. If Check Disk finds a bad sector, it automatically attempts to recover any information stored in the sector and it marks the sector as defective so that no information can be stored there in the future.
  5. Click Start.
  6. If you activated the Automatically Fix File System Errors check box and are checking a partition that has open system files, Check Disk will tell you that it can't continue because it requires exclusive access to the disk. It will then ask whether you want to schedule the scan to occur the next time you boot the computer. Click Schedule Disk Check.
  7. When the scan is complete, Check Disk displays a message letting you know and a report on the errors it found, if any.

Running Check Disk from the Command Line

Here's the syntax for Check Disk's command-line version:

CHKDSK [volume [filename]] [/F] [/V] [/R] [/X] [/I] [/C] [/L:[size]]

 

 

volume

The drive letter (followed by a colon) or volume name.

filename

On FAT16 and FAT32 disks, the name of the file to check. Include the path if the file isn't in the current folder.

/F

Tells Check Disk to fix errors automatically. This is the same as running the Check Disk GUI with the Automatically Fix File System Errors option activated.

/V

Runs Check Disk in verbose mode. On FAT16 and FAT32 drives, Check Disk displays the path and name of every file on the disk; on NTFS drives, displays cleanup messages, if any.

/R

Tells Check Disk to scan the disk surface for bad sectors and recover data from the bad sectors, if possible. This is the same as running the Check Disk GUI with the Scan for and Attempt Recovery of Bad Sectors option activated.

/X

On NTFS nonsystem disks that have open files, forces the volume to dismount, invalidates the open file handles, and then runs the scan (the /F switch is implied).

/I

On NTFS disks, tells Check Disk to check only the file system's index entries.

/C

On NTFS disks, tells Check Disk to skip the checking of cycles within the folder structure. This is a rare error, so using /C to skip the cycle check can speed up the disk check.

/L:[ size ]

On NTFS disks, tells Check Disk to set the size of its log file to the specified number of kilobytes. The default size is 65,536, which is big enough for most systems, so you should never need to change the size. Note that if you include this switch without the size parameter, Check Disk tells you the current size of the log file.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020