Mounting storage within previously mounted storage

Status
Not open for further replies.

NJMorf

Explorer
Joined
Aug 9, 2017
Messages
53
I've got my Plex server set up with mounted storage:

Jail: plexmediaserver_1
Source: /mnt/volume_1/Media
containing folders: Movies, TV Shows, ...
Destination: /media

I want to move some of the content to another volume, i.e.
Source: /mnt/volume_2/Media
containing folder: Movies

Once I've done that, will I be able to delete the Movies folder from volume_1 and then add the Movies folder from volume_2 as a source within the existing storage? That is, add storage as follows:

Jail: plexmediaserver_1
Source: /mnt/volume_2/Media/Movies
containing folders: movie1, movie2, etc.
Destination: /media/Movies

I tried this with a test folder but I think I went wrong somewhere, as I seemed to end up with just an ordinary folder at volume_1/Media/TestFolder - anything I copied into this folder was not visible in volume_2/Media/Movies, and vice versa. Is this because it's not possible (or is a bad idea) to mount one folder within a folder that is itself mounted from elsewhere?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I think we're not seeing some steps here (or maybe I just don't get the way you're explaining it).

Let's start by forgetting jails for a bit first.

You have 2 pools:

volume_1
volume_2

In those pools you have a Media dataset (both volumes have one).

volume_1
Media

volume_2
Media

It seems you also have a Movies folder in each of those datasets (with some extras on volume_1):

volume_1
Media
Movies
TV Shows
other stuff...

volume_2
Media
Movies

Or do you have Movies as datasets rather than folders? This may be something to do with the problems you are seeing in your test.

Ultimately, you want your plex jail to have this structure:

/media
Movies (from volume_2)
TV Shows (from volume_1)
other stuff... (from volume_1)

If I have that right so far, I can suggest 2 things:

Either use a symbolic link once you have the Movies in the volume_2 location:
cd /mnt/volume_1/Media
rm -R /mnt/volume_1/Media/Movies ... Careful, I'm assuming you've already got your data out of here before doing this one
ln -s /mnt/volume_2/Media/Movies Movies

With this method, you can keep the one storage mount you have already from volume_1.

Or:

Mount the folders the way you propose (but removing the Movies folder from volume_1)... perhaps some other forum experts can chime in on mounting folders and/or datasets within each other, but I have used it myself (always mounting the root of a dataset to the jail at the level I want it in the jail, never a subfolder).
 

NJMorf

Explorer
Joined
Aug 9, 2017
Messages
53
I played around while I was waiting and it seems to be working OK. For reference, volume_1/Media and volume_2/Media are both datasets. Every folder below Media is an ordinary folder. My structure is now:

volume_1/Media
TV_Shows
Movies-old (renamed from Movies)
...

volume_2/Media
Movies


In the Plex jail I have:
volume_1/Media mounted as /media
volume_2/Media/Movies mounted as /media/Movies.

I stopped the Plex server while renaming the folders and copying the files around, so as far as it's concerned nothing has changed. Everything seems to be working right now, although something's got a lock on one of the files in Movies-old, preventing me from deleting it. I might do your symlink trick instead, if I think my way's too kludgey, performing badly or just plain wrong - I like the idea of not having to have the extra mounts. Also, a side-effect of this method seems to be that it creates an empty Movies folder in volume_1/Media - I can see this folder when I access /Media via SMB. Not sure if symlinking would make the folder seem full again, but leaving that "empty" folder will just tempt me to delete it some time in the future, and I'm willing to bet that'd have consequences (like maybe deleting volume_2/Media/Movies?).
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
The empty target on volume_1 would be created automatically as the mountpoint. It shouldn't be dangerous to delete it as it would be in use while the jail has it mounted and the delete would fail (Test at your own peril).

The symlink would seem the same from all angles (in and out of the jail), but it may mess with free space calculations in some cases.
 

NJMorf

Explorer
Joined
Aug 9, 2017
Messages
53
A symlink would avoid me having to have two separate SMB shares to be able to throw files at the server, at least. The messed-up space calculations: would they likely be a cosmetic issue, or could they cause real problems? I'd assume the former.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
The only real risk is that you miss seeing that the volume is filling up.
 

NJMorf

Explorer
Joined
Aug 9, 2017
Messages
53
OK, I'll give that a go, thanks.
 

NJMorf

Explorer
Joined
Aug 9, 2017
Messages
53
I tried the symlink and it didn't work the way I expected.

When using CLI on the NAS I was able to navigate into and see the contents of the linked Movies folder, but Plex couldn't see the contents. The linked Movies folder was visible in the SMB share for the volume_1 Media folder, but I couldn't navigate into it. Both the volume_1 and volume_2 media folders have the same permissions (same owner, group and options) and I'd rebooted the server after making the link in case that helped, but it didn't make a difference. The SMB share to volume_2/Media/Movies still works normally.

I tried removing the storage from the Plex jail, then remaking the link and re-adding volume_1/Media again, but that hasn't made any difference either. I'm going to remount volume_2/Media/Movies into volume_1/Media for the time being, but I'd still like a transparent solution if I can get it (without just sticking bigger hard drives into the volume...).
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I see what I did here... I am thinking outside the jail, not inside it.

If you make the mount a bind mount (instead of just nullfs, you put nullfs,bind in the iocage fstab statement), you can indeed see the symlink, but it points to a location that the jail can't see.

So what is actually needed is that you mount both locations to the jail (the bind mount may or may not be necessary for this) and make the symlink inside the jail from the first volume to the second (or whichever way around it needs to be).

Maybe still worth doing to give the transparent connection between the volumes you wanted, just not outside the jail at the same time as inside it.
 

NJMorf

Explorer
Joined
Aug 9, 2017
Messages
53
I should clarify that I'm using the plugin version of Plex at the moment: I'm still too new to FreeNAS to feel particularly comfortable with manually configuring jails, let alone iocage (which, if I understand, is different to standard jails). I am probably going to try running Plex in a jail later, as I want to be able to update PMS more frequently that seems possible using plugins.

As for mounts/links inside the jail: I'm actually OK with the way I have it right now. Plex sees the vol_2/Media/Movies mount as a folder in the vol_1/Media mount, which preserves the file paths as far as Plex is concerned. I'm confident that I can maintain that file structure in the jail if I move the dataset in the future.

What's more annoying to me right now is not being able to access vol_1/Media and vol_2/Media in the same SMB share, despite having created the symlink outside of the jail. If that can be fixed, then great. If not, then I guess I'll just live with it until such a time as I need to add more storage, at which point I'll look into getting all the media back onto a single volume.

For reference: both volumes are 2x3TB mirrored drives, mostly because I built the FreeNas box on two unused drives, then took the other two 3TB drives from the old NAS after I'd transferred the data and made a second volume. This seemed like the simplest option for a noob, though I'm sure there are much better ways of doing it that are probably safer in the long run as well.
 
Status
Not open for further replies.
Top