Page 1 of 1

Clock skew and filesystem checks on RPi

Posted: Wed Mar 23, 2016 11:32 pm
by Chymera
Hello, something happened to my rpi during a world update (I am thinking someone might have unplugged it) and now I am having trouble getting back into my system. I am getting a number of errors at boot, and then am forced to boot in read-only mode.

Here's a screenshot of what happens at boot. I think the crux of the matter is the clock skew and the failed fsck.

On my RPi, I have tried:
  • Setting the clock with date and saving with

    Code: Select all

    /lib/rc/sbin/swclock --save
  • Remounting with

    Code: Select all

    mount -o remount,rw /
  • Rebooting without fsck via

    Code: Select all

    shutdown -f
  • Running fsck manually
  • Setting swclock to the sysinit runlevel (currently it is on the boot runlevel, and it may or may not be run before fsck)
  • Combinations of the above
Generally speaking, not matter what changes I made to the system - even if they seem to be written in the session in which I make them, disappear after I reboot the rpi.


I have also tried taking the card out, plugging it into another machine, and running fsck from there. That gives me an entirely different error:

Code: Select all

zenbookhost chymera # fsck /dev/sdb1 
fsck from util-linux 2.27.1
fsck.fat 3.0.28 (2015-05-16)
0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
1) Remove dirty bit
2) No action
? 1
Perform changes ? (y/n) y
/dev/sdb1: 18 files, 28971/142266 clusters
zenbookhost chymera # fsck /dev/sdb2
fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
Angstrom: recovering journal
Superblock needs_recovery flag is clear, but journal has data.
Run journal anyway<y>? yes
fsck.ext3: unable to set superblock flags on Angstrom


Angstrom: ********** WARNING: Filesystem still has errors **********
Can you help me out with this?

Posted: Thu Mar 24, 2016 12:56 pm
by bbgermany
Hi,

i have swclock in runlevel default. You should try starting it before a shutdown. Also try to get the time via ntp or even run a ntpd on the rpi:

Code: Select all

raspi ~ # rc-update show | grep swcl
              swclock |      default
raspi ~ # /etc/init.d/swclock status
 * status: started
raspi ~ #
I dont have any time issues on this system. Oh, and btw, its an rpi1

greets bb

Posted: Thu Mar 24, 2016 7:38 pm
by Irre
I think your ext4 file system is corrupt. If possible remove SD-card and try to run fsck from another system (/dev/mmcblk0p2 ). I gave up linux on SD-cards (except the boot partition, mounted ro). Linuxes on external USB-disks work fine for me.