Things went missing after yanking power


What is the problem?
Twice now I've lost recently installed plugins and .gcode files on the OctoPrint SD. It is the most bizarre thing, and I can't imagine how it would even happen. Both times that it happened it still had a few models on it but it was almost as if the whole thing reverted to what it was a day before. This means that plugins I had recently installed, temperatures I had changed, and the latest gcode files were just gone.

I wasn't paying attention the first time, but I think it happened after pulling out the power without shutting down. The second time I was getting a 500 when navigating to the page from my PC (worked fine on my phone?) so I pulled the power and plugged it back in and the stuff was gone.

So I guess the moral here is to shut it down properly, but I don't understand how the stuff would just be gone? I've restarted after installing those new plugins, so physical files exist, it isn't like I just lost stuff in RAM.

To be clear, only the plugins I installed today went missing, not the ones from before that.
Any ideas?

What did you already try to solve it?

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)


Linux likes to cache things like updated directories, changed inodes, etc. in memory for better file system performance. When you just "pull the plug", all those things that were updated in memory but not yet written back to the file system are lost. Worst case is when there's multiple changes needed to update the file system, and the plug gets pulled while only some of them have been written out. This can corrupt the file system so bad that it is worthless and you have to start over from a backup (you are doing backups, right?).


I had no idea Linux did that. That likely explains it, thanks a lot :slight_smile:


I've unmarked this as a solution because I just came across something really weird. No matter what changes I make, when I goto the power button at the top of the UI and reboot or shutdown system, when it starts up again everything is back to what it was a couple days back.
Even if I tell I delete all my timelapses (and watch the progress bar doing it), after a reboot they are back. So it isn't yanking the cable.

Any idea? Thanks!


Is this still on the same install as the one you yanked the power on? If so, it might be that you are already seeing file system corruption that's causing this behaviour.

Really never ever yank power on a Linux system if you have any chance to avoid it :wink:


Yeah it is the same. If that is the issue then cloning the SD card wouldn't help, right?


That's right. It's hard to say though if that really is the problem here. What you could do is have it check its file system, see if that reports (and/or fixes) any errors. If possible, do this while a monitor is attached so that you can watch live what it's doing while checking (you won't be able to access it via the network while the check is running).


Thanks for the help @foosel. Up and running :+1: