Lost Specific Files (or Their Content) after Power Black Out

Hi there,

way back in March I made some changes to my old OpenWRT Chaos Calmer installation. I updated a config file and installed a new pppd with security fixes.

Now today, like 3 months later, we had a power black out. The router (a Linksys WRT1200AC), DSL modem, etc. were all shutdown the hard way. Now things didn't came back up to life as one would hope. The hardware luckily survived (I lost a Netgear router in the past in such situation). But the software side got a hick-up… while I was able to ssh into the router, open LuCi and even check the modem's stats just fine I had no connection at all. Imagine my cursing (or better don't)!

Turns out all the changes I made in March were lost. Both files (the config and pppd) were essentially 0 byte files for some odd reason. Luckily I had backups and a restoring fixed things for me. I also rebooted the router afterwards and it came back up fine too.

Is there a rational explanation why I lost exactly those two files from my March changes? It felt as the file system buffers with the data of the files wasn't flashed to disk properly, but kept in RAM only for the last months for some strange reason or something (Note: I don't remember, if I rebooted the router after my March changes.) Do I perhaps need to make sure to shutdown/ reboot the router properly to make sure changes are properly stored to the disk?

Maybe someone has some insight/ experience in such situations. Thanks.

sync && echo 3 > /proc/sys/vm/drop_caches

p.s. your release is no longer supported.

1 Like

Given that you have a lot of RAM (relatively speaking), writes can survive rather long in cache - but it shouldn't take that long (and I would expect opkg to fsync, but I haven't checked that; NAND flash is a bit more susceptible to corruption as well).

1 Like

I know, but the last time I tried to update to something newer it failed really badly. :slight_smile: So as long there's isn't a really serious vulnerability that I can't fix by patching it will stay that way.

Just wasn't aware of this 'sync' stuff… need to read about that now. :slight_smile:

@slh:
No opkg involved in this case, I moved the pppd manually, so I guess that's why it wasn't synced properly.

Thanks wulfy23, slh for feedback. :slight_smile:

1 Like

no guarantees... a clean reboot would probably be more certain / easy...

1 Like