I got a RPi4 with an external hard drive, it had a kernel panic

---[ end Kernel panic - not syncing: Attempted to kill init!

I pulled the plug on it and on restart I'm getting a bunch of filesystem errors:

EXT4-fs error (device sda1) in ext4_free_inode:363: Corrupt filesystem

I tried to force an fsck on reboot by:

  • sudo touch /forcefsck
  • add fsck.mode=force to /boot/cmdline.txt
  • reboot --reboot

But the check completed and the error appeared again.

  • Is SMART happy with the disk? – roaima Oct 17 '20 at 22:22
  • I didn't have smartctl in my path, chose not to install new things while trying to figure this out. – givanse Oct 18 '20 at 22:33

After forcing a fsck on boot, I found in /var/log/syslog this message:

EXT4-fs (sda1): warning: mounting fs with errors, running e2fsck is recommended

So I unmounted the drive and executed:

e2fsck -y /dev/sda1
reboot --reboot

That was enough to fix it.

  • Good to hear you cracked it, but doesn't your question say that you'd already executed a filesystem check and it didn't fix it? Curious. – roaima Oct 18 '20 at 22:46
  • The initial filesystem check forced a fsck run and later I did an e2fsck, those two do different things I assume. – givanse Oct 19 '20 at 15:27
  • 1
    Same thing. fsck is the generic interface and it will call e2fsck for an extN filesystem – roaima Oct 19 '20 at 15:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.