Linux fsck Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux fsck Guide
Complete beginner-friendly guide to fsck on Linux, covering Arch Linux, CachyOS, and other distributions including filesystem checking, filesystem repair, and disk maintenance.
Table of Contents
Understanding fsck
What is fsck?
fsck (filesystem check) checks and repairs filesystems.
Uses:
- Check filesystem: Verify filesystem integrity
- Repair filesystem: Fix filesystem errors
- Disk maintenance: Maintain disk health
- Error recovery: Recover from errors
Why it matters:
- Filesystem health: Maintain filesystem
- Error recovery: Fix filesystem errors
- Data integrity: Ensure data integrity
fsck Basics
Check Filesystem
Basic usage:
# Check filesystem
sudo fsck /dev/sda1
# Checks filesystem integrity
Auto Repair
Automatic repair:
# Auto repair
sudo fsck -a /dev/sda1
# -a = automatic (repairs automatically)
Checking Filesystems
Dry Run
Check only:
# Check only (no repair)
sudo fsck -n /dev/sda1
# -n = no (no repair, check only)
Verbose Mode
Show details:
# Verbose mode
sudo fsck -v /dev/sda1
# -v = verbose (shows details)
Repairing Filesystems
Force Check
Force check:
# Force check
sudo fsck -f /dev/sda1
# -f = force (checks even if clean)
Interactive Repair
Interactive mode:
# Interactive repair
sudo fsck /dev/sda1
# Asks before repairing
Troubleshooting
Unmount First
Unmount device:
# Unmount before checking
sudo umount /dev/sda1
# Then check
sudo fsck /dev/sda1
Summary
This guide covered fsck usage, filesystem checking, and repair for Arch Linux, CachyOS, and other distributions.
Next Steps
- mount Guide - Mounting filesystems
- Filesystem Management - Filesystem setup
- System Recovery - System recovery
- fsck Documentation:
man fsck
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.