[Howto] Move Thumbnails to free up space


#1

Hey!
Recently my OSMC installation crashed. Turns out the issue was that I ran out of space on my SD-card. The reasons were numerous (cache files, tmp files, an old src folder) but the single largest culprit? Thumbnails!
My Kodi thumbnails folder was 1.2 gb which is a bit on the hefty side…

The solution for me was to move the folder off my SD card and somewhere more spacious…

Prerequisite: Have somewhere to move the thumbnails

You could use a thumb drive or usb hdd or do as I did and move it to a NAS.

If you want to use a NAS you need to mount it to the OSMC filesystem to be able to use symlinks properly.

This carries a lot of other benefits and if you’re storing your media on a NAS it might be a good idea to mount it to your file system and then point OSMC to that mount point instead of directly to the network drive.

You do this by editing your fstab file:

sudo vi /etc/fstab

And on a new line add

<NAS ip>:<directory of your NAS to mount> <directory to mount the NAS as>  nfs hard,sync,intr,rw,x-systemd.automount,noauto

Now you reboot your machine so that the changes take effect before we start

Copy the Thumbnails directory

sudo cp -a /home/osmc/.kodi/userdata/Thumbnails/. <USB drive or nas directory>/Thumbnails

Backup Thumbnails

You should this out before you take the plunge, so instead of removing the Thumbnails folder now you move it:

mv ~/nosejob/Other/OSMC/Thumbnails ~/nosejob/Other/OSMC/ThumbnailsBackup

Link the directories

Now you symbolically link the directories.

ln -s ~/nosejob/Other/OSMC/Thumbnails ~/.kodi/userdata/Thumbnails

This means that the Thumbnails directory in your user data directory will reflect whatever is present at the destination of the symlink, it IS NOT linked to that folder - i.e. if you move the directory on the NAS/USB your Thumbnails folder will appear empty, so if you want to move it you’d need to remove the link and make a new one.

Test it out

Reboot and then take it for a spin, browse around your tv-shows for example, do episode thumbs display properly - No lag? You can proceed to the next step. (If this laggy for you, just remove the symlink and move back the directory)

Free up that space

Before you free up that space, just for funsies run

df -h

To see how much space you have on your sd-card, now remove the backup folder and check again

sudo rm -R ~/nosejob/Other/OSMC/ThumbnailsBackup
df -h

###Enjoy that precious space!
Note: I’m using my NAS to store my thumbnails and haven’t noticed any lag at all :smiley:


#2

2 things

If you plan to share the cache with multiple Kodi clients you will need to copy …userdata\Database\textures*.db to the other installs

Texturecache.py which is available from the Kodi forum will clean your thumbnails folder and reduce its size significantly


#3

Thanks for the feedback!

Sharing the thumbnails folder wasn’t the intention here, if one wanted to share databases and such shouldn’t one use the mysql option for the database? Should the thumbnails folder really be shared between clients?

Texturecache is a great utility, especially when using low powered devices, one should note though that it should probably only be used to clean out unneeded images such as deleted tv shows etc.
In my opinion it should also be used to generate all missing images to optimise performance when browsing the library (as the images would already be present)


#4

Moved to howto section


#5

what the $@$@ is nosejob? i am trying to do this but …


#6

It’s OP’s example location.


#7

shouldn’t the symblink be like this?
We delete the thumbnail folder from ~/.kodi/userdata and then link the remote one there?

ln -s /media/Blue_NTFS/Raspberry_KODI_Main/Thumbnails ~/.kodi/userdata

because this makes a symblink folder named Thumbnails into the Thumbnails folder

ln -s ~/nosejob/Other/OSMC/Thumbnails ~/.kodi/userdata/Thumbnails

#8

No I think that command is correct, it’s what I used and I’m getting a correct symlink (you’re connecting those two locations i.e. going into ~/.kodi/userdata/Thumbnails will be the equivalent of going into ~/nosejob/Other/OSMC/Thumbnails, with your suggestion we would find ourselves inside the thumbnails folder as soon as we entered the user data folder)

Oh I can edit the op for clarity

EDIT
Nope I can’t since I’m not mod I can’t edit OPs in this subforum


#9

unfortunatelly the op code all it did for me was to create a thumbnail folder inside the thumbnail folder. As a result kodi was still using the sdcard to store thumbnails.

I am using the code i posted right now. I deleted the thubnail folder completly, then run the code and inside user data now i have a new thubnail folder. The new thubnail folder reflects the thubnail folder on the remote location. If i erase everything from inside the remote thumbnail folder and fire up kodi it starts populates the remote location folder.

?


#10

Have you tried using Milhouse’ texturecache.py before you spent time on this?


#11

you mean that i will spend less time in that?? O_o

Basically something like that should already be in kodi. something it does not need should not be there and not just be there and take space.

But i do not find that so easy to install or manage along the way.


#12

I guess you need to have a discussion with the Kodi people then. Nothing OSMC can do about this.


#13

? what? i said the solution you mentioned should already be in kodi. Why should i talk to kodi people? ? ? ?

So let me understand. we are talking about moving thumbnails folder, you come here tell about another solution, i tell you that it does need a lot more time/energy than just moving a folder and symblink it and you point me to the kodi people.

If you get the point please explain it to me.


#14

Dude, chill. People are trying to help you understand this stuff. Don’t be a dick. Oh and if you really have to be a dick, please be better at hiding it.

Here was the explanation for how the texture pack script goes hand in hand with this and how open source projects need user feedback not blatantly thrown out in a weird semi flame rant on another product’s forum but structured and provided to the devs. Deleted that, because I’d rather not help you.


#15

Did he try to say something helpful about the how to?

And really mate telling someone a dick makes you what exactly? Have I said something wrong to you?


#16

Agree with GnF, this doesn’t work. btw GnF version doesnt work too for me…
This link in not “openable”, can’t explore it and kodi too…

Another solution ?


#17

well as far as my way.

It does work for me but even if the symblink is on a usb hard disk i have some lag issues with thumbnails (thumbnails take a while to appear some times).
Still i am not sure what is the right way to symblink this, but this is what the forum is for and that is why we have a chit-chat about it.

The code from op creates a thumbnail folder into the original thumbnail folder and kodi keeps saving new thumbnails into the original folder instead of the remote.

@raspdealer, if i fould how, the proper way, to do it i will reply here mate.

Give a try to this (REMEMBER TO REPLACE THE /**media/Blue_NTFS/Raspberry_KODI_Main/** from the code with the path of your external whatever thing)
I am using a usb hard disk that is located into media and in it there is Blue_NTFS folder (the name of the drive basically) and into it a Raspberry_KODI_Main/ folder.
So do not copy paste it.

ln -s /media/Blue_NTFS/Raspberry_KODI_Main/Thumbnails  ~/.kodi/userdata

#18

Thanks, without the ~ before the NAS path, looks better.

EDIT : But Kodi doesn’t like it, reboot in loop


#19

Just to point out the obvious. The reason thumbnails are cached locally is for fast access.
Assuming you have a decent sdcard, then the default location will be significantly faster than a network share.

So before trying this I’d suggest using TextureCache to prune no longer used thumbnails and the consider getting a suitable sized sdcard (an 8G sdcard should handle pretty huge libraries).


#20

Following GnFs version I was able to move thumbnails to an external drive and can now actually have all the thumbnails for my libarary! thanks to both hsus and GnF!