Recursive dataset mounting for jails

GrahamA

Cadet
Joined
Mar 15, 2021
Messages
4
Hello!

I've only recently got started with TrueNAS, having upgraded from my old Synology DS218j, however I want to use that old Synology NAS as a backup for my new TrueNAS system.

What I'm trying to do is use Duplicati to backup my important data to my DS218j, I've created a jail from the Duplicati plugin and mounted my important datasets.

I've come across enough threads like this one pointing out that child datasets must be explicitly mounted—but haven't seen any proposing a solution beyond manually mounting those datasets.

I want to backup the `iocage` dataset itself, now obviously I can't mount `iocage` within a jail because of recursion, so I've created a replication task to replicate `iocage` to another dataset called `backups`. The issue then is that there's a fair few child datasets of the iocage dataset, and manually mounting them all is a bit laborious, especially if I then add a new jail and have to go back through and edit the mount points.

So my question is simply: is there a better way to do this?

With thanks,
Graham
 

GrahamA

Cadet
Joined
Mar 15, 2021
Messages
4
So I've partly automated the tricky part of this whole task, I've written a little Python script here which gets a list of datasets from zfs list and spits out a text file of lines which can be appended to the jail's fstab with # iocage fstab -e <JAIL_NAME_HERE>

Having written that, I realise by condensing my datasets down into just a directory that I'm losing the ZFS structure information; which isn't ideal if I want a quick restoration in case things go pear-shaped, and really the bit I'm interested in saving is custom configs for things like my reverse proxy, and my Nextcloud DB; but perhaps it's a step in the right direction?
 
Top