|
Chapter 31: Troubleshooting Tools and Strategies (continued)Maintenance and Update ToolsWindows 2000 provides tools that you can use to maintain and update your system. Some of the most useful of these tools are detailed in this section, as shown in Table 31.6. Table 31.6 Maintenance and Update Troubleshooting Tools
ChkdskChkdsk is a command-line tool that scans and repairs volumes on the hard disk for physical problems, such as bad blocks, and logical structure errors, such as lost clusters, cross-linked files, or directory errors. Run Chkdsk from a command prompt rather than from Windows Explorer to see the resulting display. Chkdsk SyntaxThe command-line syntax for Chkdsk is as follows: chkdsk [volume[[path]filename]]] [/f] [/v] [/r] [/x] [/i] [/c]
[/l[:size]]
Used without parameters, Chkdsk displays the status of the disk in the current volume. Chkdsk SwitchesTable 31.7 lists all Chkdsk command-line switches. Table 31.7 Chkdsk Switches
NOTE FAT refers to volumes formatted with FAT12, FAT16, or FAT32. Using the /i or /c switch skips certain checks of the NTFS volume and reduces the amount of time required to run Chkdsk. Use Chkdsk occasionally on each volume to check for errors. You must be logged on as a member of the Administrators group. Chkdsk ReportsChkdsk creates and displays a status report for a volume, based on the file system used. Chkdsk also lists and corrects errors on the volume. The following are sample Chkdsk reports for volumes using each hard disk file system supported by Windows 2000. Each of these tests were run using the /f switch, although no errors were reported on any of the volumes. Following is an example Chkdsk report from an NTFS volume: The type of the file system is NTFS.
CHKDSK is verifying files (stage 1 of 3)...
File verification completed.
CHKDSK is verifying indexes (stage 2 of 3)...
Index verification completed.
CHKDSK is verifying security descriptors (stage 3 of 3)...
Security descriptor verification completed.
Windows has checked the file system and found no problem.
4096543 KB total disk space.
639500 KB in 3206 files.
692 KB in 113 indexes.
0 KB in bad sectors.
26427 KB in use by the system.
22544 KB occupied by the log file.
3429924 KB available on disk.
4096 bytes in each allocation unit.
1024135 total allocation units on disk.
857481 allocation units available on disk.
An example of a Chkdsk report from a FAT32 volume: The type of the file system is FAT32.
Volume FAT32 created 8/7/1999 11:19 AM
Volume Serial Number is 1067-3B1C
Windows is verifying files and folders...
File and folder verification is complete.
Windows has checked the file system and found no problem.
2,618,732,544 bytes total disk space.
286,720 bytes in 29 hidden files.
401,408 bytes in 86 folders.
307,101,696 bytes in 2,179 files.
2,310,938,624 bytes available on disk.
4,096 bytes in each allocation unit.
639,339 total allocation units on disk.
564,194 allocation units available on disk.
An example of a Chkdsk report from a FAT16 volume: The type of the file system is FAT.
Volume FAT16 created 8/7/1999 11:23 AM
Volume Serial Number is 0CE5-DBB4
Windows is verifying files and folders...
File and folder verification is complete.
Windows has checked the file system and found no problem.
1,340,538,880 bytes total disk space.
1,933,312 bytes in 50 hidden files.
3,407,872 bytes in 103 folders.
705,921,024 bytes in 3,158 files.
629,276,672 bytes available on disk.
32,768 bytes in each allocation unit.
40,910 total allocation units on disk.
19,204 allocation units available on disk.
NOTE A sample Chkdsk report from FAT12 is not shown because it is only supported on floppy disks and volumes less than 16 MB in size. Chkdsk only runs on local floppy disks, hard disks, and removable, read/writable disks. It does not support CD-ROM and DVD-ROM disks. If errors exist on the volume, Chkdsk alerts you by using a message and, if the /f switch was used, corrects the errors. Correcting Problems by Using ChkdskChkdsk cannot correct found errors when there are open files on the volume because Chkdsk cannot lock the volume. In this case, Chkdsk offers to check the volume automatically the next time the computer is started. This is typical behavior for the boot volume. When the boot volume is checked, the computer is automatically restarted after the volume check is completed. Because some repairs, such as correcting lost clusters (also knows as allocation units) or cross-linked files, change a volume's file allocation table and can cause data loss, Chkdsk first prompts you with a confirmation message similar to the following: 10 lost allocation units found in 3 chains. Convert lost chains to files? If you press N, Windows 2000 fixes the errors on the volume but does not save the contents of the lost clusters. If you press Y, Windows 2000 attempts to identify the folder to which they belong. If the folder is identified, the lost cluster chains are saved there as files. If the folder cannot be identified or if the folder does not exist, it saves each chain of lost clusters in a folder called Found.xxx, where xxx is a sequential number starting with 000. If no folder Found.000 exists, one is created at the root. If one or more sequential folders called Found.xxx (starting at 000) exists, one using the next number in the sequence is created. After the storage folder has been identified or created, one or more files with a name in the format Filennnn.chk (the first saved file is named File0000.chk, the second is named File0001.chk, and so on in sequence) are saved. When Chkdsk finishes, you can examine the contents of these files with a text editor to see whether they contain any needed data (if the converted chains came from corrupted binary files, they are of no value). You can delete the CHK files after you have saved any useful data.
NOTE Be careful to delete only files using the file name extension CHK from the Found.xxx folders. Other programs might create and use files with that extension. If you do not use the /f switch, Chkdsk alerts you if it detects a file that needs to be fixed by indicating that it needs to be rerun with the /f switch to fix the errors. If you use the /f switch on an extremely large volume (for example, 70 GB) or a volume with a very large number of files (in the millions), Chkdsk can take a long time (perhaps days) to complete. The volume is not available during this time, since Chkdsk does not relinquish control until it is done. If the system volume is being checked during the startup process, the computer is not be available until the Chkdsk process is complete. Bad sectors reported by Chkdsk were marked when your volume was first prepared for operation. The fact that they are marked as bad means that the system prevents the disk from using them, so previously identified bad sectors pose no danger to your data. Disk DefragmenterDisk Defragmenter is a Windows-based tool that rearranges files, folders, programs, and unused space on your computer's hard disk. This is occasionally necessary because of the way files are stored on disk. When files are edited and outgrow their original space on the disk, the file is broken into fragments, with latter fragments stored in open spots elsewhere on disk. In addition, when files are deleted on FAT16 and FAT32 volumes, only the entries in the file allocation table itself are deleted. The formerly occupied space is marked as open and can be used by other files. When other files use the empty space, if it is not large enough to accommodate the remaining data of the file, the file is again broken up with the remainder stored in another open space on disk. This process occurs with every new and edited file that is stored to disk. While this process makes storage faster and more efficient when the file is saved, it takes much longer to read and write fragmented files than unfragmented files. Creating new files and folders also takes longer because the space available on the volume is scattered. Windows must then save new files and folders to various locations on the volume. When many files on disk become badly fragmented, performance notably suffers. Running Disk DefragmenterDisk Defragmenter remedies this problem by rewriting the files on disk back into contiguous segments. To start Disk Defragmenter, from the Start menu, point to Programs, Accessories, and System Tools, and then click Disk Defragmenter. You can analyze the volume to see how many fragmented files and folders there are and then decide whether or not to defragment the volume. The amount of time that the defragmentation process takes to run depends on several factors, including the size of the volume, the number of files on the volume, the amount of fragmentation, and the available local system resources. Disk Defragmenter defragments volumes formatted with FAT16, FAT32, and NTFS. Disk Defragmenter ResultsThe Disk Defragmenter tool display is split into two main areas, as shown in Figure 31.1. The upper portion lists the volumes on the local computer. The lower portion shows how fragmented the volume is. The colors indicate the condition of the volume:
Figure 31.1 Disk Defragmenter By comparing the Analysis Display band to the Defragmentation Display band, you can see the improvement in your volume after defragmenting. Always analyze volumes before defragmenting them. After the analysis is complete, a dialog box tells you if you need to defragment the volume. You can defragment local file system volumes only, and you can only run one Disk Defragmenter console at a time. In addition, you must be logged on as an administrator or a member of the Administrators group. If your computer is connected to a network, network policy settings might also prevent you from completing this procedure. AVBootInoculateIT Antivirus AVBoot version 1.1 is a command-line tool that scans the computer's memory and all locally-installed disk drives for MBR and boot sector viruses. If a virus is found, AVBoot can remove the virus. AVBoot is located in the \VALUEADD\3RDPARTY\CA_ANTIV folder of the Windows 2000 operating system CD.
Makedisk.bat is used to create a startup floppy disk that runs AVBoot. To run AVBoot, insert the AVBoot startup floppy disk and restart the computer. AVBoot automatically starts when the computer has completed the startup process from the floppy disk.
NOTE On many computers, an option in the CMOS setup program allows the user to set the sequence of installed disks that the system searches for the startup files. If drive C is set to be searched before drive A, the AVBoot disk is not loaded. When the AVBoot menu appears, press 1. It displays a report showing the version number and the date of the installed virus-scanning engine and the data or antivirus signature files. The next line displays the results of a virus scan in memory. Below that, a Boot Sector Summary report is displayed, showing the results of the scan on the installed floppy disk drives and all hard disks. If a second floppy disk drive or hard disk is not installed, the report states "Not Installed". Press any key to return to the AVBoot menu. Following is an example: InoculateIT AntiVirus Avboot V1.1 Copyright 1997-99 Computer Associates International, Inc. and/or its subsidiaries. All Rights Reserved. Engine version: 4.22 06/01/1999 Data version: 4.22 06/14/1999 No Viruses Were Detected In Workstation Memory Boot Sector Summary: Floppy Drive A... No Boot Sector Viruses Detected Floppy Drive B... Not Installed Hard Disk 1...... No Boot Sector Viruses Detected Hard Disk 2...... Not Installed
IMPORTANT Whether you use a third-party antivirus program or AVBoot, be sure to regularly update the virus signature files. After you install an antivirus program, immediately update the signature files, usually through an Internet connection. Check with the software documentation for specific instructions. AVBoot includes update instructions in the installation folder and on the AVBoot floppy disk. When you update the virus signature files, record the date in your log book so you can determine how fresh the files are on the AVBoot disk. It is extremely important that you regularly update your antivirus program. In most cases, antivirus programs are unable to reliably detect and clean viruses of which they are unaware resulting in false negative reports. Most commercial antivirus software manufacturers offer monthly updates. Use the latest download to ensure that your system is protected with the latest virus defenses. Windows UpdateWindows Update is an online extension of Windows 2000. It provides a central location to find customized files and product enhancements, such as Service Packs, system files, device drivers, and new Windows 2000 features, that have been selected to work with your computer's configuration. Using Windows UpdateWindows 2000 creates a Start menu shortcut to the Windows Update Web page. Windows Update uses Active Setup and Microsoft® ActiveX® controls that are downloaded and installed on your system when you connect to the Windows Update Web page.
NOTE Windows Update requires browser software that supports ActiveX controls. The controls scan your system, comparing system files and device drivers on your computer with a database of the files on the Windows Update server. Windows Update then generates a list of items that can be added and updated, and offers to install any files that are found to be newer than your current set.
NOTE All updates can be uninstalled using Update Wizard Uninstall in System Information on the Tools menu. Existing files and drivers are automatically backed up before new ones are installed by Windows Update. Restricting Access to Windows Update To closely control the programs that users download, you can prohibit user access the Windows Update Web page. By using Group Policy, you can remove the Windows Update icon both from the Start menu and from the Tools menu in Microsoft® Internet Explorer. Enabling the policy prevents users from accessing the Windows Update Web page from a computer running Windows 2000 Professional.
NOTE For more information about adding the Group Policy snap-in into MMC, see "Recovery Console" earlier in this chapter.
IMPORTANT If you are using Windows 2000 Professional-based computers on a Windows 2000 Server-based network, use Group Policy from the Windows 2000 Server to control this functionality. System File and Driver ToolsWindows 2000 Professional provides tools to help you troubleshoot problems with devices and drivers. Many of the most helpful tools for troubleshooting these issues, are discussed in this section, as shown in Table 31.8. For more information about troubleshooting problems with Plug and Play and other devices, see "Device Management" in this book. Table 31.8 Device and Driver Troubleshooting Tools
System File CheckerSystem File Checker (SFC) is a command-line tool that scans protected system files and replaces files overwritten with the correct system files provided by Microsoft. It is part of the Windows File Protection feature of Windows 2000. Windows File ProtectionThe Windows File Protection (WFP) feature protects your system files with two mechanisms. The first runs in the background: WFP is implemented when it is notified that a file in a protected folder is modified. After this notification is received, WFP determines which file was changed, and if it is protected, looks up the file signature in a catalog file to determine if the new file is the correct Microsoft version or if the file is digitally signed. If it is not, a replacement file is retrieved from either the %SystemRoot%\System32\Dllcache folder or the Windows 2000 operating system CD. By default, WFP displays the following message to an administrator and logs it to the System event log: A file replacement was attempted on the protected system file <file name>. To maintain system stability, the file has been restored to the correct Microsoft version. If problems occur with your application, please contact the application vendor for support. The second WFP mechanism is SFC, which allows an administrator to scan all protected files to verify their versions. SFC also checks and repopulates the Dllcache folder. If the Dllcache folder becomes damaged or unusable, use SFC with the /purgecache switch to repair its contents. Most SYS, DLL, EXE, TTF, FON and OCX files on the Windows 2000 operating system CD are protected. However, for disk space considerations, maintaining cached versions of all of these files in the Dllcache folder is not always preferable on computers with limited available storage space. SFC also checks all catalog files used to track correct file versions. If any catalog files are missing or damaged, WFP renames the affected catalog file and retrieves a cached version of that file from the Dllcache folder. If a cached copy of the catalog file is not available, WFP requests that you insert the Windows 2000 operating system CD to retrieve a new copy of the catalog file. SFC SyntaxThe command-line syntax for SFC is as follows: sfc [/scannow] [/scanonce] [/scanboot] [/cancel] [/enable] [/purgecache]
[/cache size=x] [/quiet]
SFC Switches
The SFC switches are listed in Table 31.9. Table 31.9 SFC Switches
Driver VerifierDriver Verifier is a Windows-based tool that runs a series of checks in the Windows 2000 kernel to expose errors in kernel-mode drivers. It can gather statistics from the kernel, which are displayed by the GUI or logged in a file. Driver Verifier can be run as a Windows 2000 application (called the "Driver Verifier Manager"), as a command-line tool, or as a debugger option in the system debugger WinDbg. Driver Verifier SyntaxThe command-line syntax for Driver Verifier is as follows: verifier [/flags value [/iolevel level]] /all verifier [/flags value [/iolevel level]] /driver name [name ...] verifier /volatile /flags value verifier /reset verifier [/query] verifier /log log_file_name [/interval seconds]Driver Verifier Switches The Run dialog box switches of Driver Verifier are listed in Table 31.10. Table 31.10 Driver Verifier Command-Line Switches
Running Driver Verifier with no command-line switches starts Driver Verifier Manager which uses a tabbed dialog box to separate the options it offers for testing device drivers, as shown in Figure 31.2. Figure 31.2 Driver Verifier Manager Driver Verifier ManagerThe following list shown in Table 31.11 contains a description of each tab in the Driver Verifier Manager dialog box: Table 31.11 Driver Verifier Manager Dialog Box Tabs
NOTE You can verify multiple drivers at the same time, but to simplify the process, it is strongly recommended that you verify one driver at a time.
Run a series of tests that use the full capability of the device driver in question. If the Windows 2000 kernel detects any driver errors during startup or during the user tests, it generates a Stop message and displays information useful to support personnel on the screen and the kernel debugger host (if one is connected). If no errors are found, reset the Driver Verifier Manager so it does not continue to test the drivers.
Driver SigningDriver signing is a multifaceted process in which device drivers are verified through a series of tests administered by the Windows Hardware Quality Lab (WHQL). Drivers that earn this certification are more robust and cause fewer problems with Windows 2000. Microsoft digitally signs drivers that pass the WHQL tests so they are recognized natively by Windows 2000 Professional. Devices covered include:
The system files provided with Windows 2000 have a Microsoft digital signature, which indicates that the files are original, unaltered system files and that they have been approved by Microsoft for use with Windows 2000. Windows 2000 Professional can warn or prevent users from installing unsigned code. If a file has not been digitally signed and resides in one of the mentioned device driver classes, a message alerts the user, and asks if they want to continue. All drivers included with Windows 2000 are digitally signed by Microsoft. You can verify that third-party drivers have met the WHQL standards and that they have not been modified since they were tested. To ensure that device drivers are compatible with Windows 2000, look for vendors offering drivers signed by Microsoft. Checking for Digital SignaturesWindows 2000 includes the File Signature Verification tool and Signature Checking to identify files that have been signed. The File Signature Verification tool determines whether a file is signed and allows you to do the following:
To run the File Signature Verification tool, from the Start menu, click Run, and then type: sigverif To customize the behavior of the File Signature Verification tool, in the File Signature Verification dialog box, click Advanced. The Advanced File Signature Verification Settings dialog box provides the following options:
The log file, Sigverif.inc, is stored in the %SystemRoot% folder by default, and records the following information about the files it scans:
Signature Checking can be enabled by system administrators to ensure that Windows 2000 inspects files for digital signatures whenever drivers are installed. Signature Checking has three levels:
You can start the Signature Checking feature by using the Hardware tab of the System Properties dialog box. DriversDrivers is a command-line tool that lists all of the drivers currently running on the computer from the %SystemRoot%\System32\Drivers folder. You can use this tool to identify a driver that might be causing problems due to corruption or because it is missing, not loaded, or outdated. Drivers is part of the Resource Kit Tools collection on the Windows 2000 Professional Resource Kit companion CD. For more information about Drivers, see Rktools.chm in the folder C:\Program Files\Resource Kit. Run Drivers from a command prompt, rather than from Windows Explorer, to see the resulting display. Drivers has no command-line switches.
TIP Run Drivers when the system is working properly and save the output to a file. You can use these results as a comparison later if the system has problems with missing or corrupted drivers. To save the drivers list to a file, redirect the screen output to a file with the following command-line syntax: drivers > drivers_M-D-Y.inc where M is the numerical month, D is the day, and Y is the year that the report was run. Keep this file in a safe location or print it and record the date on the page. Table 31.12 describes the output from the Drivers tool. The most important field is Module Name, which is the name of the component. Table 31.12 Column Names and Descriptions of the Drivers Tool Output
The following is a sample portion of a Drivers output: ModuleName Code Data Bss Paged Init LinkDate
------------------------------------------------------------------------------
ntoskrnl.exe 423680 61952 0 730432 136448 Sun Aug 22 14:47:30 1999
hal.dll 33536 5536 0 31648 15488 Sat Aug 21 12:39:25 1999
BOOTVID.dll 6048 2464 0 0 448 Sat Aug 21 12:34:13 1999
pci.sys 12128 1536 0 30816 4576 Fri Aug 20 15:36:35 1999
isapnp.sys 14432 832 0 23200 2080 Wed Aug 18 18:29:07 1999
intelide.sys 1760 32 0 0 128 Sun Aug 22 14:17:56 1999
PCIIDEX.SYS 4512 480 0 10848 1632 Sun Aug 22 14:17:56 1999
MountMgr.sys 1088 0 0 22496 2176 Mon Aug 02 17:26:33 1999
ftdisk.sys 4640 32 0 95776 3392 Sun Aug 22 14:18:00 1999
Diskperf.sys 1440 32 0 2016 992 Sun Aug 22 14:17:59 1999
WMILIB.SYS 480 0 0 1152 192 Sat Jul 31 11:29:42 1999
dmload.sys 2848 64 0 0 608 Fri Aug 20 14:29:47 1999
...
ntdll.dll 282624 16384 0 16384 0 Sun Aug 22 14:57:40 1999
------------------------------------------------------------------------------
Total 3831648 306848 0 2966016 403552
Microsoft® Windows® 2000 Professional Resource Kit
Last Updated: Friday, July 6, 2001 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||