Step 1 - Check Your Hard Disk for Errors


Step 1—Check Your Hard Disk for Errors

Our hard disks store our programs and, most important, 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, unfortunately, that’s rarely the case. Just consider everything that a modern hard disk has to put up with:

  • 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.

  • Bumps and thumps 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.

  • Power surges The current that is supplied to your PC is, under normal conditions, reasonably constant. The possibility exists, however, for your computer to be assailed by massive power surges (for example, during a lightning storm). These surges can wreak havoc on a carefully arranged hard disk.

So what can you do about these flies in the ointment? Windows XP 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 has two versions: a GUI version and a command-line version, both of which we discuss in the next two sections.

Running the Check Disk GUI

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 select Properties.

  2. On the drive’s property sheet, select the Tools tab.

  3. Click the Check Now button. The Check Disk window appears, as shown in Figure 12-1.


    Figure 12-1: Use Check Disk to scan a hard disk partition for errors

  4. You have two options:

    • Automatically Fix File System Errors If you select this check box, Check Disk will automatically repair any file system errors that it finds. If you leave this option cleared, Check Disk just reports any errors it finds.

    • Scan For And Attempt Recovery Of Bad Sectors If you select 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 marks the sector as defective so no information can be stored there in the future.

  5. Click Start.

  6. If you selected 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, and it will ask if you want to schedule the scan to occur the next time you boot the computer. Click Yes to schedule the disk check.

  7. When the scan is complete, Check Disk displays both a message letting you know that it has finished and a report on the errors it found, if any.

    Insider_Secret

    If you click Yes when Check Disk asks if you want to schedule the scan for the next boot, the program adds the AUTOCHK utility to the following registry setting:

    HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\BootExecute

    This setting specifies the programs that Windows XP should run at boot time when the Session Manager is loading. AUTOCHK is the automatic version of Check Disk that runs at system startup. When AUTOCHK is scheduled, you see the following the next time you restart the computer:

    A disk check has been scheduled.  To skip disk checking, press any key within 10 second(s).

    You can bypass the check by pressing a key before the timeout expires. Note that you can change the timeout value by creating a DWORD value named AutoChkTimeOut in the following registry key:

    HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\BootExecute

    Set this to the number of seconds you want to use for the timeout. Another way to do this is to use the CHKNTFS /T:[time] command, where time is the number of seconds to use for the timeout. (If you exclude time, CHKNTFS returns the current timeout setting.) For example, the following command sets the timeout to 60 seconds:

    CHKNTFS /T:60

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 for fragmentation. Include the path if the file isn’t in the current folder.

/F

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

/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, it 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 selected.

/X

On NTFS non-system 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. 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, then 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.” 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 plenty 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, CHKDSK tells you the current size of the log file.




Insider Power Techniques for Microsoft Windows XP
Insider Power Techniques for Microsoft Windows XP (Bpg-Other)
ISBN: 0735618968
EAN: 2147483647
Year: 2005
Pages: 126

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net