Mount datasets recursivly into jails

rakor

Dabbler
Joined
Sep 8, 2021
Messages
22
Hey there,

the UI gives me the possibility to mount datasets into a jail. But sadly this does not include child-datasets.
I want to setup a jail to run periodic restic-backups of my data. The data is aranged in a special structure, like this:

Code:
   pool
    │
    ├─►shares
    │   │
    │   ├─►share1
    │   │
    │   ├─►share2
    │   │
    │   └─►share3
    │
    ├─►services
    │   │
    │   ├─►service1
    │   │
    │   ├─►service2
    │   │
    │   └─►service3
    │
    └─►archive
        │
        ├─►archive1
        │
        └─►archive2


I would like to mount tank/shares and tank/services into the jail, to do backups of them. If I mount those directories the child datasets are not mounted and I would have to mount "tank/services/service1" to "tank/services/service3" all one by one. While this would be possible, it has the problem, that adding new children means I have to add them to the jail to do backups. I am really sure I will forget about this if I'll add some datasets in the future.
Isn't there a way to mount those datasets recursively?

Also It would be perfect if I could mount snapshots of those datasets. Doing read-only-mounts is ok, but this still gives the possibility that data is beeing changed during backup.

Thanks a lot!
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
There is no such thing as a recursive mount. I understand your reason for desiring that feature but it simply does not exist.
You could write a shell script that does all the mounts for whatever it finds below some topmost dataset and configure that as a post init task.
 

rakor

Dabbler
Joined
Sep 8, 2021
Messages
22
Oh wow, thanks for this superfast reply!
Well to bad. Would be a great feature for future releases then! Or even introduce restic as backup-tool into the system ;)
Thanks for your hint. I did not want to tinker around to much (also, in some years I won't remember ;) ), but I'll have a look... Going this way, maybe I could directly use the snapshots... Maybe create a snapshot, doing a readonly-clone and mounting this into the jail.... Well I'll have to think about this :)
 
Top