FSCK Tools--checking and repairing file systems on Linux systems

Source: Internet
Author: User

May be due to the problem of the power source of the computer yesterday, and then turn on, directly appear the following interface:

I think, will not, the computer how the problem again (last week, the hands of the cheap, the installation of the system's hard disk partition to the inactive partition, the computer will not start, and then manually guided up;);

I carefully a text hint, need to let me manually run the Fsck tool on the INITRAMFS, directly search what is the Fsck tool, originally used to check and repair the file system, run the following command, and the text prompt in the process, always press Yes, and then the repair succeeded;

Fsck-t ext4/dev/sda1

In this case, it is necessary to understand the role of this tool, the following directly from: Man fsck Chinese version: (fsck is filesystem chek abbreviation)

The Chinese version of Man fsck:

FSCK (8) System Manager's Manual FSCK (8)NAME fsck-check and repair the Linux file system Total fsck [-SACVRTNP] [-t fstype] [Filesys ...] [--] [fs-specific-Options] Profiling fsck is typically used to check and properly repair one or more Linux file systems. Filesys can be a device name (for example:/DEV/HDC1,/DEV/SDB2), a mount point (for example:/,/usr,/home), or a disk label for a ext2 file system, or a UUID specifier (for example: UUID=8868ABF6-88C5-4A83-98B8-BFC24057F7BD or label=root).       In general, Fsck will try to run file system checks on different physical disks simultaneously in parallel, which reduces the time to check all file systems. If you do not specify a file system on the command line, and you do not specify-A option, FSCK checks the file system that is registered in the/etc/fstab in the default order. This and use-The AS option is the same. The return value of the fsck exit is the sum of the following conditions:0-No Errors1-file system is faulty but fixed2-system should restart4-file system error not fixed8-Run Error --usage or syntax errors +-user has deactivated fsck operation --Error in shared library when multiple file systems are detected, the return value of the exit is the bitwise OR result of the return value for each file system check. In fact, Fsck is just a front end of different file system inspectors (Fsck.fstype) in Linux. First, it is/sbin to search for a specific file system inspector, and then in/etc/FS and/etc, and then search in the path listed in the PATH environment variable. Please check the manual pages of the inspectors for specific file systems for details. Selected-S sequence to perform fsck operations. This is advantageous if you are checking multiple file systems and the inspector is running in interactive mode. (Note: e2fsck (8the default is to run interactively. To make the E2fsck (8) to run non-interactively, you must specify the-p and-a options if you want to automatically correct the error, or-n option if you do not want to automatically correct the error. )       -T fslist specifies the type of file system to check. When you specify a-a flag, only the file system of the type listed in Fslist is checked. The fslist parameter is a comma-delimited list of file system types and option specifiers. You can add a negative prefix to all file systems in this comma-delimited list'No'Or'!'so that only the file system that is not listed in the fslist will be checked.              If no negative prefixes are added to all file systems listed in Fslist, only the file systems listed in Fslist will be checked. The option specifier may also be included in this comma-delimited list of fslist. Their format is opts.=fs-option. If an option specifier appears, only theFile systems that do not contain fs-option in their mount options fields in/etc/fstab will be checked. If the option description have the negative prefix, then only the/etc/The fstab in their Mount options field contains FS-option's file system will be checked. For example, if a opts appears in Fslist=ro so only/etc/Fstab, the Mount option contains the RO file system that will be checked. In order to be compatible with the Mandrake release (its startup script relies on an unauthorized change to the FSCK program user interface), if there is a loop file system in Fslist, it is considered specified opts=loop AS-the parameters of the T option. In general, the file system type is/etc/fstab is obtained by searching the corresponding entries in the Filesys. If the type cannot be inferred, and-The t option has only one file system parameter, and FSCK uses the specified file system type.       If this type is not available, the default file system type (currently ext2) will be used. -a searches for/etc/fstab files, checking all file systems that are defined in the file at once. This option is typically used in/etc/RC system initialization file without using multiple commands to check separate partitions separately. If you do not useThe-P option, the root file system will be first checked. After that, you will press/etc/The file system is checked by the sixth field in the Fstab file Fs_passno the order specified.      A file system with a Fs_passno value of 0 will be skipped and will not be checked. File systems with Fs_passno values greater than 0 will be checked sequentially, and the file system with the smallest Fs_passno value              will be checked first.              If multiple file systems have the same pass number, FSCK will try to process the file systems in parallel, although it does not allow multiple file system checks to run concurrently on the same physical disk. Therefore,/etc/a common setting in the Fstab file is to set the root filesystem's Fs_passno to 1, which defines the fs_passno of the other file systems as 2. This allows the FSCK program to automatically run the file system in parallel Check, if that's good. System administrators may not want to run multiple file system checks in parallel for some reason--For example, if there is not enough memory, excessive paging becomes a system bottleneck. -C If the file system Checker supports it (currently only ext2), the progress bar is displayed.       FSCK manages the file system inspectors so that only one of them can display the progress bar at the same time. -N does not execute, only shows the action that will be performed. -P When the-a flag is set, the root file system and other file systems are checked in parallel. This is the most unsafe practice in the world, because if there is a problem with the root file system, E2fsck (8such a program executable file will be destroyed!       This option is intended for system administrators who do not want to keep the root filesystem small and compact (which is the correct approach). -R When using-A flag to check all file systems, skip the root filesystem (it may have been mounted as read/write). -T displays the title at startup. -V produces redundant output that contains all commands for the specific file system being executed. FS-specific-Options Fsck does not understand an option that is passed to a particular file system inspector. These options must be--The boot options and parameters will be passed to its inspector as a specific file system option. Attention to FSC K is not specifically designed to pass arbitrarily complex options to specific file system inspectors. If you are doing a complex operation, perform a specific file system checker directly. If you pass the extremely complex options and parameters to fsck, it doesn't work as you want, not you shouldn'T is doing with fsck.Currently, the options for a standard file-specific system are still being improved.       Although there is no guarantee, the following options can be supported by most file system inspectors. -A Do not ask questions, automatic repair file system (please use this option carefully). Note E2fsck (8Support-A is just for forward compatibility. This option is mapped to the e2fsck-p option, which is a bit more secure, unlike most file system inspectors support-a like that. -r interactively fix file system errors (ask for confirmation). Note: This is not a good idea if multiple fsck is executing in parallel. Also pay attention to the default behavior of the E2FSCK, which also retains this option only for forward compatibility. 

Author AUTHOR
Theodore Ts ' O ([email protected])

File files
/etc/fstab

Environment variable Environment VARIABLES
The behavior of the FSCK program is affected by the following environment variables:

       Fsck_force_all_parallel
               If this environment variable is set,                                                                                                      fsck
               will try to run all the specified file system checks in parallel, regardless of whether the file systems are on the same device. (This is useful for RAID systems or high-end storage systems such as IBM or the one EMC sells)

Fsck_max_inst
This environment variable will limit the maximum number of file system inspectors that can run concurrently. This allows systems with a large number of disks to avoid fsck
Booting too many file system inspectors at a time can potentially deplete the machine's CPU and memory resources. If the value is 0, you can hatch an unlimited number of processes, which is the current default value. Future
Version of
Fsck will try to automatically determine how many file system checks should be initiated based on the statistics of the collection operating system.

The path PATH environment variable is used to locate the file System checker.  Some system catalogs will be searched first:/sbin,/SBIN/FS.D,/sbin/fs,/etc/fs, and/etc. And then we search.
The directory collection that is set in the PATH environment variable.

Fstab_file
This environment variable allows the system administrator to specify the location of the/etc/fstab file. It is also used by FSCK's developers for testing purposes.

See ALSO
Fstab (5), MKFS (8), Fsck.minix (8), FSCK.EXT2 (8) or e2fsck (8), FSCK.XIAFS (8).

[Chinese version Maintenance person]
Shiji <[email protected]>

[Chinese version of the latest update]
2003.11.01

"China Linux Forum Man manual page translation plan":
Http://cmpp.linuxforum.net

E2fsprogs version 1.34 July 2003 FSCK (8)

Finish

FSCK Tools--checking and repairing file systems on Linux systems

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.