Please note there is a clear distinction between errors, based on the numbers at the end and I won't go into much details as they can be easily discovered online if required. These fixes assume that you have all the needed connections working (power, SD card, HDMI, wired keyboard, mouse) and are using Raspbian along with NOOBS.
The details for error ending with 2 is at the end of the answer. If your error message ends with 6, like this:
Kernel panic-not syncing: VFS: unable to mount root fs on unknown-block(179,6)
you will need to do a filesystem check & repair:
- Start the Raspberry holding the
Shift
key.
- Once NOOBS loads, press
Alt-F2
to access the recovery command line.
- Login with username
root
and password raspberry
.
- Type
fsck.ext4 -y /dev/mmcblk0p6
. This will scan and attempt to repair the corrupted file system (replace ext4 with your partition type if needed). Note that the auto
mode of fsck
(i.e. only typing fsck
instead of fsck.ext4
) is not supported.
- Type
shutdown -h now
to shutdown the Raspberry cleanly.
- Unplug the power cable and plug it back in. The Raspberry should now start fine.
If your error message ends with 2, like this:
Kernel panic-not syncing: VFS: unable to mount root fs on unknown-block(179,2)
it is likely that the problem is caused by an update bug. The fix involves switching that 2 into a 6:
- Start the Raspberry holding the
Shift
key.
- Click the
Edit config (e)
button or press e
.
- Click the
cmdline.txt
tab or press the right arrow
on the keyboard.
- Replace:
root=/dev/mmcblk0p2
with
root=/dev/mmcblk0p6
- Click
OK
and then press escape
on the keyboard to proceed with the boot sequence.
Your Pi should now boot fine. If the same error shows but with 6 proceed with the above steps.
In some cases, the Pi might ignore the change made in the NOOBS GUI and you would still see the exact same error, with 2
at the end when booting. In this case, tktbjp's answer might help:
Actually it is simple to use the recovery mode. I entered recovery
mode and pressed alt-F2 to loging as root. Changing cmdline.txt from
the GUI does not work.
After logging in as root with password raspberry, check if there is
any /boot directory. Most probably it will not be present. If not then
create it using mkdir /boot Then use vi editor to create cmdline.txt.
#cd /boot
#vi cmdline.txt
in vi editor change the root to mmcblk0p6. My cmdline.txt contents
looks like dwc_otg.lpm_enable=0 console=ttyAM0,115200 console=tty1 root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait
save the file. then it is important to do sync.
#sync
Then boot the board. Cross check using GUI if cmdline is really
changed. My PI B+ is working now