dedicated dataset for jail data

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

dedicated dataset for jail data

Julien Cigar-4
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

Thanks!

Julien

--
Julien Cigar
Belgian Biodiversity Platform (http://www.biodiversity.be)
PGP fingerprint: EEF9 F697 4B68 D275 7B11  6A25 B2BB 3710 A204 23C0
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-jail
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: dedicated dataset for jail data

Miroslav Lachman
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
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-jail
To unsubscribe, send any mail to "[hidden email]"