OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • General Discussion (Moderator: fabian) »
  • Can I power-off/reset OPNsense?
« previous next »
  • Print
Pages: [1]

Author Topic: Can I power-off/reset OPNsense?  (Read 376 times)

Rhino

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Can I power-off/reset OPNsense?
« on: May 28, 2019, 07:30:43 pm »
I'm using some cheap soho router, but it is very limited in features and not supported anymore, so I want to change it for something better. I have some spare pcengines/apa board so I want to build small OPNsense-box, but I'm not sure if it can survive hard power-off (I mean not clean shutdown over web-interface, but simply pull the power cord off).

With my old crappy router I do not care about clean shutdown at all. I simply turn power off, and that's it. Maybe it is using some read-only fs? Anyway, it survives this hard treatment. What about OPNsense? What filesystem is it using? Can I simply power it off?

Just for comparison: openwrt is using ubifs/jffs2 overlayed over read-only squashfs, so it can easily survive hard reset. How is it with OPNsense? Don't I breake filesystem if I turn it off in hard way?
Logged

bartjsmit

  • Hero Member
  • *****
  • Posts: 950
  • Karma: 122
    • View Profile
Re: Can I power-off/reset OPNsense?
« Reply #1 on: May 29, 2019, 07:57:37 am »
Yes, you can but no, you shouldn't pull the plug  ;)

By default OPNsense uses UFS, but you can use ZFS if you really need to: https://forum.opnsense.org/index.php?topic=12267.0

The file system gets checked after a sudden power failure but repeated crashes is asking for trouble.

Bart...
Logged

hbc

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: 23
    • View Profile
Re: Can I power-off/reset OPNsense?
« Reply #2 on: May 29, 2019, 01:23:03 pm »
You could set /var and /tmp to RAM. Then most write access is to memory and less problems with power loss.
Logged
Intel(R) Xeon(R) Silver 4116 CPU @ 2.10GHz (24 cores)
256 GB RAM, 300GB RAID1, 3x4 10G Chelsio T540-CO-SR

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 9035
  • Karma: 616
    • View Profile
Re: Can I power-off/reset OPNsense?
« Reply #3 on: June 03, 2019, 04:44:57 pm »
Quote from: hbc on May 29, 2019, 01:23:03 pm
You could set /var and /tmp to RAM. Then most write access is to memory and less problems with power loss.

I don't think this is good advice. UFS corruptions can kill your kernel or system binaries with one unlucky unsolicited reboot.


Cheers,
Franco
Logged

hbc

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: 23
    • View Profile
Re: Can I power-off/reset OPNsense?
« Reply #4 on: June 03, 2019, 05:27:56 pm »
Is there so many write access outside /var and /tmp?
For me it sounded, that he powers off by unplugging anyway. So a powerloss with using temp file systems is less likely to crash than a disk based one.

Does live system run config.xml import automatically?  Then he could boot from USB stick into memory, auto import config from disk and everything is memory based. Every boot new system.
« Last Edit: June 03, 2019, 05:31:57 pm by hbc »
Logged
Intel(R) Xeon(R) Silver 4116 CPU @ 2.10GHz (24 cores)
256 GB RAM, 300GB RAID1, 3x4 10G Chelsio T540-CO-SR

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 9035
  • Karma: 616
    • View Profile
Re: Can I power-off/reset OPNsense?
« Reply #5 on: June 03, 2019, 05:34:58 pm »
The classical way for UFS to shoot itself in the foot is metadata write lagging behind having newly written or partially rewritten files show a size of zero after a forced reboot. Sometimes this happens even on supposedly clean shutdowns, which is a bummer for reboot-after-upgrade scenarios and its ensuing aftermath.

/etc/tty being wiped to size zero was a classical annoyance because you wouldn't get your login prompt back to repair the system.

Another variety of corruption involves (partial?) corruption of file system data which can affect read-only data or files being lost.

Nowadays the firewall health check can give you a fair warning if the system comes back up, but if not there's no real way to recover within the scope of UFS other than an import+install to write a clean system back to the disk.


Cheers,
Franco
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • General Discussion (Moderator: fabian) »
  • Can I power-off/reset OPNsense?
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2019 All rights reserved
  • SMF 2.0.15 | SMF © 2017, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2