mounting main data set.

Grinas

Contributor
Joined
May 4, 2017
Messages
174
Hey,

I have a main data set lets call it M1 which has numerous subdata sets let S1, S2, S3 S4 Sn.... and I usually mount these subdata sets in jails. As i build and destroy a number of jails each week I though i could mount just the main data set as it would save me not having to mount all the sub data sets and also the jail would recognise it all as the same data set and I would hopefully get faster speeds when moving/copying files between the subdata sets.

The issue I am facing is when i mount the main data set on a jail all the directories are there for the sub data sets but they are all empty where as if i mount just the sub data sets they contain the data. I can create directories and files in the main dataset and the subdata sets directories but if I create something in the subdata sets these can not be seen from other jails that have just the subdata sets mounted. I have given full permissions to the main data set so it should not be a permissions issue.

Is this by design that sub data sets can not be accessed via jails if a dataset higher up the tree is mounted?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
This is by design. Mounts are generally not transitive. Possibly there is some ZFS magic flag that just forces the additional mounts, but I have a different suggestion:

You can create a main dataset and just plain directories instead of sub-datasets in there. Then mount these directories into your jails just like you would with datasets. The jail mounts are created by "nullfs" in FreeBSD and you can mount an arbitrary directory path at some arbitrary other location - no need to have a "filesystem" for that.

This way e.g. moving files from one of these directories to another one will be instantaneous, because it doesn't cross a filesystem/dataset boundary. Which is what you want, if I'm not mistaken.

HTH,
Patrick
 
Last edited:

Grinas

Contributor
Joined
May 4, 2017
Messages
174
This is by design. Mounts are generally not transitive. Possibly there is some ZFS magic flag that just forces the additional mounts, but I have a different suggestion:

You can create a main dataset and just plain directories instead of sub-datasets in there. Then mount these directories into your jails just like you would with datasets. The jail mounts are created by "nullfs" in FreeBSD and you can mount an arbitrary directory path at some arbitrary other location - no need to have a "filesystem" for that.

This way e.g. moving files from one of these directories to another one will be instantaneous, because it doesn't cross a filesystem/dataset boundary. Which is what you want, if I'm not mistaken.

HTH,
Patrick

Thank you for confirming I couldn't find anything when I did a search so was unsure was this by design.
 
Top