Category5.TV Community Forum
PlexPi library location - Printable Version

+- Category5.TV Community Forum (https://forum.category5.tv)
+-- Forum: PlexPi - Plex Media Server for Raspberry Pi 3 (https://forum.category5.tv/forum-45.html)
+--- Forum: Development (https://forum.category5.tv/forum-46.html)
+--- Thread: PlexPi library location (/thread-193.html)



PlexPi library location - Peter C - 04-03-2018

I am a recently retired software developer and one of my retirement projects was to put together some sort of media server that I can use here in UK and copy it lock, stock and barrel to my holiday home in Spain.  To this end, I have a couple of WD My Cloud NAS drives and use Siber's GoodSync to keep the one in Spain a carbon copy of the one in the UK.  I was simply creating .mp4 files, enabling DLNA server on the NAS drive and watching the media via a Panasonic TV or an app on an Amazon FireTV stick (VLC, I think).  All going OK until I bought a new LG OLED Smart TV for home, which won't play most of the .mp4 files.  Searching the net pointed me towards PLEX and I have been playing with it (on a Windows PC) for the last couple of weeks and I am gobsmacked - it's staggeringly good!   I don't want to run Plex off my PC (and I don't have a PC in Spain anyway) so thought I'd try and run it on a Raspberry Pi instead which, after a few fruitless attempts, is when I found PlexPi - whcih is also staggeringly good - it makes it all so simple!   Well done so far!

Having sussed out how to connect my PlexPi to my NAS drive (and enabling Network at Boot) everything seems to be running pretty well but there's one thing I'd like to be able to amend - the location of the Plex Media Server database.  My thinking is that  rather than having it locally on the SD card, I can put it on the much bigger capacity NAS drive and then carbon copy it to Spain (and back it up easily).   On the Windows PMS it is possible for the user to set the location of the PMS database but it appears the option is not available in the Linux version.  I gather that I can change this (the LocalAppDataPath variable?) manually  in the Preferences.xml file but I can't find the file on my PlexPi!  I am not sure if this is down to you hiding it or down to my very basic knowledge of Linux?   What would you advise? 

And keep up the good work, you're doing a great job!

Moderator Note: Moved post to its own thread.


RE: PlexPi library location - Robbie Ferguson - 04-04-2018

Hi Peter C.

First, thanks for the kind words. I'm glad you are enjoying what I've done so far with PlexPi!

What you request is planned for in a coming release, and I hope to make it very easy to do. As a Linux guy, I could easily achieve what you're requesting, but as you profess to be pretty new to Linux, well, it's gonna take some getting your head around it, I think.

Basically, a folder in Linux can be a folder, a symlink, or a mount point.

So the folder /home/pi/Library (your library) is currently a folder... stored on the SD card.

You could turn off Plex (sudo systemctl stop plexmediaserver) and then move the content of /home/pi/Library somewhere else like an external drive or NAS share, run chattr +i /home/pi/Library/ (to make it unwriteable unless mounted) and then mount that drive or NAS share onto /home/pi/Library (thereby turning the folder into a mountpoint) and make sure it mounts automatically at every boot. Once you have it mounted, you can then turn Plex back on (sudo systemctl start plexmediaserver) and cross your fingers. :D

Be prepared to break stuff! It's all part of learning and tinkering. But know the feature is planned for a future release of PlexPi. Obviously I want to work on moving things away from the SD card as much as possible.  :)

Have fun!


RE: PlexPi library location - thunder2k - 04-04-2018

Hi Robbie, does moving the library on a NAS device also backs up the watched/unwatched status? If that's the case, I'm going to try this so for my future flashes as new plexpi versions come along I only need to point plex to the right location as you explained.

Am I correct?

Thanks

Bye!


RE: PlexPi library location - Robbie Ferguson - 04-04-2018

Yeah, that's right thunder2k. But since it is something I will be integrating I'd rather encourage folks wait for the feature than begin making big changes to their PlexPi (which would prevent you from being able to upgrade).

But short answer, yes. /home/pi/Library/Application Support/Plex Media Server/Plug-in Support/Databases/

Cheers,
Robbie


RE: PlexPi library location - thunder2k - 04-05-2018

Hi Robbie,
I was trying to move my library to my nas to back it up.

I run

Code:
sudo mv /home/pi/Library /mnt/usb1TB/Plex/



After a while, I got a lot of this errors:

mv: cannot create symbolic link '/mnt/usb1TB/Plex/Library/Application Support/Plex Media Server/Media/localhost/f/3978b13fe885719e1220db0c5fda3ec88efb32a.bundle/Contents/Subtitles/it/com.plexapp.agents.opensubtitles_00a9cd46bf4170251d4d89b87c0768c348e795a0.srt': Operation not supported

My NAS is NTFS and I have enabled the agents to automatically download the subtitles.

Do you foresee any issues?

Thanks

Bye


RE: PlexPi library location - Robbie Ferguson - 04-05-2018

Yeah, you can't move your Library folder to an NTFS volume. NTFS does not support Linux permissions or symlinks.


RE: PlexPi library location - thunder2k - 04-05-2018

Oops :)

I can't do it even if I'm going to mount it on boot changing fstab?

If that's not possible, how can I undo it?


RE: PlexPi library location - Robbie Ferguson - 04-05-2018

No, NTFS is a Windows formatted drive, not Linux. Windows does not support Linux features.

You could re-format the drive as EXT3 (for example) which would then allow it, but then you won't be able to read the drive in Windows.

To undo, you'd have to try copying it back... but no guarantees.

You should probably be using rsync, not mv. Or at the very least, cp -R.


RE: PlexPi library location - thunder2k - 04-05-2018

It's still copying :D

I'll try to copy it back later, or get the folder from a backup img I did yesterday.

What I'm not getting is, how can the folder copied on the NTFS drive be bigger than the whole Pi SD card?

EDIT: I don't know what happened, but it finished moving but the folders were still there in /home/pi/Library

Nothing broken then   :blush: