@dmshimself,
On my test system, I have a SSD I use to host the iocage I want to play with.
I have been experimenting with Nextcloud install and update quite a bit before having them connect to my live data. Because of it, I have been creating the various environment (datasets) to be used by the iocage jail.
I have been using Danb35 script
https://forums.freenas.org/index.ph...llation-of-nextcloud-14-in-iocage-jail.62485/
and applied the following steps to reach my goals which are to install a new Nextcloud jail pointing to a brand new database and folder datasets and then once everything is working, then I can remap the db (database) and files datasets to my existing live Nextcloud db and files datasets.
the "ssd" pool is located as follow:
/mnt/ssd
I have the few iocage jail environments as such:
iocage jail jail_example1:
/mnt/ssd/iocage_setup1
/mnt/ssd/iocage_setup1/jail_example1/db
/mnt/ssd/iocage_setup1/jail_example1/files
/mnt/ssd/iocage_setup1/jail_example1/portsnap
/mnt/ssd/iocage_setup1/jail_example1/install
iocage jail jail_example2:
/mnt/ssd/iocage_setup1
/mnt/ssd/iocage_setup1/jail_example2/db
/mnt/ssd/iocage_setup1/jail_example2/files
/mnt/ssd/iocage_setup1/jail_example2/portsnap
/mnt/ssd/iocage_setup1/jail_example2/install
iocage jail jail_example3:
/mnt/ssd/iocage_setup2
/mnt/ssd/iocage_setup2/jail_example3/db
/mnt/ssd/iocage_setup2/jail_example3/files
/mnt/ssd/iocage_setup2/jail_example3/portsnap
/mnt/ssd/iocage_setup2/jail_example3/install
My live Nextcloud db and files dataset can be located as such:
/mnt/mirror-4TB/cloud
/mnt/mirror-4TB/cloud/db
/mnt/mirror-4TB/cloud/files
When the various jails have been created, even though the exist under the "ssd" pool, Freenas upon activating the necessary jail system must be told to be using "ssd" using the following command"
iocage activate ssd
upon such command, Freenas will create the "iocage" mount point under the "/mnt" folder structure.
Listing the content of "/mnt" should return something like that:
/mnt/ssd
/mnt/iocage
/mnt/mirror-4TB
/mnt/md_size
In reality, "mnt/iocage" is not a physical object but equivalent to a symlink if you get my drift, at least this is what I think.
The "fstab" assigned to the jail will be located as follow:
One single "fstab" file per jail:
/mnt/iocage/jails/jail_example1
/mnt/iocage/jails/jail_example2
/mnt/iocage/jails/jail_example3
You can then edit the relevant "fstab" using your prefered file editor, I like "nano":
nano /mnt/iocage/jails/jail_example1/fstab
You should get something similar to what follows:
/mnt/ssd/iocage_setup1/jail_example1/portsnap/ports /mnt/iocage/jails/jail_example1/root/usr/ports nullfs rw 0 0 # Added by iocage on 2018-11-17 06:50:05
/mnt/ssd/iocage_setup1/jail_example1/portsnap/db /mnt/iocage/jails/jail_example1/root/var/db/portsnap nullfs rw 0 0 # Added by iocage on 2018-11-17 06:50:06
/mnt/ssd/iocage_setup1/jail_example1/files /mnt/iocage/jails/jail_example1/root/mnt/files nullfs rw 0 0 # Added by iocage on 2018-11-17 06:50:06
/mnt/ssd/iocage_setup1/jail_example1/db /mnt/iocage/jails/jail_example1/root/var/db/mysql nullfs rw 0 0 # Added by iocage on 2018-11-17 06:50:06
Now I just need to edit "fstab" content related to the source of "files" and "db" datsets and replace them with the one where my Nextcloud datasets resides.
This should give something like such:
/mnt/ssd/iocage_setup1/jail_example1/portsnap/ports /mnt/iocage/jails/jail_example1/root/usr/ports nullfs rw 0 0 # Added by iocage on 2018-11-17 06:50:05
/mnt/ssd/iocage_setup1/jail_example1/portsnap/db /mnt/iocage/jails/jail_example1/root/var/db/portsnap nullfs rw 0 0 # Added by iocage on 2018-11-17 06:50:06
/mnt/mirror-4TB/cloud/files /mnt/iocage/jails/jail_example1/root/mnt/files nullfs rw 0 0 # Added by iocage on 2018-11-17 06:50:06
/mnt/mirror-4TB/cloud/db /mnt/iocage/jails/jail_example1/root/var/db/mysql nullfs rw 0 0 # Added by iocage on 2018-11-17 06:50:06
If doing a true script installation of Nextcloud, there will be extra elements that I need to update but for the mount point location, this is all that is needed.
Once updated, you will need to restart the corresponding jail such as:
iocage restart jail_example1
Doing the following will list the various jails recognized by the system and their status with the mapped IP address:
iocage list
If you need to change the IP address, the name of whatever is used to configure the jail, you can first have a look at the "config.json" file located in the same folder as "fstab". I beleive it is only read only and therefore cannot edit it. If not read only, it is only indicating the parameters used by the jail, and even you manage to edit it, it will not post once the jail is restarted, I think.
Instead, you will need to run some commands.
To get the parameters as show in "config.json", you can run:
iocage get all jail_example1
Let's say, I want to change the IP address of the jail which is listed on my system as follow:
ip4_addr:igb0|192.168.2.120/24
I can also do the following to get only one single parameter:
iocage get ip4_addr jail_example1
It should return:
igb0|192.168.2.120/24
All I need to do to update the IP address to "192.168.2.222" is to do the following:
iocage set ip4_addr=192.168.2.222 jail_example1
You can see the new IP address using:
iocage list