Feature request - memfs mount due to fast SD card wear on rpi device. #74

Open
opened 2026-10-27 09:31:47 +01:00 by adam · 3 comments
Owner

RRD database is very hard on SD cards and will wear them out completely in less than a year.
But data is not that big and RPI has enough RAM to put those files on tmpfs. Therefor the suggestion:

  1. mount tmpfs in /var/lib/pymc_repeater.tmpfs (add tmpfs /var/lib/pymc_repeater.tmpfs tmpfs defaults,size=100m 0 0 to fstab).
  2. create symlink to repeater.db and metrics.rrd pointing to tmpfs
  3. in a shutdown script add a command to preserve tmpfs contents in pymc_repeater.preserve
  4. in a startup script add a command to restore tmpfs out of pymc_repeater.preserve
RRD database is very hard on SD cards and will wear them out completely in less than a year. But data is not that big and RPI has enough RAM to put those files on tmpfs. Therefor the suggestion: 1. mount tmpfs in /var/lib/pymc_repeater.tmpfs (add `tmpfs /var/lib/pymc_repeater.tmpfs tmpfs defaults,size=100m 0 0` to fstab). 2. create symlink to repeater.db and metrics.rrd pointing to tmpfs 3. in a shutdown script add a command to preserve tmpfs contents in pymc_repeater.preserve 4. in a startup script add a command to restore tmpfs out of pymc_repeater.preserve <!-- github-sync-id:4223426958 -->
Author
Owner

I think it would be more useful to do this in docker compose. There you can define a tmpfs eg:

    tmpfs:
      - /tmp:size=64m,mode=1777
I think it would be more useful to do this in docker compose. There you can define a tmpfs eg: ``` tmpfs: - /tmp:size=64m,mode=1777 ``` <!-- github-comment-id:5388163881 -->
Author
Owner

I think it would be more useful to do this in docker compose. There you can define a tmpfs eg:

    tmpfs:
      - /tmp:size=64m,mode=1777

Most of modern linuxes already mount /tmp in memfs. But in order to place those files there they have to be at least in a separate directory (or to be able to define their location in config). Right now i can only move them to memfs via hackery by creating symlinks in a startup script and that constantly breaks cause symlinks get overwritten.

> I think it would be more useful to do this in docker compose. There you can define a tmpfs eg: > > ``` > tmpfs: > - /tmp:size=64m,mode=1777 > Most of modern linuxes already mount /tmp in memfs. But in order to place those files there they have to be at least in a separate directory (or to be able to define their location in config). Right now i can only move them to memfs via hackery by creating symlinks in a startup script and that constantly breaks cause symlinks get overwritten. <!-- github-comment-id:5390938086 -->
Author
Owner

I'd like to see an option for this, too. Not just the RRD files, but also the raw packets that currently get stored in the sqllite database. Keep adverts, because that's how the node database is maintained. But no other packet types need persistence. Any mesh analysis will be done via cloud analyzers like CoreScope/Beacon/etc, not in openHop itself, since it doesn't see the mesh at large.

So as @a1j points out, there is some data that does need persistence, and other data that does not. Currently, openHop does not provide a way to split these things out such that the non-persistence items can live in tmpfs/zram.

I'd like to see an option for this, too. Not just the RRD files, but also the raw packets that currently get stored in the sqllite database. Keep adverts, because that's how the node database is maintained. But no other packet types need persistence. Any mesh analysis will be done via cloud analyzers like CoreScope/Beacon/etc, not in openHop itself, since it doesn't see the mesh at large. So as @a1j points out, there is some data that does need persistence, and other data that does not. Currently, openHop does not provide a way to split these things out such that the non-persistence items can live in tmpfs/zram. <!-- github-comment-id:5485723673 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/pyMC_Repeater#74