Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 3787|Reply: 3

Sudden power-off: How to make OrangePi to tolerate it?

[Copy link]

2

Threads

34

Posts

274

Credits

Intermediate member

Rank: 3Rank: 3

Credits
274
Post time 2016-2-23 05:47:54 | Show all posts |Read mode
Edited by toxuin at 2016-2-22 13:51

In my 3D printer set up I have an "OH SH*T" button which cuts the power to the machine. It is big, red and you are supposed to hit if something goes wrong. It is wired directly to a power supply. Here's the problem: hitting it effectively shuts power to OrangePi. I know ext3 tolerates corruption pretty good, but practically after only 3 such events my file system went bad.
I am using Ubuntu from loboris, Octoprint (written in python) and nginx on my OrangePi.

Here's an idea how to overcome this: use read-only root. Normally you wouldn't want to do this unless you do not care about the persistence of your data. While I do care about the persistence, I only care about small portion of it (like the uploaded files and logs). This pretty much means I need a read-only root and a r\w partition with all my uploaded crap and octoprint print logs.

I've heared UnionFS can do something even cooler: having a read-only base image and keep all the written changes in-memory. This is kinda cool: you can "sync" what is written once in a while and if a power-loss event occurs you only loose a small portion of data that was created since the last sync.

I also heared that UnionFS is not widely used anymore because there is such thing as Aufs. It is essentially a rewrite of UnionFS targeted to be more stable and robust.

I have no experience with any of those FS. Is it even possible to have a read-only root with in-memory writes, syncing only things I want? I mean, is it possible with OrangePi & loboris's kernel?

2

Threads

144

Posts

929

Credits

Senior member

Rank: 4

Credits
929
Post time 2016-2-23 16:31:04 | Show all posts
I don't think Loboris's kernels are compiled with either of those filesystems enabled. You can always compile the kernel yourself, though. As for your other question: yes, it is possible. That's how e.g. nearly all bootable Linux CDs/DVDs work -- all the changes to the filesystem remain only in RAM, because, quite obviously, CDs and DVDs are not writable the same way a USB-stick or a HDD would be. If you wanted to still be able to keep some files persistent, however, you'd still run into the same issue: sudden power-loss would eventually lead to corruption.

Though, instead of mucking around with stuff like this I'd see it more logical to fix the root problem: your oh-shit - button. Why does it have to cut off power to the Pi when you could just leave the Pi running, but cut power to the printer? Well, you do as you see fit.

0

Threads

4

Posts

95

Credits

Registered member

Rank: 2

Credits
95
Post time 2016-3-8 20:46:02 | Show all posts
you also have seed-device option in BtrFS, although I'm not sure loboris's kernel is compiled with it, but since it's heading to be the default FS in Linux i guess it might be included.

2

Threads

6

Posts

62

Credits

Registered member

Rank: 2

Credits
62
Post time 2016-3-10 23:02:24 | Show all posts
no no no, this is going in the wrong direction.
rather than playing around with different filesystems, why don't tweak ext4?
look at the mount options, they are usually defined for a kinda good performance while somewhat keeping them safe. turn them over to safe (e.g. using sync instead of async, disabling all time-writings and such). you'll certainly have to wait a few more seconds for it to boot, but after that everything should act pretty normal.

since you already have the loboris image with the gpui enabled: if you want to use the GPU to render the timelapse videos, look at a script I developed a few months ago: https://github.com/guysoft/OctoPi/issues/184
I'm highly interested if this also works on orange pis. since I currently only have my raspberry pi 2 hooked up to my prusa i3 I don't wanna rewire everything and check for myself.
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2021-3-5 02:39 GMT+8 , Processed in 0.029967 second(s), 22 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list