# Problem with filesystem



## Ali3n0id (Feb 1, 2014)

Hi there,

I've got a Raspberry Pi with Raspbian on the SD card - I've recently set up a bunch of stuff to run from my pi however when I've gone to restart I get the following error in command line:



> [ ok ] Activating swap...done.
> [ 13.206214] EXT4-fs (mmcblb02p): remounted. Opts: (null)
> [....] Checking root file system...fsck from util-linux 2.20.1
> /dev/mmcblb02p contains a file system with errors, check forced.
> ...


The last thing I did before rebooting was to auto-mount a hard drive when it is connected following this guide:


http://www.techjawab.com/2013/06/how-to ... -hard.html

So I entered maintenance mode after remounting '/' with 'mount -rw -o /' then ran 'fsck -f -c -y' which found those errors in the original boot up screen

'[ 302.720357] EXT4-fs (mmcblb0p2): initial error at 1400677525: ext4_mb_generate_buddy:755
[ 302.734814] EXT4-ds (mmcblb0p2): last error at 1400679774: ext4_iget:4166: inide 517011'

However when I boot into RaspBian now it will simply restart itself over and over with the following messages 



> [ ok ] Activating swap...done.
> [ 18.975917] EXT4-fs (mmcblbk0p2): remounted. Opts: (null)
> [...]Checking root file system... fsck from util-linux 2.20.1
> /dev/mmcblbk0p2: ******* REBOOT LINUX **********
> ...


Now my system continuously reboots with this message, I'm super thankful for your support as there is a lot of work on this SD card.


----------



## hal8000 (Dec 23, 2006)

As you're running Linux Mint 16 easiest way is to mount the SD card in your Linux Mint 16 system. You can buy cheap external SD card readers which will read your card.

After inserting in Linux Mint type dmesg to find the device name of your card, it may be /dev/sdc1 abd /dev/sdc2 referring to boot and root partition.
Its then just a matter of mounting the card and recovering your data, commands like

mkdir ~/recover
sudo mount /dev/sdc2 -t ext recover

Will mount the card at the recovery folder in your home partition on linux mint. Make sure you tell it the correct partition.


The problem you have with the Pi now is continually rebooting will not allow you to access the operating system, which is why I suggest best way is on your external linux system.

Can you remeber if you shut down your Pi properly before this problem happened?
Most corruption comes from not cleanly unmounting the file system, however in the case of a Raspberry Pi I would recommend a Class10 branded SD card. Its also possible that file system corruption may not be down to the card but under voltage. The power supply you are using has to be able to handle the extra power required by your external drive, if under voltage occured during a file system write then that may have caused your data to corrupt.


----------



## Fjandr (Sep 26, 2012)

> So I entered maintenance mode after remounting '/' with 'mount -rw -o /' then ran 'fsck -f -c -y' which found those errors in the original boot up screen


You shouldn't ever run fsck on a mounted drive. Here are some things to try and recover the partition: linux - accidental fsck on mounted - Super User


----------



## Ali3n0id (Feb 1, 2014)

You were completely right Hal8000, the problem I believe was caused by me pulling the power from the boot loop and the resulting inpatience (damn thing doesn't have a power/reset button). 

I followed your instructions and was able to recover all data from the home directory. I am running a class 10 SD card with a 1.2a/5V Power supply so it's not the issue.

Also, thanks for the heads up Fjandr - probably why it got stuck in a loop after the inproperly unmounting. Still learning my way through 'nix.


----------



## Fjandr (Sep 26, 2012)

Sure thing. The learning curve for Linux can be harsh in some areas if you're using it for anything more than web browsing and email.


----------

