Using CHKDSK on Windows 2000 Professional

In Affiliation CNET News.com with CNET, Inc.

=@MACARLO MICROSOFT=  =@MACARLO YAHOO=  =@MACARLO WEBALIAS=  =@MACARLO ALTAVISTA=

 


In Affiliation with Beyond.com

 


by @Macarlo
Windows 2000 Professional Beta Tester
(Screenshots by Namo Capture)



Hi All
Note hat the CHKDSK command on Windows 2000 Professional is very enhanced. CHKDSK ask you about the practicability of dismounting action on the volume that you want check (see the message on the prompt in the photo above). I recommend that you use CHKDSK everyday for a better performance.

Examples

If you want to check the disk in drive D and have Windows 2000 fix any errors encountered, type the following command:

chkdsk d: /f

Chkdsk pauses and displays messages if it encounters errors. Chkdsk finishes by displaying a report showing the status of the disk. Also, no files can be opened on the drive specified.

On a FAT disk, to check all files in the current directory for noncontiguous blocks, type

chkdsk *.*

Chkdsk displays a status report, then lists the files matching the file specification that have noncontiguous blocks.


Chkdsk Usage

Creates and displays a status report for a disk based on the file system used. Chkdsk also lists and corrects errors on the disk. If chkdsk cannot lock the drive it will offer to check it the next time the computer restarts.

Issuing the chkdsk command on a fixed disk requires you be a member of the Administrators group.

chkdsk [drive:][[path] filename] [/f] [/v] [/r] [/l[:size]] [/x]

Parameters

none

Used without parameters, chkdsk displays the status of the disk in the current drive.

drive:

Specifies the drive that contains the disk that you want chkdsk to check.

[path] filename

Specifies the location and name of a file or set of files that you want chkdsk to check for fragmentation. You can use wildcard characters (* and ?) to specify multiple files.

/f

Fixes errors on the disk. The disk must be locked. If chkdsk cannot lock the drive it will offer to check it the next time the computer restarts.

/v

Displays the name of each file in every directory as the disk is checked.

/r

Locates bad sectors and recovers readable information. The disk must be locked.

/l[:size]

NTFS only. Changes the log file size to the size you enter. Displays the current size if you don't enter a new one.

/x

NTFS only. Forces the volume to dismount first, if necessary. All open handles to the volume are then invalid. This switch also includes the functionality of the /f switch

Chkdsk examines disk space and use for the NTFS and FAT file systems. Information specific to each file system is provided in a status report. The status report shows errors found in the file system.

If errors exist on the disk, chkdsk alerts you with a message and corrects the errors if the /f switch was used. Chkdsk must be able to lock the drive to correct errors. If errors are found but the drive cannot be locked, an error message is displayed. If you run chkdsk without the /f switch on an active partition, it may report spurious errors, since it will not lock the volume.

You should use chkdsk occasionally on each disk to check for errors.

Checking a locked drive at restart

Files cannot be open on a drive when chkdsk corrects disk errors it finds. If files are open chkdsk offers to check the drive the next time the computer restarts. If you choose to check the drive the next time the computer restarts, the drive will be checked and errors will be corrected automatically at restart. If the drive partition is a boot partition, after the drive is checked, it will restart the computer.

Checking a FAT disk

Windows 2000 displays chkdsk status reports for a FAT disk in the following format:

Volume Serial Number is B1AF-AFBF

72214528 bytes total disk space

73728 bytes in 3 hidden files

30720 bytes in 12 directories

11493376 bytes in 386 user files

61440 bytes in bad sectors

60555264 bytes available on disk

2048 bytes in each allocation unit

35261 total allocation units on disk

29568 available allocation units on disk

Checking an NTFS disk

Windows 2000 displays chkdsk status reports for an NTFS disk in the following format:

The type of the file system is NTFS.

CHKDSK is verifying files...

File verification completed.

CHKDSK is verifying indexes...

Index verification completed.

CHKDSK is verifying security descriptors...

Security descriptor verification completed.

12372 kilobytes total disk space.

3 kilobytes in 1 user files.

2 kilobytes in 1 indexes.

4217 kilobytes in use by the system.

8150 kilobytes available on disk.

512 bytes in each allocation unit.

24745 total allocation units on disk.

16301 allocation units available on disk.

Fixing disk errors

The chkdsk command corrects disk errors only if you specify the /f switch. Since repairs usually change a disk's file allocation table and sometimes cause a loss of data, 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 Y, Windows 2000 saves each lost chain in the root directory as a file with a name in the format Filennnn.chk. When chkdsk finishes, you can check these files to see if they contain any data you need. If you press N, Windows 2000 fixes the disk but does not save the contents of the lost allocation units.

If you do not use the /f switch, chkdsk alerts you with a message if a file needs to be fixed but does not fix the error(s).

If you use chkdsk /f on a very large disk (for example, 70 GB) or a disk with a very large number of files (millions), chkdsk may take a long time (perhaps days) to complete. The computer will not be available during this time, as chkdsk does not relinquish control until it is done.

Using chkdsk with open files

If you specify the /f switch, chkdsk shows an error if open files are found on the disk. If you do not specify the /f switch and open files exist, chkdsk might report lost allocation units on the disk. This could happen if open files have not yet been recorded in the file allocation table. If chkdsk reports the loss of a large number of allocation units, consider repairing the disk.

Physical disk errors

Use the /r switch to find physical disk errors in the file system. For information about recovering physically damaged files, see the recover command.

Bad disk sectors

Bad sectors reported by chkdsk were marked as bad when your disk was first prepared for operation. They pose no danger.

Exit codes

0

No errors were found.

1

Errors were found and fixed.

2

Could not check the disk, errors could not be fixed, or errors were not fixed because /f was not specified.



 


Compare prices on more than 100,000 products!

Search our product directory.

 

CNET Shopper. Click here.

@Macarlo, Inc.
@Macarlo's Shareware & Web
OS/2
Java Lobby Member
Java Site Accredited

[TOP] [HOME] [INDEX]