Chkdsk creates and displays a status report for a disk based on the file system used _dos/bat
Source: Internet
Author: User
Chkdsk
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 you do not take any arguments, CHKDSK displays the status of the disk in the current drive.
Parameters
Volume
Specifies a drive letter (colon-delimited), mount point, or volume name.
[Path} FileName]
Specifies the location and name of the file or set of files that you want Chkdsk to check for defragmentation. Use wildcard characters (* and?) to specify multiple files.
/F
Repair errors on the disk. The disk must be locked. If Chkdsk cannot lock the drive, a message appears asking if you want to check the drive the next time you restart the computer.
/V
Displays the name of each file in all directories when the disk is checked.
/R
Locate the bad sector and recover the readable information. The disk must be locked.
/x
Used only on NTFS. If necessary, force the unload volume first. All open handles to this drive are invalid. /x also includes the functions of/F.
/I
Used only with NTFS. Perform a full check of the index entries to reduce the amount of time spent running CHKDSK.
/C
Used only with NTFS. Skipping cycle checks in the folder structure reduces the amount of time required to run CHKDSK.
/l[:size]
Used only with NTFS. Change the size of the log file to the size entered by the user. If this argument is omitted,/L displays the current log file size.
/?
Display Help at the command prompt.
Comments
Run Chkdsk
To run the chkdsk command on a fixed disk, you must be a member of the Administrators group.
Checking for locked drives at reboot
If you want CHKDSK to repair a disk error, you cannot open the file on that drive before. If a file is open, the following error message is displayed:
Chkdsk cannot run because the volume is in-use by another processwould your like to schedule this volume to be checked the Next time the system restarts? (y/n)
If you choose to check the drive the next time you restart your computer, CHKDSK automatically checks the drive and repairs the error after you restart the computer. If the drive is partitioned as a boot partition, CHKDSK automatically restarts the computer after the drive is checked.
Report Disk Errors
The chkdsk command checks disk space and file allocation tables (FAT) and the usage of the NTFS file system. Chkdsk provides information specific to each file system in the status report. Status reports show errors found in the file system. When you run Chkdsk on an active partition, if the/F command-line option is not included, it may report false information because it cannot lock the drive. You should not use Chkdsk regularly to check for errors on each disk.
Repairing disk Errors
The chkdsk command fixes a disk error only if you specify the/F command-line option. Chkdsk must be able to lock the drive to correct the error. Because repairs typically change the disk's file allocation table and sometimes lose data, CHKDSK first sends a confirmation message as follows:
Lost allocation units found in 3 chains.
Convert lost chains to files?
Pressing Y,windows saves all lost chains in the root directory in a file named FILEnnnn.CHK. After CHKDSK has finished, you can see if the files contain the data that you want. Pressing n,windows repairs the disk, but it does not save its contents for the missing allocation unit.
If you do not use the/F command-line option, CHKDSK sends a message when a file needs to be repaired, but it does not fix any errors.
If you use chkdsk/f on a large disk (for example, GB) or on a disk with a large number of files (millions of), this can take a long time (say, a few days) to complete. Because CHKDSK does not hand over control until the work is completed, the computer will not be available during this time period.
Check FAT disk
Windows Displays the Chkdsk status report for a FAT disk in the following format:
Volume Serial number is B1AF-AFBF
72214528 Bytes Total Disk
73728 bytes in 3 hidden files
30720 Bytes in directories
11493376 bytes in 386 user files
61440 bytes in Sectors
60555264 bytes available on disk
2048 bytes in the allocation unit
35261 total allocation units on disk
29568 available allocation units on disk
Check NTFS disks
Windows Displays the Chkdsk status report for NTFS disks 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 spaces.
3 kilobytes in 1 user files.
2 kilobytes in 1 indexes.
4217 kilobytes in with the system.
8150 kilobytes available on disk.
Allocation bytes in each of the unit.
24745 total allocation units on disk.
16301 allocation units available on disk.
Use CHKDSK with open files
If there is an open file on the drive, Chkdsk sends an error message when the/F command-line option is specified. If the/F command-line option is not specified and there is an open file, CHKDSK reports missing allocation units on the disk. This can happen if the file you open is not recorded in the file allocation table. If Chkdsk reports that a large number of allocation units are missing, consider repairing the disk.
Find Physical Disk errors
Use the/r command-line option to find physical disk errors in the file system. For information on using recover to repair physically damaged files, see.
Report Disk Bad Sector
The bad sector that CHKDSK reports is marked as corrupted when the disk is first ready to run. They do not pose any danger.
Understanding Exit Codes
The following table lists the exit codes that are reported after CHKDSK completes the task.
Exit code Description
0 no errors were found.
1 error has been found and fixed.
2 A cleanup disk has been performed (for example, a fragmentation collection), or no cleanup disk has been performed because/F was not specified.
3 because the/F option is not specified, the disk cannot be checked, the error cannot be repaired, or the error is not repaired.
The Recovery Console provides CHKDSK commands with different parameters.
Example
If you want to check the disks in drive D and you want Windows to fix errors, type:
Chkdsk d:/f
If an error is encountered, Chkdsk pauses and displays the message. When Chkdsk finishes a task, it displays a report with the disk status listed. You cannot open any files on the specified drive unless CHKDSK has completed the task.
On a FAT disk, to check for nonadjacent blocks of all files in the current directory, type:
Chkdsk *.*
CHKDSK Displays a status report, and then lists the files that meet the conditions for nonadjacent blocks.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.