I am setting up my GX device (Raspberry Pi2 with Venus OS 2.87) and I am curious to understand how does this device handle logging and the constant and frequent write operations to the file system, t.e. to the micro SD memory card. I had bad experience with embedded systems running frequent or/and intense write operations like logging on flash memories and I have always tried to move as much as I can to tmpfs.
For what I see, services work files seems to be kept running in tmfs, however the system logging is written to /var/log which is mounted under /data (separate partition of the media).
Since I am new to venusos, is it possible to move the logging entirely to tmpfs and whether this will be ok with the venusos daemon mechanisms like dbus, etc, which I am still not familiar with?
Probably a script as a service like log2ram can be implemented for this? It uses systemd, but I believe this can be easily integrated to venusos.
I hope that someone else (like @Kevin Windrem with his super useful modifications scripts) will get interested in this.
[root@raspberrypi2:~]# cat /proc/mounts /dev/root / ext4 rw,relatime 0 0 devtmpfs /dev devtmpfs rw,relatime,size=469540k,nr_inodes=117385,mode=755 0 0 proc /proc proc rw,relatime 0 0 sysfs /sys sysfs rw,relatime 0 0 debugfs /sys/kernel/debug debugfs rw,relatime 0 0 configfs /sys/kernel/config configfs rw,relatime 0 0 tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0 tmpfs /var/volatile tmpfs rw,relatime 0 0 /dev/mmcblk0p1 /u-boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro 0 0 /dev/mmcblk0p4 /data ext4 rw,noatime 0 0 devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0 overlay /service overlay rw,relatime,lowerdir=/opt/victronenergy/service,upperdir=/run/overlays/service,workdir=/run/overlays/work/service 0 0 [root@raspberrypi2:~]# ll /run/overlays/service/gui/log/supervise/ drwx------ 2 root root 120 Jul 2 12:53 ./ drwxr-xr-x 3 root root 60 Jul 2 12:53 ../ prw------- 1 root root 0 Jul 2 12:53 control| -rw------- 1 root root 0 Jul 2 12:53 lock prw------- 1 root root 0 Jul 2 12:53 ok| -rw-r--r-- 1 root root 18 Jul 2 12:53 status [root@raspberrypi2:~]# ll /var/ drwxr-xr-x 9 root root 1.0K May 31 13:40 ./ drwxr-xr-x 21 root root 1.0K Jul 2 07:57 ../ drwxr-xr-x 2 root root 1.0K May 31 13:32 backups/ drwxr-xr-x 4 root root 1.0K May 31 13:40 cache/ drwxr-xr-x 7 root root 1.0K May 31 13:39 lib/ drwxr-xr-x 2 root root 1.0K May 31 13:32 local/ lrwxrwxrwx 1 root root 9 May 31 13:40 lock -> /run/lock/ lrwxrwxrwx 1 root root 9 May 31 13:32 log -> /data/log/ lrwxrwxrwx 1 root root 4 May 31 13:40 run -> /run/ drwxr-xr-x 4 root root 1.0K May 31 13:39 spool/ lrwxrwxrwx 1 root root 17 May 31 13:40 tmp -> /var/volatile/tmp/ drwxrwxrwt 5 root root 100 Jul 2 12:53 volatile/ drwxr-xr-x 4 root root 1.0K May 31 13:39 www/ [root@raspberrypi2:~]# ll /data/log/ssh-tunnel/ drwx------ 2 root root 4.0K Jan 1 1970 ./ drwxr-xr-x 28 root root 4.0K Jul 2 12:53 ../ -rwxr--r-- 1 root root 14.9K Jul 2 12:53 current* # -> this is the actual log for this service -rw------- 1 root root 0 Jan 1 1970 lock -rw-r--r-- 1 root root 0 Jan 1 1970 state