This guide is intended to help you if you get an error while checking your Linux file system.
fsck (File System Checker) is a command line tool that can be used to perform interactive consistency checks and patches on one or more Linux file systems. You can use the fsck command to repair damaged filesystems in situations where the system cannot boot or the partition cannot be mounted.
There are several steps to complete before checking and repairing a file system. You must find and deactivate the device
The Linux Filesystem Consistency Checker (fsck) checks filesystems for errors or unresolved issues. The tool is used to troubleshoot potential errors and generate reports.
This utility comes standard with Linux distributions. No special installation steps or procedures are required to use fsck. Once you have loaded the terminal, you can use the tool’s functions.
Follow this tutorial to learn how to use fsck to check and repair a file system on a Linux machine. The tutorial contains examples of how to use the tool and for what use cases.
- Linux or UNIX Type System
- Terminal or command line access
- User with root privileges to run the tool
If You Like What We Do Here At TecMint, Herea Few Things To Consider:
TecMint is the fastest growing and most trusted community site for all kinds of Linux articles, tutorials, and books on the Internet. Millions of people visit TecMint! to view thousands of published articles available for FREE for everyone.
If you like what you are reading, buy us a coffee (or 2) as a thank you.
We are grateful for your continued support.
Repair Damaged Filesystem
The simplest use of the
fsck command is to repair a damaged ext3 or ext4 filesystem without root authority.
If you don’t know the device name, use
df, or some other tool to find it.
sudo umount / dev / sdc1
fsckto repair the file system:
sudo fsck -p / dev / sdc1
fsckto automatically fix any problems that can be avoided dangerous to allow without user intervention.
After restoring the file system, mount the partition:
sudo mount / dev / sdc1
Recover Root Filesystem
fsck cannot check the root filesystem on a running machine because it cannot be unmounted.
If you want to check or repair the root filesystem, you have several options. You can run
fsck at boot time, boot the system into recovery mode, or use the Live CD.
fsck in recovery mode:
- Go to the Start menu and select Advanced Options.
- Select recovery mode and press “fck”.
- When prompted to remount the root filesystem, select Yes.
- When you’re done, continue with the normal download process.
fsck from a live distribution:
Start direct distribution.
partedto find out the name of the root partition.
Open a terminal and do the following:
sudo fsck -p / dev / sda1
Then restart the dynamic distribution and reboot the system.