local replication of iocage dataset with GUI possible?

Henning Kessler

Contributor
Joined
Feb 10, 2015
Messages
143
Hello,

I am trying to find a solution to replicate the iocage dataset to another pool on the same host by using the replication task feature in the GUI. The GUI based replication task works quite well for all normal datasets but not so well with the iocage dataset as it has its own mount point (/mnt/iocage) which is replicated as well. This leads to the funny (not really ;-)) situation that two datasets from two different pools on the same host claiming to have the same mount point o_O.

Is there a way to solve this? Maybe by creating a dataset on the second pool as target that has the canmount=off flag set?

An idea is welcome.

Henning
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
I could be wrong and do not fully understand how iocage snapshot and dataset relation really works.
So far, what I know or think I know, is that the iocage dataset mounted as "/mnt/iocage" may just be a place holder to the iocage location under your /mnt/tank/iocage" dataset.
You can replicate the first time but subsequent incremental replication will fail if the remote pool has been mounted with iocage mount point enabled.
If you replicate all your pool and exclude /mnt/iocage from being replicated, I don't know if the mounted iocage on the remote will contain the same data from the source at the time the iocage was active and the snapshot make of the "/mnt/tank/iocage".
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
canmount=noauto would be enough.

you can set that property after the replication starts and the datasets are there. The property isn't overwritten by subsequent replication cycles.
 

Henning Kessler

Contributor
Joined
Feb 10, 2015
Messages
143
Thanks a lot for your comments :):

So just to get this right. I could set that flag on the replicate dataset itself? Like this?
sudo zfs set canmount=noauto -r targetpool/iocage
And it would be inherited and persist subsequent replication cycles?

Henning
 

Henning Kessler

Contributor
Joined
Feb 10, 2015
Messages
143
Mmmh this is strange. As I created a local replication task I realized that mount point for the replicate iocage dataset now is /mnt/targetpool/iocage. So don't have to set the canmount=noauto flag. This must have been changed in one of the last updates....
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Don't be too confident... this may have happened only because the mountpoint isn't unique, but at boot, there's no telling which one will be selected unless as you say, someone has mad a change that I missed in the documentation.

The property isn't inherited if you do end up setting it, so you either script it and recurse or do it for each dataset manually... it's a once-off task unless you create more jails.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Mmmh this is strange. As I created a local replication task I realized that mount point for the replicate iocage dataset now is /mnt/targetpool/iocage. So don't have to set the canmount=noauto flag. This must have been changed in one of the last updates....
This is normally where iocage gets installed. When Freenas boots and iocage kicks in, it will execute the jails and have them mapped to /mnt/iocage.
At least this is how I think this works.
 

Henning Kessler

Contributor
Joined
Feb 10, 2015
Messages
143
Mmmh it doesn't seam to work
Code:
sudo zfs get -r canmount backup |grep -v @
NAME                                                            PROPERTY  VALUE     SOURCE
backup                                                          canmount  on        default
backup/iocage                                                   canmount  off       local
backup/iocage/download                                          canmount  off       local
backup/iocage/download/10.3-RELEASE                             canmount  off       local
backup/iocage/download/11.1-RELEASE                             canmount  off       local
backup/iocage/download/11.2-RELEASE                             canmount  off       local
backup/iocage/images                                            canmount  off       local
backup/iocage/jails                                             canmount  off       local
backup/iocage/jails/dns                                         canmount  off       local
backup/iocage/jails/dns/root                                    canmount  off       local
backup/iocage/jails/icinga                                      canmount  off       local
backup/iocage/jails/icinga/root                                 canmount  off       local
backup/iocage/jails/mysql                                       canmount  off       local
backup/iocage/jails/mysql/root                                  canmount  off       local
backup/iocage/jails/obsrv                                       canmount  off       local
backup/iocage/jails/obsrv/root                                  canmount  off       local
backup/iocage/log                                               canmount  off       local
backup/iocage/releases                                          canmount  off       local
backup/iocage/releases/10.3-RELEASE                             canmount  off       local
backup/iocage/releases/10.3-RELEASE/root                        canmount  off       local
backup/iocage/releases/11.1-RELEASE                             canmount  off       local
backup/iocage/releases/11.1-RELEASE/root                        canmount  off       local
backup/iocage/releases/11.2-RELEASE                             canmount  off       local
backup/iocage/releases/11.2-RELEASE/root                        canmount  off       local
backup/iocage/templates                                         canmount  off       local


but then
Code:
zfs list
backup/iocage                                                                 253G  2.94T  6.58M  /mnt/iocage
backup/iocage/download                                                       1.44G  2.94T   132K  /mnt/iocage/download
backup/iocage/download/10.3-RELEASE                                           413M  2.94T   413M  /mnt/iocage/download/10.3-RELEASE
backup/iocage/download/11.1-RELEASE                                           520M  2.94T   520M  /mnt/iocage/download/11.1-RELEASE
backup/iocage/download/11.2-RELEASE                                           544M  2.94T   544M  /mnt/iocage/download/11.2-RELEASE
backup/iocage/images                                                          132K  2.94T   132K  /mnt/iocage/images
backup/iocage/jails                                                           246G  2.94T   132K  /mnt/iocage/jails
backup/iocage/jails/dns                                                      2.57G  2.94T   140K  /mnt/iocage/jails/dns
backup/iocage/jails/dns/root                                                 2.57G  2.94T  2.07G  /mnt/iocage/jails/dns/root
backup/iocage/jails/icinga                                                    179G  2.94T   140K  /mnt/iocage/jails/icinga
backup/iocage/jails/icinga/root                                               179G  2.94T  10.5G  /mnt/iocage/jails/icinga/root
backup/iocage/jails/mysql                                                    16.2G  2.94T   140K  /mnt/iocage/jails/mysql
backup/iocage/jails/mysql/root                                               16.2G  2.94T  5.44G  /mnt/iocage/jails/mysql/root
backup/iocage/jails/obsrv                                                    48.6G  2.94T   140K  /mnt/iocage/jails/obsrv
backup/iocage/jails/obsrv/root                                               48.6G  2.94T  8.03G  /mnt/iocage/jails/obsrv/root
backup/iocage/log                                                             428K  2.94T   208K  /mnt/iocage/log
backup/iocage/releases                                                       5.42G  2.94T   132K  /mnt/iocage/releases
backup/iocage/releases/10.3-RELEASE                                          1.64G  2.94T   132K  /mnt/iocage/releases/10.3-RELEASE
backup/iocage/releases/10.3-RELEASE/root                                     1.64G  2.94T  1.64G  /mnt/iocage/releases/10.3-RELEASE/root
backup/iocage/releases/11.1-RELEASE                                          1.87G  2.94T   132K  /mnt/iocage/releases/11.1-RELEASE
backup/iocage/releases/11.1-RELEASE/root                                     1.87G  2.94T  1.87G  /mnt/iocage/releases/11.1-RELEASE/root
backup/iocage/releases/11.2-RELEASE                                          1.92G  2.94T   132K  /mnt/iocage/releases/11.2-RELEASE
backup/iocage/releases/11.2-RELEASE/root                                     1.92G  2.94T  1.92G  /mnt/iocage/releases/11.2-RELEASE/root
backup/iocage/templates                                                       132K  2.94T   132K  /mnt/iocage/templates

mypool/iocage                                                                 131G  4.84T  3.34M  /mnt/iocage
mypool/iocage/download                                                        739M  4.84T    88K  /mnt/iocage/download
mypool/iocage/download/10.3-RELEASE                                           206M  4.84T   206M  /mnt/iocage/download/10.3-RELEASE
mypool/iocage/download/11.1-RELEASE                                           260M  4.84T   260M  /mnt/iocage/download/11.1-RELEASE
mypool/iocage/download/11.2-RELEASE                                           272M  4.84T   272M  /mnt/iocage/download/11.2-RELEASE
mypool/iocage/images                                                           88K  4.84T    88K  /mnt/iocage/images
mypool/iocage/jails                                                           128G  4.84T    88K  /mnt/iocage/jails
mypool/iocage/jails/dns                                                       367M  4.84T    92K  /mnt/iocage/jails/dns
mypool/iocage/jails/dns/root                                                  366M  4.84T  1.05G  /mnt/iocage/jails/dns/root
mypool/iocage/jails/icinga                                                   94.0G  4.84T    92K  /mnt/iocage/jails/icinga
mypool/iocage/jails/icinga/root                                              94.0G  4.84T  5.41G  /mnt/iocage/jails/icinga/root
mypool/iocage/jails/mysql                                                    8.46G  4.84T    92K  /mnt/iocage/jails/mysql
mypool/iocage/jails/mysql/root                                               8.46G  4.84T  2.78G  /mnt/iocage/jails/mysql/root
mypool/iocage/jails/obsrv                                                    25.1G  4.84T    92K  /mnt/iocage/jails/obsrv
mypool/iocage/jails/obsrv/root                                               25.1G  4.84T  4.12G  /mnt/iocage/jails/obsrv/root
mypool/iocage/log                                                             352K  4.84T   128K  /mnt/iocage/log
mypool/iocage/releases                                                       2.76G  4.84T    88K  /mnt/iocage/releases
mypool/iocage/releases/10.3-RELEASE                                           852M  4.84T    88K  /mnt/iocage/releases/10.3-RELEASE
mypool/iocage/releases/10.3-RELEASE/root                                      852M  4.84T   852M  /mnt/iocage/releases/10.3-RELEASE/root
mypool/iocage/releases/11.1-RELEASE                                           973M  4.84T    88K  /mnt/iocage/releases/11.1-RELEASE
mypool/iocage/releases/11.1-RELEASE/root                                      973M  4.84T   973M  /mnt/iocage/releases/11.1-RELEASE/root
mypool/iocage/releases/11.2-RELEASE                                           999M  4.84T    88K  /mnt/iocage/releases/11.2-RELEASE
mypool/iocage/releases/11.2-RELEASE/root                                      999M  4.84T   998M  /mnt/iocage/releases/11.2-RELEASE/root
mypool/iocage/templates                                                           88K  4.84T    88K  /mnt/iocage/templates
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
I tried this on one of my backup which carries the same pool name as my primary Freenas pool, and the results where catastrophic.
My backup pool is set to readonly=on, and applying the "canmount" setting to the dataset caused me to lock ".system" in read only mode.
This wreak havoc on my system as it caused network ( namely GUI to no longer have WEB access).
I had to change the setting s back to where they used to be to be able to access the spare server.
In my case, "canmount" is not something that works.
If you backup pool remains set as "readonly=on", the the iocage dataset will not be mountable, unless it was already mounted, so it is a hit or a miss.
 
Top