0

I have 2 SD cards with Raspbian Stretch that are throwing the following error on boot:

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

I fixed one card by running the following from an ubuntu system:

fsck.fat -y /dev/sdb1
fsck.ext4 -y /dev/sdb2

However, I want this check to be done on every boot. I tried putting fsck.mode=force in the cmdline.txt on the second card using a card reader.

However, I keep getting the same error and theres no indication that it tried to run fsck. The first card says "File System Check started on Root Device", but the second card still throws the error.

Note: I have not fixed the second card manually to check if the auto fix works or not.

Dushyant Bangal
  • 139
  • 1
  • 1
  • 6

1 Answers1

1

To repair the filesystem you need the programs fsck.*. These are located on the root partition. Do you already see the problem?

You have repaired the filesystem on the first SD Card by using the fsck.* programs from the Ubuntu system. On boot of your second SD Card it tries to use fsck.* from the root partition that cannot be mounted. The only way to repair it is to doing it the same way than with the first SD Card.

You use fsck.mode=force that will unconditionally results in full file system checks. But for this it also needs fsck.* The kernel tries it on every boot without success (not really because the error to be unable to mount the root partition will freeze the system before). For further information look at How to run fsck at boot?.

Ingo
  • 42,961
  • 20
  • 87
  • 207