-2

My RPi had power cut and after that didn't boot and this message comes on.

I put a memory card in to PC and made changes in cmdline.txt file from /dev/mmcblk0p2 to /dev/mmcblk0p6 because I have seen this recommended for a similar problem with NOOBs. The error message then became unknown- block(179,6), and still no boot.

I also tried to hold Shift down but nothing changed.

goldilocks
  • 58,859
  • 17
  • 112
  • 227
Klapsius
  • 97
  • 2

2 Answers2

0

There is no point in changing to p2 to p6 on a normal Raspbian install. Those are partition numbers starting from one and there are only 2, so p6 will never work. NOOBS uses additional partitions (and it is not impossible for the numbering scheme to have intentional gaps, but Raspbian does not -- see comments at bottom).

The original error is probably because the partition table was corrupted. If you have another linux machine or something you can run fdisk on stick it in that and look at the output of fdisk -l to see what happened. Unfortunately, unless you have a backup copy or the original image you installed from, figuring out how to set up/correct the partition table will be awkward because the boundaries have occasionally changed.

If you don't have something with fdisk, there are probably other tools that could be tried on any operating system, but again, you will have to use them to investigate the state of the partition table first.

Even if you do restore the table, there is no guarantee the data on the second partition will be okay and you should make sure to run e2fsck on it before you do anything else. However, the fact that the system still boots is a good sign -- the corruption might be very limited.

goldilocks
  • 58,859
  • 17
  • 112
  • 227
  • While your answer should hold true for a current rasbian the noobs partitioning is indeed more complicated (which explains why the OP picked some detail up someplace else and tried that). My raspbian has a p1 /boot and p2 /. OTOH my Arch has p1 /boot and p5 / (there are only those two partitions). – Ghanima Nov 16 '16 at 21:04
  • That's what I meant by "normal" Raspbian install. (@Ghanima Although most other people can't view them, have a look at the deleted discussion in comments on the question -- being misled by stuff about NOOBS is exactly what happened). Interesting about Arch though; I would presume that the kernel by default assigns those numbers in order, but udev could be used to change them. – goldilocks Nov 16 '16 at 21:09
  • I think that back then the installation instructions for Arch suggested to create the partitions that way (IDK). Now they don't. – Ghanima Nov 16 '16 at 21:22
  • @Ghanima Ah, I know what's up there -- you created an extended partition. Those are numbered starting from 5, because the number of primary partition on an MBR formatted device is 4. So there are probably actually 3 partitions on the card, the boot one, another primary one that is a little abstract (because adding an extended one requires this), would not contain a filesystem, and won't be in /dev (but fdisk will find it), and a third one that is the extended one with the root fs in it. This is so you can have more than four partitions. – goldilocks Nov 16 '16 at 21:39
  • Is it possible reason why that happen because memory card was poor quality or poor brand? – Klapsius Nov 17 '16 at 12:15
  • That it got corrupted? That's always a possibility on power fail, although how much of a possibility depends on how busy it is doing I/O to the card, especially the "O" half. A thing about SD cards is they use large (1-4 MB) "erase blocks" which may contain a random assortment of different bits of data. When something in the erase block needs to be changed, the entire block must be re-written. If part of that block contains partition table or filesystem structure information and it is lost, then it can complicate being able to find other information. – goldilocks Nov 17 '16 at 12:26
  • However, anecdotally I'd say its an unlikely roll of the dice; I've probably pulled the cord on a pi over a hundred times and never had a problem. If I can though, I try to do it when the green ACT light (indicating SD card I/O) isn't busy. Also: Eventually SD cards wear out and problems like this may start to happen. How long that takes depends on how much they are being used, primarily, how much you are writing to them, but it should be a pretty long time in most cases (years). – goldilocks Nov 17 '16 at 12:28
-1

Had this same problem yesterday and used this tutorial and it worked fine.

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

You basically need to repair your filesystem which can be done so through recovery mode on a pi or through any other Linux or MAC based system.