OPNsense Forum

English Forums => General Discussion => Topic started by: lukid on August 08, 2017, 11:43:43 am

Title: Power outages tolerance
Post by: lukid on August 08, 2017, 11:43:43 am
Hello everybody.

Here's my question: are the NanoBSD images resistant to systematic "power cable pull"?
I try to explicate myself a little bit clearer: can they be setup to be completely read-only, so that they won't suffer from any unexpected power loss?

Thanks for your time!  ;)
Title: Re: Power outages tolerance
Post by: franco on August 08, 2017, 01:07:47 pm
Hi there,

Truth be told, OPNsense (and subsequently pfSense) removed the read-only feature of the Nano versions over the years. The used file system, UFS, is generally unstable when it comes to power outages, ending up in files of size zero, in some rare occurrences even after a normal reboot.

There are a few backup mechanisms for vital systems (configuration, dhcp leases, captive portal database, insight network reports, and RRD system health data). We also have auto-recovery after file system corruption, it seems to work as well as it can until vital files for recovery are lost.

You can check the integrity of packages any time using this command on the command line.

# pkg check -sa

For the base system and kernel, at this point, such methods do not exist, but could be implemented using "mtree".

Circling back to read-only: you can set the root partition permanently read-only via /etc/fstab. The system comes up in a persistent state, creates a number of memory disks and just runs until rebooted. In this mode, however, changes cannot be made to the system, but it may work in a few use-cases.


Cheers,
Franco
Title: Re: Power outages tolerance
Post by: lukid on August 14, 2017, 11:12:34 am
Hello Franco.

I've been very pleased by your kind reply: thank you very much!  :)

So, this is essentially a no-no.. :( but.. you've been so complete in your argumentation.. that you made it sound like something positive! :D
Nice score for OPNsense community! :)

I think that I'll go with the fstab way, since I'm developing a system where some APU boxes will simply be VPN gateways (for industrial machines remote control), but I liked the idea of basing them on OPNsense/pfSense.
Once I've setup them, they won't be touched for nothing else than system security updates.

Prosit!
Luca
Title: Re: Power outages tolerance
Post by: franco on August 15, 2017, 11:15:21 am
Hi Luca,

Good luck, and thanks.  ;D


Cheers,
Franco
Title: Re: Power outages tolerance
Post by: KoS on April 05, 2020, 10:37:28 pm
Hi Franco

Is the status regards unexpected power loss still the same with the latest OPNsense version (20.1.3) or have there been improvements in the last years since the original post?

Kind regards
 KoS
Title: Re: Power outages tolerance
Post by: franco on April 06, 2020, 12:33:18 pm
It will always be the same as long as we are UFS/BSD. ZFS might be a little better, but you need the hardware to pay for the resource hungry file system.


Cheers,
Franco
Title: Re: Power outages tolerance
Post by: miroco on April 06, 2020, 09:31:23 pm
ZFS on Linux on Tomato

A proof of concept. I just thought someone might find interesting.

https://www.linksysinfo.org/index.php?threads/zfs-on-linux-on-tomato.74603/

miroco