How to Check Filesystem Health (ext4, XFS) on Linux

Check filesystem health for ext4 and XFS filesystems on Linux servers. Monitor filesystem integrity, detect corruption, verify mount status. Setup monitoring with Zuzia.app.

Last updated: 2026-01-11

How to Check Filesystem Health (ext4, XFS) on Linux

Need to check filesystem health for ext4 or XFS filesystems on your Linux server? Want to verify filesystem integrity, detect corruption, and ensure reliable storage? This guide shows you how to check filesystem health using built-in Linux commands and set up automated monitoring with Zuzia.app.

For comprehensive filesystem monitoring strategies, see Filesystem Health Monitoring Guide. For troubleshooting filesystem issues, see Filesystem Corruption Data Loss.

Why Checking Filesystem Health Matters

Filesystem health checks help you detect corruption early, verify filesystem integrity, prevent data loss, maintain storage reliability, and ensure filesystems are functioning correctly. Regular filesystem health checks prevent corruption from spreading and causing permanent data loss.

Method 1: Check ext4 Filesystem Health

For ext4 filesystems, use specialized ext4 tools:

Check ext4 Filesystem Status

# Check ext4 filesystem status
tune2fs -l /dev/sda1 | grep -E "Filesystem state|Last mount|Last checked"

# View ext4 superblock information
dumpe2fs /dev/sda1 | head -50

# Check ext4 mount options
mount | grep ext4

# Verify ext4 filesystem is clean
tune2fs -l /dev/sda1 | grep "Filesystem state"

The tune2fs command shows ext4 filesystem status and configuration.

Check ext4 Filesystem Errors

# Check for ext4 errors in kernel messages
dmesg | grep -i "ext4\|filesystem\|error" | tail -20

# Check ext4 filesystem errors
tune2fs -l /dev/sda1 | grep -i "error"

# View ext4 error count
dumpe2fs /dev/sda1 | grep -i "error"

# Check if filesystem needs checking
tune2fs -l /dev/sda1 | grep "Last checked"

ext4 error checking helps detect filesystem problems early.

Run ext4 Filesystem Check (Read-Only)

# Check ext4 filesystem without fixing (read-only)
fsck.ext4 -n /dev/sda1

# Check ext4 filesystem with verbose output
fsck.ext4 -n -v /dev/sda1

# Check ext4 filesystem and show progress
fsck.ext4 -n -C /dev/sda1

Read-only filesystem checks verify integrity without making changes.

Method 2: Check XFS Filesystem Health

For XFS filesystems, use XFS-specific tools:

Check XFS Filesystem Status

# Check XFS filesystem information
xfs_info /dev/sda1

# Check XFS filesystem status
xfs_admin -l /dev/sda1

# View XFS mount options
mount | grep xfs

# Check XFS filesystem label
xfs_admin -l /dev/sda1

The xfs_info command shows XFS filesystem status and configuration.

Check XFS Filesystem Errors

# Check for XFS errors in kernel messages
dmesg | grep -i "xfs\|filesystem\|error" | tail -20

# Check XFS filesystem health (read-only check)
xfs_repair -n /dev/sda1

# View XFS error log (if available)
xfs_logprint /dev/sda1 2>/dev/null || echo "XFS log not accessible"

# Check XFS filesystem consistency
xfs_db -c "sb 0" -c "print" /dev/sda1

XFS error checking helps detect filesystem problems early.

Run XFS Filesystem Check

# Check XFS filesystem (read-only, don't fix)
xfs_repair -n /dev/sda1

# Check XFS filesystem with verbose output
xfs_repair -n -v /dev/sda1

# Check XFS filesystem and show progress
xfs_repair -n -V /dev/sda1

XFS filesystem checks verify integrity without making changes.

Method 3: Check Filesystem Mount Status

Verify filesystems are properly mounted:

Check Mount Status

# List all mounted filesystems
mount | grep -E "ext4|xfs"

# Check specific filesystem mount
mount | grep "/dev/sda1"

# Check filesystem mount options
mount | grep "/dev/sda1" | grep -oE "ro|rw|noexec|nosuid"

# Verify filesystem is writable
touch /mnt/test-file 2>&1 && rm /mnt/test-file && echo "Filesystem is writable" || echo "Filesystem is read-only or error"

Mount status checking verifies filesystems are accessible.

Check Filesystem Usage

# Check filesystem usage and health
df -hT | grep -E "ext4|xfs"

# Check inode usage
df -i | grep -E "ext4|xfs"

# Check filesystem space and health
df -hT /dev/sda1

# Monitor filesystem usage
watch -n 5 'df -hT | grep -E "ext4|xfs"'

Filesystem usage monitoring shows capacity and health status.

Method 4: Check Filesystem Errors from System Logs

Review system logs for filesystem errors:

Check Kernel Messages

# View recent filesystem-related kernel messages
dmesg | grep -i "filesystem\|ext4\|xfs\|error\|corrupt" | tail -30

# Check for filesystem errors
dmesg | grep -iE "I/O error|filesystem error|corruption" | tail -20

# Monitor filesystem messages in real-time
dmesg -w | grep -i "filesystem\|ext4\|xfs"

Kernel message checking shows filesystem errors and warnings.

Check System Logs

# Check system logs for filesystem errors
journalctl -k | grep -i "filesystem\|ext4\|xfs\|error" | tail -20

# Check recent filesystem errors
journalctl --since "1 hour ago" | grep -i "filesystem\|error"

# View filesystem-related log entries
journalctl -u systemd-fsck | tail -20

System log checking provides filesystem error information.

Method 5: Automated Filesystem Health Monitoring with Zuzia.app

Manually checking filesystem health works for troubleshooting, but for production Linux servers, you need automated filesystem health monitoring that alerts you when filesystem issues are detected.

Setting Up Automated Filesystem Health Monitoring

  1. Add Scheduled Task in Zuzia.app Dashboard

    • Navigate to your server in Zuzia.app
    • Click "Add Scheduled Task"
    • Choose "Command Execution" as the task type
  2. Configure Filesystem Health Check Command

    • For ext4: tune2fs -l /dev/sda1 | grep "Filesystem state"
    • For XFS: xfs_info /dev/sda1
    • Set execution frequency: Once daily or weekly
    • Configure alert conditions: Alert when filesystem errors detected
    • Set up comparison with previous runs to detect changes
  3. Set Up Notifications

    • Choose notification channels (email, webhook, Slack, etc.)
    • Configure alert thresholds (e.g., alert if filesystem errors detected)
    • Set up escalation rules for critical filesystem issues
    • Configure different alert levels for different filesystems

Monitor Specific Filesystems

For critical filesystems, create dedicated monitoring tasks:

# Check ext4 filesystem health
tune2fs -l /dev/sda1 | grep -E "Filesystem state|Last checked"

# Check XFS filesystem health
xfs_info /dev/sda1

# Check for filesystem errors
dmesg | grep -i "filesystem\|error" | tail -10

Zuzia.app stores all command outputs in its database, allowing you to track filesystem health over time, identify issues early, and detect corruption before it causes data loss.

Best Practices for Checking Filesystem Health

1. Check Filesystem Health Regularly

Check filesystem health once daily or weekly. Filesystem corruption can develop over time, so regular checks help detect issues early. Use Zuzia.app automated monitoring to check filesystem health continuously without manual intervention.

2. Monitor Filesystem Errors

While basic filesystem checks focus on status, also monitor filesystem errors using system logs and kernel messages. Check for I/O errors, corruption warnings, and filesystem-related problems. Set up separate monitoring for filesystem error detection.

3. Check Before and After System Changes

Check filesystem health before and after system changes, updates, or maintenance. Verify filesystem integrity after system crashes or improper shutdowns. Use filesystem checks to verify system stability.

4. Document Expected Filesystem State

Maintain documentation about expected filesystem state. Document which filesystems should exist, their types, and their purposes. Update documentation when filesystem configurations change.

5. Plan Filesystem Maintenance

Use filesystem health data for planning maintenance. Schedule filesystem checks during maintenance windows. Plan filesystem repairs based on health status. Make data-driven decisions about filesystem maintenance.

Troubleshooting Common Filesystem Health Issues

Filesystem Shows Errors

If filesystem health checks show errors:

# Check error details
dmesg | grep -i "filesystem\|error" | tail -20

# Verify filesystem status
tune2fs -l /dev/sda1 | grep "Filesystem state"  # ext4
xfs_info /dev/sda1  # XFS

# Check if filesystem needs repair
fsck.ext4 -n /dev/sda1  # ext4
xfs_repair -n /dev/sda1  # XFS

Review error messages and plan filesystem repair during maintenance window.

Filesystem Mounted Read-Only

If filesystem is mounted read-only due to errors:

# Check mount status
mount | grep /dev/sda1

# Check for errors
dmesg | grep -i "read-only\|remount"

# Verify filesystem health
tune2fs -l /dev/sda1 | grep "Filesystem state"  # ext4

Read-only mounts indicate filesystem errors that need attention.

Filesystem Check Required

If filesystem check is required:

# Check last check time
tune2fs -l /dev/sda1 | grep "Last checked"  # ext4

# Plan filesystem check during maintenance
# Unmount filesystem if possible
umount /dev/sda1

# Run filesystem check
fsck.ext4 -p /dev/sda1  # ext4 (auto-repair)
xfs_repair /dev/sda1  # XFS (requires unmount)

Schedule filesystem checks during maintenance windows.

FAQ: Common Questions About Checking Filesystem Health

How often should I check filesystem health on my Linux server?

We recommend checking filesystem health once daily or weekly. Filesystem corruption can develop over time, so regular checks help detect issues early. For servers with frequent disk activity or high I/O, check more frequently. Use Zuzia.app automated monitoring to check filesystem health continuously without manual intervention.

What should I do when filesystem health checks show errors?

When filesystem health checks show errors, first verify the error details using system logs and kernel messages. Plan filesystem repair during a maintenance window. Backup data before running filesystem repair. Use read-only checks first to assess damage. If errors are critical, consider replacing the storage device.

Can I check filesystem health without unmounting?

Yes, you can check filesystem status and errors without unmounting using tune2fs for ext4 or xfs_info for XFS. However, full filesystem checks (fsck or xfs_repair) typically require unmounting the filesystem. Use read-only checks (fsck -n or xfs_repair -n) to verify integrity without making changes.

How do I identify which filesystem has health issues?

Use df -hT to list all filesystems and their types. Check filesystem-specific health status using appropriate tools (tune2fs for ext4, xfs_info for XFS). Review system logs for filesystem errors. Zuzia.app tracks filesystem health for all mounted filesystems automatically.

Why is monitoring filesystem health important?

Monitoring filesystem health helps detect corruption early, prevent data loss, maintain storage reliability, ensure filesystem integrity, and plan maintenance proactively. Filesystem corruption can cause data loss and system downtime, so tracking filesystem health is essential for maintaining system reliability.

How do I compare filesystem health across multiple servers?

Use Zuzia.app to monitor filesystem health across multiple servers simultaneously. Each server executes filesystem checks independently, and all results are stored in Zuzia.app's database for centralized comparison and analysis. You can view filesystem health for all servers in a single dashboard and identify servers with filesystem issues.

Does Zuzia.app track filesystem health changes over time?

Yes, Zuzia.app stores all command outputs in its database, allowing you to track filesystem health over time and identify when filesystem status changes. You can view historical data to see filesystem health trends, identify degradation patterns, and verify that filesystem repairs were successful. This helps you maintain filesystem reliability and troubleshoot storage issues proactively.

Note: The content above is part of our brainstorming and planning process. Not all described features are yet available in the current version of Zuzia.

If you'd like to achieve what's described in this article, please contact us – we'd be happy to work on it and tailor the solution to your needs.

In the meantime, we invite you to try out Zuzia's current features – server monitoring, SSL checks, task management, and many more.

We use cookies to ensure the proper functioning of our website.