please choosego to mobile | Continue to access the PC version
View: 7006|Reply: 10

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

[Copy link]

2

threads

34

posts

404

credits

Intermediate member

Rank: 3Rank: 3

credits
404
Published in 2016-2-23 05:47:54 | Show all floors |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

1066

credits

Gold member

Rank: 6Rank: 6

credits
1066
Published in 2016-2-23 16:31:04 | Show all floors
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
Published in 2016-3-8 20:46:02 | Show all floors
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
Published in 2016-3-10 23:02:24 | Show all floors
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.

6

threads

130

posts

672

credits

Senior member

Rank: 4

credits
672
Published in 2024-2-9 04:17:18 | Show all floors
I am for the first time here. I found this board and I in finding It truly helpful & it helped me out a lot. I hope to present something back and help others such as you helped me. 作业代写

6

threads

130

posts

672

credits

Senior member

Rank: 4

credits
672
Published in 2024-2-18 22:44:21 | Show all floors
News Ultime Notizie dal mondo in ultima ora sport formula uno tennis calcio motogp dirette live streaming economia finanza mondo della moda donna style fashion viaggi e vacanze cucina e ricette tecnologia novita hi-tech salute e benessere cinema italiana gossip vip star notizie della scienza annunci lifestyle meteo oroscopo tv gaming foto e video news incontri personali

6

threads

130

posts

672

credits

Senior member

Rank: 4

credits
672
Published in 2024-2-22 22:14:16 | Show all floors
This is a brilliant blog! I'm very happy with the comments!.. Adıyaman Tütünü

6

threads

130

posts

672

credits

Senior member

Rank: 4

credits
672
Published in 2024-3-2 18:03:53 | Show all floors
I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have enjoyed reading. Sobha Crystal Meadows

6

threads

130

posts

672

credits

Senior member

Rank: 4

credits
672
Published in 2024-3-17 22:28:42 | Show all floors
Hello, you old to engrave magnificent, except the last few posts have been kinda boring… I skip your super writings. Historical several posts are merely a bit out of track! extend on! maine coon kittens for sale florda

6

threads

130

posts

672

credits

Senior member

Rank: 4

credits
672
Published in byday 01:05 | Show all floors
Wow, What an exceptional pronounce. i found this too much informatics. it’s miles what i used to be searching for for. i’d as soon as to area you that absorb keep sharing such kind of data.If realistic, thank you. sabung ayam online,
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list