Host path for mapping external drive? (Plex docker)


Recommended Posts

Hi.  What's the host path if I'm trying to get the Plex docker to access my media on another server?  I thought with SMB enabled I'd just be able to navigate through Plex to add libraries anywhere on my network but so far I can't get it to show me anything but local drives.  Thanks.

Link to comment

These are the commands I used to create & map a local share to a remote share on a different unRaid box. Yours may need adjustment depending on what your other server is running.

 

mkdir /mnt/[localShareName]
mount -t cifs //[netbios-servername]/[sharename] /mnt/[localShareName] -o username=root@[netbios-servername],password=[remote-tower-root-password],iocharset=utf8,file_mode=0777,dir_mode=0777

Link to comment

These are the commands I used to create & map a local share to a remote share on a different unRaid box. Yours may need adjustment depending on what your other server is running.

 

mkdir /mnt/[localShareName]
mount -t cifs //[netbios-servername]/[sharename] /mnt/[localShareName] -o username=root@[netbios-servername],password=[remote-tower-root-password],iocharset=utf8,file_mode=0777,dir_mode=0777

 

Thanks.  Unfortunately I'm having no luck with this so far.  I don't have a root password set up on my other unraid server so do I just leave off the whole last half of the command line starting w/"username=root..." or what do I write in for password to indicate that there isn't one? Everything I'm trying so far just returns "The command failed... volume paths must be absolute".

 

If it's not obvious I'm still a total linux noob and this is my worry with anything command line.  If I can't find documentation that tells me exactly what to write in then I never figure it out.

Link to comment

These are the commands I used to create & map a local share to a remote share on a different unRaid box. Yours may need adjustment depending on what your other server is running.

 

mkdir /mnt/[localShareName]
mount -t cifs //[netbios-servername]/[sharename] /mnt/[localShareName] -o username=root@[netbios-servername],password=[remote-tower-root-password],iocharset=utf8,file_mode=0777,dir_mode=0777

 

Thanks.  Unfortunately I'm having no luck with this so far.  I don't have a root password set up on my other unraid server so do I just leave off the whole last half of the command line starting w/"username=root..." or what do I write in for password to indicate that there isn't one? Everything I'm trying so far just returns "The command failed... volume paths must be absolute".

 

If it's not obvious I'm still a total linux noob and this is my worry with anything command line.  If I can't find documentation that tells me exactly what to write in then I never figure it out.

Tonight, I'll post up a copy of my "go" file (at work right now).  I do the exact same thing which you are trying to accomplish.

 

It has the same mounts, but also a little section to wait for the network to be up and running before loading emhttp so that the mount points are available to the docker container.

Link to comment

Ok, here it is.  If you add this to your /boot/config/go file before the line that says /usr/local/sbin/emhttp &, then the system will automatically wait for the network to come alive and then mount your network shares prior to starting the dockers.  Use Notepad++ to modify the file

 

My experience with Plex has been that if the host paths you pass to it (network shares) do not exist, then plex will not start (and in my case, without waiting for the network to come alive, the containers begin to load before the mounts are made.  Waiting for the network solves all of that.)

# Wait ~ 90 seconds for network to come alive before proceeding

logger "Waiting for network services to come alive ~90 seconds"
echo "Waiting for network services to come alive ~90 seconds"

for COUNTER in {1..90}
do
        sleep 1

        if ping -c 1 192.168.1.62 > /dev/null 2>&1
        then
                break
        else
                echo "Server_B not available yet... Retry # $COUNTER"
                logger "Server_B not available yet... Retrying # $COUNTER"
        fi
done

# Mount the shares if the network is active

if ping -c 1 192.168.1.62 > /dev/null 2>&1
then
        logger "Network active - mounting shares from SERVER_B"
        echo "Network active - mounting shares from SERVER_B"

        mkdir /mnt/server_b_movies
        mkdir /mnt/server_b_television
        mkdir /mnt/server_b_books

# Mount the shares

        mount -t cifs //192.168.1.62/Movies /mnt/server_b_movies -o username=server_a,password=srv020,dir_mode=0777,file_mode=0777
        mount -t cifs //192.168.1.62/Television /mnt/server_b_television -o username=server_a,password=srv020,dir_mode=0777,file_mode=0777
        mount -t cifs //192.168.1.62/Ebooks /mnt/server_b_books -o username=server_a,password=srv020,dir_mode=0777,file_mode=0777

else
        logger "Network not active - SERVER_B shares will not be mounted"
        echo "Network not active - SERVER_B shares will not be mounted"
fi

 

You will need to make a user on your other server (in my case I called him server_a).  Then you'll pass through container mounts of something like /Server_B_Movies with a host volume path of /mnt/server_b_movies

Link to comment

You will need to make a user on your other server (in my case I called him server_a).  Then you'll pass through container mounts of something like /Server_B_Movies with a host volume path of /mnt/server_b_movies

 

Thanks Squid.  Really appreciate your help on this.  Question though:  is there a way to do this without creating new users and passwords?  For mount commands like the one below could I use root and then what would I write in for password to indicate that there is none? 

 

mount -t cifs //192.168.1.62/Movies /mnt/server_b_movies -o username=server_a,password=srv020,dir_mode=0777,file_mode=0777

Link to comment

You will need to make a user on your other server (in my case I called him server_a).  Then you'll pass through container mounts of something like /Server_B_Movies with a host volume path of /mnt/server_b_movies

 

Thanks Squid.  Really appreciate your help on this.  Question though:  is there a way to do this without creating new users and passwords?  For mount commands like the one below could I use root and then what would I write in for password to indicate that there is none? 

 

mount -t cifs //192.168.1.62/Movies /mnt/server_b_movies -o username=server_a,password=srv020,dir_mode=0777,file_mode=0777

user root does not have access to shares.  So, no

 

You can use an existing user however.  I guess you could also use public shares, and then it won't matter what username you put in there

Link to comment

Question though:  is there a way to do this without creating new users and passwords?  For mount commands like the one below could I use root and then what would I write in for password to indicate that there is none? 

 

mount -t cifs //192.168.1.62/Movies /mnt/server_b_movies -o username=server_a,password=srv020,dir_mode=0777,file_mode=0777

I have my Ubuntu VM create mounts to unRAID public shares without the need for a user.  This is the appropriate entry in fstab that has worked very consistently for me (after many different iterations):

 

//titan.saturn.lan/TV		/mnt/user/TV	cifs	noauto,guest,noperm,uid=nobody,gid=users	0	0

Then manually run my mounts via rc.local (since it was having trouble with auto mounting/network timing).  Truth be told, I'm not entirely sure how this translates into the mount command, but since mount really calls fstab, I think throwing in "guest" instead of "username=whatever" would do the trick.

Link to comment

user root does not have access to shares.  So, no

 

You can use an existing user however.  I guess you could also use public shares, and then it won't matter what username you put in there

 

Right, public shares.  That's what I'm talking about.  If I'm trying to map a public share do I just use the first part of the command below and leave off the rest (starting with username)?  (Using my own server B's IP address and name of course). 

 

mount -t cifs //192.168.1.62/Movies /mnt/server_b_movies -o username=server_a,password=srv020,dir_mode=0777,file_mode=0777

Link to comment

Okay, making some progress but still don't have this working yet.  I was able to add Squid's code to my go file and that mounted the server_movies folder that I was able to select in the host path (container volume = /movies; host path = /mnt/server_movies/).  Then when I go into the Plex UI to add that movies folder I do see it there but selecting it doesn't do anything.  I get a split second flash of the loading (circular arrow) icon but then nothing, and adding it to the library anyway immediately returns "Library scan complete: extra information may still be downloading" while the top of the screen says "The Library has no content yet. Click here to add".  So my guess is that I didn't actually mount the share from the other server.  Per PCRx's post, I tried that line in the go file this way:

 

mount -t cifs //192.168.1.xx/Movie Server /mnt/server_movies -o username=nobody,password="",dir_mode=0777,file_mode=0777

 

Anyone have another guess of how this part can be written for a public share, or what else I might have done wrong?  If there are no other suggestions I guess I'll just create a username and password after all.  Just seems annoying to have to if I only want to work with public shares.

Link to comment

Okay, making some progress but still don't have this working yet.  I was able to add Squid's code to my go file and that mounted the server_movies folder that I was able to select in the host path (container volume = /movies; host path = /mnt/server_movies/).  Then when I go into the Plex UI to add that movies folder I do see it there but selecting it doesn't do anything.  I get a split second flash of the loading (circular arrow) icon but then nothing, and adding it to the library anyway immediately returns "Library scan complete: extra information may still be downloading" while the top of the screen says "The Library has no content yet. Click here to add".  So my guess is that I didn't actually mount the share from the other server.  Per PCRx's post, I tried that line in the go file this way:

 

mount -t cifs //192.168.1.xx/Movie Server /mnt/server_movies -o username=nobody,password="",dir_mode=0777,file_mode=0777

 

Anyone have another guess of how this part can be written for a public share, or what else I might have done wrong?  If there are no other suggestions I guess I'll just create a username and password after all.  Just seems annoying to have to if I only want to work with public shares.

You can try my earlier suggestion using 'guest' instead of a user and password.  Not sure if it will work, but worth a shot.  Ensure your shares are exported publicly.

 

mount -t cifs //192.168.1.xx/Movie Server /mnt/server_movies -o guest,dir_mode=0777,file_mode=0777

 

Or this:

 

mount -t cifs //192.168.1.xx/Movie Server /mnt/server_movies -o guest,noperm,uid=nobody,gid=users

 

And, obviously, ensure the IP address is correct.

 

Good luck!

Link to comment

 

mount -t cifs //192.168.1.xx/Movie Server /mnt/server_movies -o username=nobody,password="",dir_mode=0777,file_mode=0777

If there's a space in there (Movie Server) not MovieServer, then you'll either need to do //192.168.1.xx/Movie\ Server or "196.168.1.xx/Movie Server"
Link to comment

If there's a space in there (Movie Server) not MovieServer, then you'll either need to do //192.168.1.xx/Movie\ Server or "196.168.1.xx/Movie Server"

 

That is a good catch, Squid.  There is a space and I didn't realize I'd need to write it any differently because of that.  I'll try it your way tonight and see if that fixes it.  Thanks again!

Link to comment

You can try my earlier suggestion using 'guest' instead of a user and password.  Not sure if it will work, but worth a shot.  Ensure your shares are exported publicly.

 

mount -t cifs //192.168.1.xx/Movie Server /mnt/server_movies -o guest,dir_mode=0777,file_mode=0777

 

Or this:

 

mount -t cifs //192.168.1.xx/Movie Server /mnt/server_movies -o guest,noperm,uid=nobody,gid=users

 

And, obviously, ensure the IP address is correct.

 

Good luck!

 

Thanks kaiguy.  I somehow your earlier post but I'll give this a shot if Squid's edit doesn't fix it.

 

BTW, I'm looking to run an Ubuntu vm as well.  I know it's off topic to this thread but are you using Xen or KVM and what did you follow for install instructions?

Link to comment

 

Thanks kaiguy.  I somehow your earlier post but I'll give this a shot if Squid's edit doesn't fix it.

 

BTW, I'm looking to run an Ubuntu vm as well.  I know it's off topic to this thread but are you using Xen or KVM and what did you follow for install instructions?

I'm running under ESXi, so I can't be of much help to you on that front--sorry.

Link to comment

You can try my earlier suggestion using 'guest' instead of a user and password.  Not sure if it will work, but worth a shot.  Ensure your shares are exported publicly.

 

mount -t cifs //192.168.1.xx/Movie Server /mnt/server_movies -o guest,dir_mode=0777,file_mode=0777

 

Or this:

 

mount -t cifs //192.168.1.xx/Movie Server /mnt/server_movies -o guest,noperm,uid=nobody,gid=users

 

And, obviously, ensure the IP address is correct.

 

Good luck!

 

Thanks kaiguy.  I somehow your earlier post but I'll give this a shot if Squid's edit doesn't fix it.

 

BTW, I'm looking to run an Ubuntu vm as well.  I know it's off topic to this thread but are you using Xen or KVM and what did you follow for install instructions?

Don't think I ever mentioned it, but since we are modifying the GO file, you do need to reset the server for the changes to take effect.
Link to comment

Okay, that did the trick.  Thanks Squid and everyone else here for your help on this.  Just one last cleanup item:  at some point messing around with this I wound up creating 2 different /config volumes:  cache/plexmediaserver and cache/appdata/plexmediaserver.  How do I delete the latter?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.