2

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.

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

1 Answer 1

1

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.

3
  • 1
    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. Commented Oct 18, 2020 at 22:46
  • The initial filesystem check forced a fsck run and later I did an e2fsck, those two do different things I assume. Commented Oct 19, 2020 at 15:27
  • 1
    Same thing. fsck is the generic interface and it will call e2fsck for an extN filesystem Commented Oct 19, 2020 at 15:30

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.