Linux fsck command: detection and repair the file system

The computer system will inevitably be cases of sudden power failure or crash because of human or system malfunction occurs, this case is likely to cause the collapse of the file system, even when serious hardware damage. That is why we have been emphasizing the server must first shut down and then restart the service lies.

If you really appeared in the case of file system corruption, is there no way to fix it? We now talk about the fsck command is used for file system check and repair the side.

fsck command format is as follows:
[root @ localhost ~] # fsck [options] partition device file name

Options:
-t file systems: Specify partition file system;
-A: in the configuration file / etc / fstab to check all partitions;
-a: do not display user prompts, Automatically fix file system;
-C: displays a progress bar to check the partition;
-f: mandatory testing. General fsck command if no partition has a problem, it is not detectable. If mandatory testing, regardless of whether it found problems will be detected;
-y: Automatically fix. -A role and consistent, but some file systems only support -y;

If you want to repair a partition, you can simply execute the following command:
[root @ localhost ~] #fsck -y / dev / sdb1
# Auto Repair

Published 160 original articles · won 97 Like · views 160 000 +

Guess you like

Origin blog.csdn.net/zyy1659949090/article/details/88176666