Hostxpeed
Login Get Started →
Troubleshooting

Fix Filesystem Corruption

5 min read
32 views
Jun 10, 2026

Signs of Corruption

  • Files cannot be read/deleted
  • Segmentation faults on basic commands
  • System randomly freezes
  • Input/output errors

Step 1: Boot into Recovery Mode

For VPS, use Hostxpeed console with rescue mode or boot from recovery ISO.

Step 2: Unmount Affected Partition

sudo umount /dev/sda1
# If busy, use lazy unmount
sudo umount -l /dev/sda1

Step 3: Run fsck

# Check without fixing
sudo fsck -n /dev/sda1

# Auto-fix all issues
sudo fsck -y /dev/sda1

# Verbose output
sudo fsck -V -y /dev/sda1

Step 4: Multiple Passes

Sometimes need to run fsck multiple times:

# Run until error count stops changing
sudo fsck -y /dev/sda1
sudo fsck -y /dev/sda1  # Repeat 2-3 times

Step 5: Check Lost+Found

Recovered files go to lost+found:

ls -la /lost+found/
# Files have inode numbers as names

Step 6: If fsck Can't Fix

Restore from backup:

# Restore specific directories
rsync -av /backup/data/ /mnt/data/

# Or full restore
sudo dd if=/backup/disk.img of=/dev/sda1 bs=4M

Prevent Recurrence

  • Use UPS for physical servers
  • Regular backups
  • Monitor disk health with SMART
  • Use RAID (for dedicated)

Was this article helpful?