ZRAM status

Just (sudo) reboot will do fine on any recent Linux I know of.

2 Likes

10 posts were split to a new topic: Extending ZRAM to run InfluxDB

3 posts were merged into an existing topic: Mapdb doesn’t restoreOnStartup

@mstormi
Hi Markus,
I am new to ZRAM (was using tmpfs before) and I have a couple of questions to better understand:

  1. to avoid rebooting, in order to periodically sync manually ZRAM, can I issue these commands (or do I have to stop OH too?):

sudo zram-config stop
wait 5 minutes
sudo zram-config start

  1. are these steps still valid for clearing the cache?
    I am asking because I noted that you have removed them from the original post (if not, can you inform the steps to do it safely?):

thanks

Yes but that’ll stop OH so I would avoid that, too.
Combine ZRAM with backup (Amanda in openHABian) to save the files on ZRAM of interest (persistence), the rest is irrelevant so no real loss when you lose them.

No, OH cache is no longer on ZRAM (presuming you use a recent definition of ZRAM dirs in ztab, see openHABian config).

OK

I downloaded openHABian yesterday (version 1.6.1). So I presume it’s ok.

One last thing, when updating OH from openHABian, do I have to stop ZRAM, or openhabian-config does it for me? Otherwise, which are the steps to perform?

I realise this I’m replying to a post over a year old, but thought I would mention my observation. I am also setting up a Pi with a PiJuice for battery backup. I have a monitor connected to the Pi as I have just installed openhabian and was watching to see if there were any issues during the installation & setup.

During shutdown, I noticed one of the messages was:
A stop job is runnung for zram-config job (0 min 01 sec / 5 min 23 sec)
The 5 min 23 sec seems to be a target time (before the shutdown process moves onto the next job), and the 0 min 01 sec is a timer that counts up (to the target time). I’ve shutdown a couple of times and it seems to be in the range 5 mins 20 - 30 sec. I don’t know if this is expected behaviour or not, but you might want to check the time it takes to shutdown (and possibly increase the time from SYS_FUNC_HALT to Power Off). Based on what I have seen, I am going to set my mine for 7 mins.

  • Platform information:
    • Hardware: pi3B+ & PiJuice
    • OS: openhabian-pi-raspios32-v1.6.2.img.xz
    • Java Runtime Environment: openjdk 11.0.9 2020-10-20 LTS
    • openHAB version: 3.0.0
1 Like

I noticed this as well and asked in another thread since I was uncertain if this was expected or not (I suppose it would make sense that there would be a good chunk of data being written to disk though I thought we were mostly just blocking chatting things from writing to the disk and throwing that info away at reboot - ie logs) but I haven’t gotten any reply. Hopefully someone can let us know in this thread.

That’s an interesting observation.
Clearly it isn’t intended (at least not by me).
I guess it’s some default in Raspberry Pi OS (or Linux FWIW) that applies here.

EDIT: try adding TimeoutStopSec=1800 to /etc/systemd/system/zram-config.service

Short of that it makes sense to stop ZRAM before you reboot. At least the first time after installation when there’s so much to sync.

Thanks Markus.
TBH, I’m hoping I don’t need to reboot it very often! So for now I’m going to leave it at the default setting. If I have any issues, I may revisit this.
:+1:

@Steve_1 this issue should be fixed now and you should have no more issues on reboot with zram.

@ndye
Hi, what do you mean that this is solved?
Is there an update to be applied?
I am using openhabian stable.

thanks

If you uninstall and reinstall zram the issue should no longer be present.

Over the weekend I ended up reinstalling OH3 (same openhabian image: openhabian-pi-raspios32-v1.6.2.img.xz) due to other issues, and notice that this issue had gone away :+1:

@mstormi:
One question:
When we have the latest stable release of openhabian v1.6.2 up and running, how should we update Openhab 3 in the future? Do we still have to disable ZRAM or is openhabian-config able to handle the whole update procedure by his own (to 3.X versions)?

openHABian is handling the upgrade.

1 Like

Thanks for your reply.
In order to uninstall and reinstall ZRAM can I use the openhabian menus?
So, inside menu “30 System Settings”:

  • First “Uninstall ZRAM”
    and then
  • “38 - Use ZRAM”

Do I have to reboot in between or before or after?

thanks

Correct, you can reboot in-between uninstalling and reinstalling if you want to be safe but it should work just fine without rebooting.

1 Like

A post was split to a new topic: Logs stop ZRAM issue?