Unable to update due to low disk space

I recently got a message that an update could not continue because there was low disk space:

osmc@osmc:/var/log$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 991M 0 991M 0% /dev
tmpfs 995M 1.3M 993M 1% /run
/dev/vero-nand/root 14G 13G 290M 98% /

Indeed it looks like there is… is there a guide as to what is safe to delete on here?

Something like ncdu can maybe help you find the stuff you can delete

sudo apt-get update
sudo apt-get install ncdu
sudo ncdu -x /

That should help you drill down and see where the bulk of your space is being used.

No guidance really exists as it really depends what you’ve done with your system, you probably only want to touch things inside the home directory though

Ah I see now…
osmc@osmc:~/.kodi/userdata$ sudo du -h --max-depth=1 .
20K ./peripheral_data
16K ./playlists
4.7M ./addon_data
4.0K ./library
70M ./Database
4.0K ./Savestates
11G ./Thumbnails
4.0K ./keymaps
11G .

Seems like I have ‘too much’ media? Or is it possible to have stale thumbnail data? Any way to expand it?

Yes, old Thumbnails will not be deleted. Just remove the Thumbnails they will be recreated next time you access the files.

In case anyone else runs into this, I executed the following commands:
sudo systemctl stop mediacenter
rm -r ~/.kodi/userdata/Thumbnails
sudo systemctl start mediacenter

This of course causes kodi to start re-caching the thumbs as you ‘browse’ among them (which is prone to crash it) so it’s a bit of a pain… I’m sure there’s a way to remote-mount a volume to use for the Thumbnails but I don’t currently have the patience to dig into that.

You can use path substitution to use a remote volume for thumbnails, but it can slow things down since Kodi has to reach across your network for every single image it displays. And the thumbnail folder and texture cache will continue to grow anyway.

There is a tool that will trim out the used stuff from those folders. I run it once a month on a cron job, and my Thumbnails folder usually sits somewhere between 500mb and 1gb. I don’t have a huge library though, so your mileage may vary. If you watch and delete a bunch of stuff, this will definitely help get rid of stuff you don’t need in the thumbnails folder.

Here’s the utility:

You can just run it manually what you want, but if you want to run it automatically, download cron from the OSMC store and then from the command line do:

crontab -e

and add this line:

00 02 1 * * /home/osmc/Scripts/texturecache.py/texturecache.py P > /dev/null 2>&1

That will run the cleaning the first day of every month at 2am.

The only caution I will make is that the utility isn’t being maintained anymore, but I’ve been using it over multiple versions of Kodi, and it continues to work. I think as long as the Kodi JSON calls don’t change it’ll keep working.

If your crashing just by caching thumbs then that would indicate a problem somewhere as that is not normal or expected behavior. I agree with pkscout that the texture cache maintenance utility is good, but I think most casual users could find just deleting the Thumbnails folder an easier task. It usually only becomes an issue when you have changed around your sources leaving stale artwork in the cache, or with some plug-ins that cache online content. There is a add-on in Kodi’s repository called “video database cleaner” that can take care of the latter without having to go to the terminal.

As for relocating the folder I think I cover it pretty well in my howto…