RPI Networkboot OR just move log files

Hi as a frequent reader of this community you will know that I recently migrated from windows to Linux radpbian stretch on a pi 3b. From wath I understand theres hi probability to blow the sd card in a while. So which way to go at this roadcross shoulf I try to go for network os on nas ot my ububtu 18 with nfs share. I tried yhe later for a couple of days but always get stuck somewhere. I found a tutorial for this who seemd really easy just use rsync to syncronize sd card and network storage then edit command.txt and edit so you ask host for access. But I seem to have problem with my ownership and or premissions for instance can’t access root folder ln the share either local or from client who actually created the folders. Any ideas if someone got it working or know that the chase is better than the catch.

Have a nice one

not if you use a stable power supply to the rPi
Most file system corruption cases are due to that.
I use a UPS and the “official” rPi PSU and I have been running OH2 on rPi3 almost 2 years without any problems.

Maybe it’s like that I have a highend psu but still thought it might be a goog idea to have less writes to sd card. But i found somewhere that logfile is set by a variable logdir but i don’t know where it sets. And I don’t know if there is alot of triäoble to set up rpi for nfs filesystem. I tried to follow some instructilns but somewhat i fsiled 3 times now.

Hi,

Agree with what has been posted already a good power supply and a suitable branded SD card are the key, you can also reduce IO to the SD by doing some or all of the following, Ive been using the same SD for ages now based on the below.

Switch system logging to busybox-syslogd; logs in memory rather than to SD, has pros and cons but I don’t generally care about having persistent system logs between reboots, you can redirect the output to a file if you so wish for capturing errors/issues.

Move some of the openhab file system to tmpfs which means things like openhab logs will be in memory rather than writes to SD, again has pros and cons as tmpfs isnt’ persistent across reboots, the cache and tmp folders can be set to use this as well and so far with no side affects that I can see.

The sizing below works for me but depending on how much logging you have and bindings you install you may need to adjust, for the log directory I also have a cron job which removes older log files, only really needed if you don’t reboot the pi often as the logs can fill 50mb over a period of time.

tmpfs   /var/log/openhab2       tmpfs   nodev,nosuid,size=50M,mode=1777 0 0
tmpfs   /var/lib/openhab2/tmp   tmpfs   nodev,nosuid,size=25M,mode=1755,uid=500,gid=500 0 0
tmpfs   /var/lib/openhab2/cache tmpfs   nodev,nosuid,size=150M,mode=1755,uid=500,gid=500 0 0

Kevin