OPNsense Forum

Archive => 17.1 Legacy Series => Topic started by: deviantintegral on May 21, 2017, 02:35:43 am

Title: Are backups of "volatile" files required on reboots for non-nano installs?
Post by: deviantintegral on May 21, 2017, 02:35:43 am
I have OPNsense installed on a 16GB SSD. I noticed that reboots were taking a long time. It turns out the culprit was the netflow database; gzip'ing was taking 5-10 minutes, blocking a reboot. This commit illustrates the code (https://github.com/opnsense/core/commit/ce4bb4e7a601e56c90a439d33eb47f6144c88799) fairly well. Any reason I can't just comment them out?
Title: Re: Are backups of "volatile" files required on reboots for non-nano installs?
Post by: franco on May 22, 2017, 07:51:45 am
Hi there,

If you comment this out, the database will be reset on each reboot. Your database must be rather large?

We could remove the compression (it's the "z" argument for both compress and extract). It's faster but may wear down a flash-based storage faster.

The question since the hardware used (especially /var RAM-FS) does not match with the amount of data collected:

Do you expect the database to be restored after boot?

If not, we could also make the backup on reboot optional.


Cheers,
Franco
Title: Re: Are backups of "volatile" files required on reboots for non-nano installs?
Post by: deviantintegral on May 24, 2017, 03:09:45 pm
Well, at one point, the disk (16GB) actually filled up completely with netflow data and I had to manually clear it out. I haven't replicated that. /var doesn't look to be RAM mounted, which is why I don't see why there needs to be a backup and restore process at all.
Title: Re: Are backups of "volatile" files required on reboots for non-nano installs?
Post by: franco on May 25, 2017, 01:15:11 pm
It's not entirely correct. If we don't back up the files on a reboot they can't be imported by the installer into a new installation. But in general you are right, so we just need to find a way to remove them and let the importer do its work still.

https://github.com/opnsense/core/issues/1654

Thinking about it, there is a second issue where a reboot backup/restore protects against file corruption through power outages...


Cheers,
Franco