Does anybody know how to repair a broken ext4 partition?

The server has been down for over a year now. What happened was that on May 25, 2021, the Orange Pi’s power-connector had a cold-joint, so the power was flaky and kept causing it to power off and back on. This caused Armbian to reboot several times in a row. This wasn’t new and it always came back up before, but this time, it wouldn’t boot anymore. This time, it said it couldn’t find a valid filesystem. After a lot of consternation and testing, I determined that the ext4 partition had become corrupted. I don’t know wth happened to the journaling function of ext4 that’s supposed to prevent this. 🤨

Anyway, after making a backup and wasting a lot of time trying to analyze and trying to do data-recovery, I fixed the partition table and superblock, and can see some of the items in the root, but there’s a lot of broken directories. Apparently a lot of inodes are somehow broken.

Doing raw searches seems to find most of the directories and of course, most of the files are there, I just need a way to rebuild the directory structure and/or inodes. That is, I need either a way to fix the corruption, or a data-recovery program that can search for directories and rebuild the tree (with user-input if needed).

I’m currently using a backup that was made two years before the crash, so it’s pretty devastating that two years of work (the most productive two years 🤦) are lost. 😕

Any ideas? Can anybody help? Is anybody out there? (Comments can be posted without an account.)

Leave a Reply

Your email address will not be published.

2 × five =