How to repair disk partition in Linux using fsck and fix kernel panic error
Last updated on 2026-03-22T19:39:57.460Z

How to Repair Disk Partition in Linux (Fix Kernel Panic & Filesystem Errors)

If you’re facing errors like:

Kernel panic – not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

or disk-related issues, your Linux partition may be corrupted. The good news is — you can repair it using built-in tools like fsck.

In this guide, we’ll cover step-by-step methods to repair disk partitions in Linux, even if your system is not booting.


 What Causes Partition Corruption in Linux?

  • Improper shutdown (power failure)

  • Disk errors or bad sectors

  • Kernel or system crash

  • Corrupted filesystem (ext4, xfs, etc.)

  • Wrong partition mounting


Step 1: Identify Disk Partition

lsblk

Example:

sda
 ├─sda1
 ├─sda2  ← root partition

Or:

blkid

Step 2: Unmount the Partition

sudo umount /dev/sda2

Step 3: Repair Partition Using fsck

sudo fsck -y /dev/sda2

What it does:

  • Fixes corrupted filesystem

  • Repairs inode errors

  • Restores superblocks

  • Recovers journal


🔧 Step 4: Repair Root Partition

Option A: Recovery Mode

  • Reboot system

  • Open GRUB menu

  • Select Recovery Mode → Root shell

fsck -y /dev/sda2

Option B: Live USB (Recommended)

sudo fsck -y /dev/sda2

Step 5: Rebuild Boot Files

sudo update-initramfs -u
sudo update-grub

Step 6: Check Disk Health

sudo smartctl -a /dev/sda

Advanced Fix: Superblock Recovery

sudo mke2fs -n /dev/sda2
sudo fsck -b 32768 /dev/sda2
  • Always take backup before repair

  • Avoid force shutdowns

  • Keep multiple kernels installed

  • Monitor disk health regularly


Conclusion

Repairing a disk partition in Linux is straightforward using tools like fsck. Whether you're dealing with kernel panic errors or filesystem corruption, following the above steps can restore your system quickly.

If your system still doesn’t boot after repair, consider reinstalling GRUB or booting with an older kernel.