Understand the fsck Exit codes
Every time we run the fsck it will return an exit code so it is important to know the exit codes to have an understanding of what the return says, following are the exit codes with their description used in fsck:
Code |
Description |
---|---|
0 |
No errors. |
1 |
Filesystem errors corrected. |
2 |
The system should be rebooted. |
4 |
Filesystem errors were left uncorrected. |
8 |
Operational error. |
16 |
Usage or some type of syntax error. |
32 |
Checking canceled by the user through request. |
128 |
Shared-library error. |
How to fix fsck File System errors in Ubuntu?
The fsck tool is used widely by Linux and Ubuntu users for checking various types of errors that may occur in the filesystems, windows have a similar facility in which we can scan for broken disks and issues and try to fix them, similarly, the fsck is also used widely in the systems for checking and fixing errors. In This article, We’ll see how to fix fsck errors in Ubuntu and will explore various methods to check and repair filesystem errors seamlessly.
How to fix fsck File System errors in Ubuntu
- Prerequisites to fix fsck File System errors in Ubuntu
- How to Check and Repair Filesystem
- Method 1: View Mounted Disks and Partitions
- Running fsck for Checking Errors
- Method 1: Force the fsck to the system root
- Method 2: Run the fsck in the rescue mode
- Fix the Detected Error Automatically
- Fix Detected Errors Automatically with fsck
- How to Skip Fsck on any Mounted Filesystems