Lan Yiyun: Basic Linux fsck command

The fsck command is a disk file system checking and repair tool in Linux systems, used to detect and repair errors in the file system. The following is some basic introduction and common options about the fsck command:

  1. introduce:

    • The fsck command is used to check and repair errors in the disk file system.
    • It can be run automatically at system startup or manually to check and repair specified file systems.
    • fsck supports multiple file system types, such as ext2, ext3, ext4, XFS, etc.
  2. Common options:

    • -a: Automatically repair errors in the file system without manual intervention.
    • -y: Automatically answer "yes" to confirm all questions when performing repair operations.
    • -n: Only shows the issues that need fixing without actually performing the fixes.
    • -r: Interactive repair, which requires the user to confirm the repair operation for each problem.
  3. example:

    • fsck /dev/sda1: Check and repair the file system of the /dev/sda1 partition.
    • fsck -a /dev/sdb1: Automatically repair the file system of the /dev/sdb1 partition.

By using the fsck command, you can check and repair errors in the file system to ensure the consistency and health of the file system. Please note that when running the fsck command, you should ensure that the file system being checked is inactive, preferably in single-user or rescue mode. In addition, it is recommended to back up important data before operation and operate with caution to avoid data loss.

おすすめ

転載: blog.csdn.net/tiansyun/article/details/132909959