/tmp to NAS

Log are always a problem but also a god send when you need them.

So I have installed ZRAM with the default config. So to save any confusion of where this config now is:

df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        15G  3.2G   11G  23% /
devtmpfs        484M     0  484M   0% /dev
tmpfs           488M     0  488M   0% /dev/shm
tmpfs           488M  6.6M  482M   2% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           488M     0  488M   0% /sys/fs/cgroup
overlay1        575M  2.7M  530M   1% /var/lib/openhab2
tmpfs           100M  248K  100M   1% /tmp
/dev/mmcblk0p1   42M   23M   19M  55% /boot
/dev/zram1      575M  2.7M  530M   1% /opt/zram/zram1
/dev/zram2      469M   18M  416M   5% /opt/zram/zram2
overlay2        469M   18M  416M   5% /var/log
tmpfs            98M     0   98M   0% /run/user/1000

/etc/fstab:

proc            /proc           proc    defaults          0       0
PARTUUID=529e9566-01  /boot           vfat    defaults          0       2
PARTUUID=529e9566-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
      tmpfs           /tmp        tmpfs   nosuid,nodev,size=100m        0       0
#     tmpfs           /var/log/openhab2        tmpfs   nosuid,nodev     0       0
#     tmpfs           /var/tmp        tmpfs   nosuid,nodev              0       0

/usr/share/openhab2          /srv/openhab2-sys           none bind 0 0
/etc/openhab2                /srv/openhab2-conf          none bind 0 0
/var/lib/openhab2            /srv/openhab2-userdata      none bind 0 0
/var/log/openhab2            /srv/openhab2-logs          none bind 0 0
/usr/share/openhab2/addons   /srv/openhab2-addons        none bind 0 0

/etc/ztab:

# swap  alg     mem_limit       disk_size       swap_priority   page-cluster    swappiness
swap    lz4     200M            600M            75              0               90

# dir   alg     mem_limit       disk_size       target_dir              bind_dir
dir     lz4     200M            600M            /var/lib/openhab2       /openhab2.bind

# log   alg     mem_limit       disk_size       target_dir              bind_dir                oldlog_dir
log     lzo     150M            500M            /var/log                /log.bind

PLEASE NOTE THIS IS NOT ME SAYING THIS IS RIGHT.

It didn’t ring a bell right away but now I know why I was irritated … just checked, latest Raspbian/openHABian does not mount /tmp at all.
There’s not much writing to /tmp really so no big time reason to make that a ramfs/tmpfs/zram/whatever.

Did you actually install that manually or why is it 100MB on your system ?
So if you simply unmount that you will have all the space of /

On ZRAM, there’s an upcoming change to replace

dir     lz4     200M            600M            /var/lib/openhab2       /openhab2.bind

by

dir     lz4     150M            500M            /var/lib/openhab2/persistence   /persistence.bind

… you can edit that manually, reboot to activate.

You can also expriment with adding a ztab line for /tmp if you want.

The /tmp was on the guide I followed 2 years ago. To be honest I can’t remember what tmp had lots of writes as in /var/tmp /tmp which is why I implemented it. I had blue tooth scanning on and it was smashing the SD Card back then hence putting a load into tmpfs.

The 100MB limit was something I put on today.