Page 1 of 1

ramdisk problem after upgrade to 2020.1

Posted: Monday 23 March 2020 20:20
by insectteam
Hello everyone!

Until now, I used ramdisk ( ramdrive)to protect the SD card from quick damage. Today after upgrading to the stable version 4.2020 domoticz started with an "empty" database (luckily I had a backup). Provided to restore the backup but it did not help clean installation of Domoticz and it worked 😄 ... but the joy did not last too long because editing the domoticz.sh file to start the ramdisk again, restart the system and again the lack of database and domoticz says that there is an update available though I just installed it (before trying to make ramdisk)

Here is a great request and question - how to start ramdisk in the new version (4.2020) or how to protect the SD card against a quick "death" due to a large number of records ??? Unfortunately, Rpi is so built-up that I have no space for an SSD drive and I have to do everything on SD.

I forgot to add that I have this situation both on RPi 4 and RPi2 so I know it is not a matter of chance ... in both after a clean installation of Domoticz and restoring the database everything works - adding in /etc/init.d/domoticz.sh :
DAEMON_ARGS = "$ DAEMON_ARGS -log /tmp/log/domoticz.log -loglevel normal"

and

ln -sf /tmp/log/domoticz.db-shm / home / pi / domoticz
ln -sf /tmp/log/domoticz.db-wal / home / pi / domoticz

it breaks everything

Thank you in advance for your help
Daniel

Re: ramdisk problem after upgrade to 4.2020

Posted: Tuesday 24 March 2020 15:05
by Logread
It seems that recent versions of domoticz no longer allow these symbolic links due to updated sqlite version. Unfortunate but this is it.

Re: ramdisk problem after upgrade to 4.2020

Posted: Tuesday 24 March 2020 22:25
by insectteam
... then is there any effective method to protect the SD card from damage? Until now, ramdisk gave me a sense of security - previously I changed cards every 3-6 months

Re: ramdisk problem after upgrade to 4.2020

Posted: Wednesday 25 March 2020 14:30
by jake
Wow, that's a bummer. We can't use a ram drive for extensive logging anymore? That would be a severe degradation of our setup. I quickly read the changes and I didn't see this one being mentioned.

Re: ramdisk problem after upgrade to 4.2020

Posted: Wednesday 25 March 2020 14:38
by waaren
jake wrote: ↑Wednesday 25 March 2020 14:30 Wow, that's a bummer. We can't use a ram drive for extensive logging anymore? That would be a severe degradation of our setup. I quickly read the changes and I didn't see this one being mentioned.
You can stil use ram drive but you cannot use symbolic links for sqlite database write ahead log and shared memory files (extension db-wal and db-shm )

Re: ramdisk problem after upgrade to 4.2020

Posted: Thursday 26 March 2020 0:52
by piotrm
Is there any other way to save both files (db-wal and db-shm) to RAM in the new Domoticz version?

Re: ramdisk problem after upgrade to 2020.1

Posted: Thursday 23 April 2020 1:27
by wifiminime
Hi,

Is there already a solution to somehow move domoticz.db-shm and domoticz.db-wal to a ramdrive?
Or is this definitely a no go?? It seems that there is no solution to prevent SD card damage due to these files...

Re: ramdisk problem after upgrade to 2020.1

Posted: Thursday 23 April 2020 8:16
by jake
In another topic about this problem it is described that having the file in RAM has the possibility that the database will be corrupted during a power outage, because not all data is than written to the .db itself.
For myself, I would be happy to see the RAM-disk as an option/parameter within Domoticz and decide for myself to take the risk. Thinking about it, it must always have been an option, because I used to have no RAM-disk before and enabled both the RAM-disk and changed the option to enable the log file and to move it to the RAM-disk, including the write ahead of the database.

Re: ramdisk problem after upgrade to 2020.1

Posted: Thursday 04 June 2020 22:09
by zaadstra
I'm very interested too! Just wasted a lot of time by a broken SD card.

Would it be an option to use the lower database version again? The suggestion to control it from Domotics is also clever as the domoticz.sh always 'forgets' ramdisk settings at upgrades.