Jump to content

Two Emby Jails in TrueNAS 12?


Go to solution Solved by FrogMaster,

Recommended Posts

Posted

Hi everyone,

 

I had one Emby Jail for the longest time and it was created via the plugin in the TrueNas Plugins section.  The Jail was simply named Emby.   I had some issues with it after updating once and was asked to run the following command to fix it:

git clone -b truenas12 https://github.com/MediaBrowser/iocage-amd64.git

cd iocage-amd64

iocage fetch -P emby-server.json dhcp="on" ip6="inherit" allow_mlock="on" --branch truenas12

iocage set plugin_repository='https://github.com/MediaBrowser/iocage-amd64.git' emby-server.

 

All this did was create another jail named emby-server.  I was like, ok, cool I have two now.  I'll use this one as a back up in case something happens to the original one.  This way while I work on trying to fix it, I can still access my media.  Well, something happened to the original Emby Jail and I had to delete it.  

I'd like to create a new one so that I have two again.  Since the existing Jail was created via the command above, can I simply just go the TrueNAS Plugins section and select Emby and it will create a new Jail named Emby and I'll be all set?  If not, is there a way to use the above command, but append the name to be something other emby-server?  Is it as simple as replacing emby-server at the end of the command with a different name?

 

Lastly, if I can just select the Plugin from the Plugins section, which do I choose?  I see Emby and Emby Server.

 

I'd greatly appreciate any assistance.

 

Thanks,

Chris

Plugins.JPG

Posted

I can help only with Scale ,can't help with jails and legacy truenas.

Sorry

Posted

As you've stated in the OP it's pretty straightforward to create an emby jail in TrueNAS 12 so I'm not sure why you'd need a backup?

I'd recommend mounting the var/db/emby-server folder in its own dataset outside of the jail, in a similar way I'm sure you mount your media files.  That makes recreating things even easier as you have a backup of all your configuration settings too.

Don't be tempted to mount this into two different jails though, as that will f**k everything up 🙃

 

 

Posted

Hi adrianwi,

 

Thanks for replying.  You're right, I don't need a back up server, but it would be nice to have in case my main one goes down and I have issues getting it restored.  I'll at least have the backup working as I repair the main one.

I hear a lot of people saying to mount that folder in its own Dataset outside of the Jail.  My issue with that is, I don't know how to do it.  Currently, Emby is installed inside of iocage (See attachment).  I do on occasion (monthly) backup the var/db/emby-server folder to a drive on my Windows machine, so I can copy it back in case anything happens.  So my understanding is, if something goes bad with my Jail, I can restore the Jail from a Snapshot and then copy back the emby-server folder and I should be good.  Is that correct?

Is there a way I can set the var/db/embey-server folder to be in a different Dataset?

 

Thanks,

Chris

Pool.JPG

Posted

I think the easiest way to do this is:

1. Within the emby jail, move the /var/db/emby-server folder to /var/db/emby-bak

2. Create a dataset on your pool to store the emby-server data (I called mine embydb)

3. Mount the new dataset into the emby jail in a similar fashion to you would the media folders (my setting below as an example)

4. Within the emby jail, copy all of the files and folders from /var/db/emby-bak to /var/db/emby-server (which is now actually your new dataset)

 

Screenshot 2023-09-23 at 09.56.11.jpg

  • Thanks 1
Posted

Sorry for the late reply.  I will give it a try.  Not really too familiar with moving data within a Jail, but I'll give it a try.  I'll let you know how I make out and if I need any further assistance.

 

Thanks

  • Thanks 1
FrogMaster
Posted

I'm a frequent user of TrueNAS Core. I use to previously have two manually created jails so I could test future beta releases. I don't do this anymore and just kind of hope nothing goes wrong when I update now, but it's a pretty manageable task should you want to maintain two jails.

You can either

  1.  Follow the install steps again, but change the target jail name so another jail is created. For example:
    iocage set plugin_repository='https://github.com/MediaBrowser/iocage-amd64.git' emby-testserver

    OR

  2. You can Install from the plugin, this will not affect your current "Emby-Server" jail it should make a new one.

Once you've created either of these Jails, you should be able to mount your server's media data again, and they'll work in conjunction.
Personally, I would suggest manually creating the Jail rather than using the TrueNAS plugin system, I found it tends to lag behind and it's easier to just manage the install/jail yourself.

Posted

Thank you FrogMaster.  That's all I was looking for.  I just wanted to make sure I could create another jail manually without causing any harm to the original jail.  I figured I could just change the jail name at the end, but I wasn't sure if this would work or not.  Being you've done it before, I guess it will work.  I'll give it a shot.

 

Thanks,
Chris

Posted

FrogMaster:

 

I did what you suggested and it did not work.  The normal steps for manually creating an emby jail are:

1.git clone -b truenas12 https://github.com/MediaBrowser/iocage-amd64.git 

2. cd iocage-amd64

3. iocage fetch -P emby-server.json dhcp="on" ip6="inherit" allow_mlock="on" --branch truenas12

4. iocage set plugin_repository='https://github.com/MediaBrowser/iocage-amd64.git' emby-server

 

Here is what I experienced:

1. When doing step 1, I get a message that says "fatal: destination path 'iocage-amd64' already exists and is not an empty directory"

2. So I just follow step 2 and change directory to iocage-amd64

3. I then follow step 3 and this is the step that actually creates the new emby jail and names it emby-server

4. If I try the command iocage set plugin_repository='https://github.com/MediaBrowser/iocage-amd64.git' emby-test I get a message that says "Jail 'emby-test' not found!"

 

That being said, if I just run the command iocage fetch -P emby-server.json dhcp="on" ip6="inherit" allow_mlock="on" --branch truenas12, a new emby-server jail is created with a name of emby-server_1.  I guess I can live with that, but I wish I could change the name.

 

I also encountered something that I wasn't too happy about.  I was originally on TrueNAS 12.  I ran the above commands to create the Jail manually.  I then updated to TrueNAS 13.  Being on TrueNAS 13 I ran this command to create a new Emby server - iocage fetch -P emby-server.json dhcp="on" ip6="inherit" allow_mlock="on" --branch master, as that is the command to manually create a Jail on TrueNAS 13.  I received a message that the Jail was going to be created as a 12.4 Jail.  I thought it would be a 13 Jail.  I guess because iocage was originally created in TrueNAS 12, all Jails created in it would be based on a 12 Jail.  The Jail created, but the 13 version of Emby installed.  Of course Emby would not launch.  I then had to upgrade the Jail to 13.2 and then Emby worked.

  • 3 weeks later...
  • Solution
FrogMaster
Posted

You should be able to rename your new jail with the following command

iocage rename emby-server_1 emby-test


I'm glad to hear you were able to get it to work though. :)

  • Like 1
  • Thanks 1
Posted

Thanks, I'll try it out.

  • Thanks 1
Posted

That command works, greatly appreciate it FrogMaster!!

  • Thanks 1
  • 7 months later...
skl_mobile
Posted (edited)

So I just spend and untold number of hours working on 2 emby 4.2 jails I had running on FreeNas 11 that I upgraded to Truenas Core 13.

This post and a few others helped me figure out how to get them upgraded to the emby supported version.

I use 2 Emby Instances, 1 for me and 1 for She, as we had separate nas's and instances, we migrated them to being on the same NAS around Freenas 11.

Unless you want to deal with emotional damage, you find a way to run 2, and the plugin system made it easy.

This may also be a way to switch from a plug installed version to the emby version as well come to think of it.

This is on a Truenas Core 13.1 System, with 2 emby installs (emby_1 & emby_2) after being upgraded from 11.3-U1 emby version 4.2X

iocage upgrade emby_1 -r 13.2-RELEASE-p11
iocage set plugin_repository='https://github.com/MediaBrowser/iocage-amd64.git' emby_1
cd /mnt/v0/iocage/jails/emby_1
cp config.json config.json.old
### replace plugname in config.json with one for Emby official name ###
contents="$(jq '.plugin_name = "emby-server"' config.json)" && echo -E "${contents}" > config.json
iocage exec emby_1 service emby-server status
### IF RETURNS FAILED(usually Will) ###
iocage console emby_1
pkg add --force https://github.com/MediaBrowser/Emby.Releases/releases/download/4.8.6.0/emby-server-freebsd13_4.8.6.0_amd64.pkg
service emby-server start 2>/dev/null
service emby-server status # should return a pid, wait a minute or 2 and emby should come up!

Both upgraded and are working fine.

Edited by skl_mobile
  • Thanks 1
  • 3 weeks later...
Posted

Thanks for this.  I already performed a clean upgrade to Truenas Core 13, but will keep this for reference.

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...