On 15/01/2021 16:17, Julien Cigar wrote:
Hello,

I have a host with a lot of jails, which are deployed automatically with
Saltstack (thanks to https://github.com/silenius/jails-formula). I
usually create two datasets per jail: one for the jail itselfs, and one
for the "data". The idea is to be able to easily upgrade the jail
without touching the "data". So I have something like (1).

I have one fstab per jail which mount the corresponding "data" dataset
under the jail, something like:

~/ cat /etc/fstab.nextcloud
/data/jails/nextcloud           /jails/nextcloud/data   nullfs  rw      0 0

I'd like to know if there is a better way of handling this, without
involving nullfs if possible and how do people usually manage that..?

(1) https://gist.github.com/silenius/f1899ebb5cf58ca33b3e5edafc85d549

I am using nullfs to mount shared basejail in to each jail. I prefere to have filesystems for jails mounted all the time so I can manage (backup, configure, update) files even if jail is not running. No fstab is needed for this scenario. But if you want to mount / unmount jail's datasets when jail start / stop you can set these ZFS filesystems as "legacy" (no automatic mount at boot) and then mount them with /etc/fstab.jailname as you use nullfs now.

Miroslav Lachman
_______________________________________________
freebsd-jail@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-jail
To unsubscribe, send any mail to "freebsd-jail-unsubscr...@freebsd.org"

Reply via email to