Raspberry Pi Kernel panic-not syncing

Last week I had a strange problem after reading the image from the Raspberry Pi to my PC.

The image was read successfully, but after writing the image to the sd card and trying to boot from it, I got following message:

Kernel panic-not syncing: VFS: unable to mount root fs on unknown-block(179,2)

I did try to solve this problem, by following the article on stackexcange (https://raspberrypi.stackexchange.com/questions/40854/kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unknown-block179-6).

After that I got the next kernel panic message:

Kernel panic-not syncing: VFS: unable to mount root fs on unknown-block(179,6)

So I tried a lot of workarounds, but I didn’t get it to work.

I decided to mount the image file and check all the blocks. I found an very easy and hassle free solution for this ways. And this was also the problem solver!

 

1.) Set up an Linux OS and mount the image file.

Set up your prefered Linux OS. (I personally do prefer Debian and Ubuntu).

After that, install “kpartx”. Kpartx is an tool to mounting (multiple) partitions within an image file.

After the installation, execute following command:

This command mounts all partitions in the image file to /dev/mapper/loop0p<X>

2.) Run an file system check and repair it.

Now execute an file check and then repair it.

 

This hopefully repaired the image file! – It worked well for me.

 

Leave a Reply