Move Kodi thumbnail cache to ram in Linux Lite to reduce ssd drive wear.
Hi folks;
Here is my issue, I have Kodi installed in single partition with Linux Lite running as main os in chromebox. As you all know, Kodi constantly writes thumbnail images to the solid state drive each time a user loads an addon and brings up the updated video list. That action causes the solid state drive to gradually wear out. So in order to prevent this from happening I'd like to move the Kodi thumbnail folder to ram in Ubuntu.
In the process of finding a possible solution this problem I found the follwing in the Kodi tv forum :
Create the script below as /etc/init.d/thumbnails
#!/bin/sh
case "$1" in
start)
rsync -a /home/xbmc/.xbmc/userdata/Thumbnails.disk/ /dev/shm/Thumbnails/
;;
stop)
rsync -a /dev/shm/Thumbnails/ /home/xbmc/.xbmc/userdata/Thumbnails.disk/
;;
esac
Make it executable:
chmod +x /etc/init.d/thumbnails
Create the init.d links:
sudo update-rc.d thumbnails defaults
Go to your XBMC Userdata folder:
cd ~/.xbmc/userdata
Rename the Thumbnails folder:
mv Thumbnails Thumbnails.disk
Create a Thumbnails link to /dev/shm:
ln -s /dev/shm/Thumbnails Thumbnail
This copies the Kodi cache to RAM when the system boots up, and copies it back to disk when the user shuts down his pc. This way, the cache doesn't have to be rebuilt every-time the user reboots his pc.
It sort of defeats the purpose because this copies Kodi's cache to disk upon shut down. So what else do you guys recommend I do ? Is the possible solution I found good for my situation ?
Last edited by Kevin Williams; 01-21-2016 at 03:35 AM.
|