OH2 - saving SD Card Writes

, ,

My migration of persistence to the NAS (mariaDB went well - see also How to transfer MySQL (JDBC) persistence to your NAS)

Unfortunately I did not succeed with the transfer of the logs.
This is what I did:
Created a user on my NAS (openhab)
Created a shared NFS folder – e.g. openhab
Created a folder (mount point): sudo mkdir -p /mnt/nfs/var
I created within openhab on the NAS: log/openhab2
Mounted the share: sudo mount -t nfs -o soft 192.168.178.39:/volume1/openhab/var /mnt/nfs/var/
Checked whether it works with write access: touch /mnt/nfs/var/test
Enabled rpcbind during boot: sudo update-rc.d rpcbind enable
Added to fstab: 192.168.178.39:/volume1/openhab/var /mnt/nfs/var nfs rw 0 0
Moved the logs to the mounted folder: sudo mv /var/log /mnt/nfs/var/
Created a symbolic link: sudo ln -s /mnt/nfs/var/log /var/log

Unfortunately my RPi was not accessible anymore after reboot through ssh.
I know that it might cause problems moving the logs during runtime, but I guess the files will only be messed up!?
Any suggestion?