I try to do everything properly, I even have the extroot flagged to mount with the sync option, yet no matter what, after a couple of months, the filesystem gets destroyed. So ext4 is not viable.
My question is what filesystem is recommended that is redundant enough to handle whatever OpenWRT's problem with my hardware is. (Neatgear R7500v2)
root@OpenWrt:~# e2fsck /dev/sda1
e2fsck 1.44.1 (24-Mar-2018)
router-overlay: recovering journal
router-overlay contains a file system with errors, check forced.
e2fsck: Inode checksum does not match inode while reading bad blocks inode
This doesn't bode well, but we'll try to go on...
Have you tried a different make of USB stick? Could the problem be confined to a particular brand/batch of sticks?
I have tried other sticks (though it was LEDE then), I found that sync wasn't actually set so, with the reformat and backup restore, and sync set, hopefully it won't happen again.
I have the router set to reboot every wed and sun at 3:30am to keep 5ghz stable.
I believe the problem is that it does not sync on reboot. In LEDE I had a workaround where I renamed /sbin/reboot to /sbin/reboot_real and replaced the original with a script that would first run "sync".
I did not re-create that setup when updating from LEDE 17 to OpenWRT 18.
You should no need to reboot a device periodically, and reeboting the device should not corrupt any filesystem...
I guess fixing the wifi problem is going to be quite hard, but fixing the corruption on reboot should be easier. How do you reboot the device?
Just a cron to the reboot command. The reason why I did the workaround before was because rebooting from the webui. Its probably kernel level.
Do you have any reboot events that are not due to your cronjob, e.g. due to power outages or someone pulled the plug accidentially?
There was a power outage a few months ago. But it has rebooted and worked fine many times since then. Just during one of the normal reboots, it was trashed. May have happened over time. Current setup mounts with "sync" option and also checked the check filesystem box.
But like I said I had this problem with LEDE and I feel it was halting/restarting before syncing.
Perhaps it is worse than I thought. I was able to corrupt the filesystem with a manual "reboot" command. I've been trying many things.
- sync; reboot
- sync; sleep 3; reboot
nothing seems to work, in the end, ext4 gets corrupted. This time trying -O 64bit,metadata_csum but it will probably still die in a couple of weeks since its always the journal.
Flash drive passes all checks, unless its a one-off incompatibility with the router (wouldn't surprise me with a USB3 bus, I've seen some weird USB2-USB3 compatiblity issues)