ReadyNAS RN102 constant activity remedy

My Netgear ReadyNAS RN102 keeps constantly writing to a file /var/readynasd
I don’t want to hold my breath waiting for Netgear to fix this so I took matters into my own hands and implemented a TMPFS fix for my NAS.
What it does is mount /var/readynasd as a tmpfs of 2MB, and copy files to here from /etc/readynas-db on every boot, and copy back every hour, and on shutdown.

Setup instructions

1
2
3
systemctl stop readynasd
mkdir /etc/readynasd-db
cp -a /var/readynasd /etc/readynasd-db/

Edit /lib/systemd/system/tmpdb.service:

1
2
3
4
5
6
7
8
9
10
11
12
[Unit]
Description=Mount RAMFS for SQLITE DB file
Before=readynasd.service

[Service]
Type=oneshot
ExecStart=/bin/sh -c "mount -t tmpfs -o size=2m tmpfs /var/readynasd && cp -a /etc/readynasd-db/readynasd /var/"
#ExecStop=/bin/sh -c "cp -a /var/readynasd /etc/readynasd-db/" # TODO not working
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Edit /etc/cron.daily/tmpdb-sync

1
2
#!/bin/bash
cp -a /var/readynasd /etc/readynasd-db/

Now finish up:

1
2
3
chmod +x /etc/cron.daily/tmpdb-sync
systemctl enable tmpdb
reboot