[lxc-users] How to have /var, /tmp etc. on separate zfs filesystems in containers?
Andrey Repin
anrdaemon at yandex.ru
Mon Mar 4 18:38:45 UTC 2019
Greetings, Korn AndrĂ¡s!
> I'd like to have separate zfs datasets for /var, /tmp and some other
> mountpoints inside my guests.
> What's a good way of achieving this?
> As far as I could determine from looking at the source, the zfs storage
> backend doesn't support anything like it, and lxc-create doesn't run any
> hooks.
> Should I instead write a wrapper around lxc-create that creates and mounts
> my zfs datasets just so, and calls lxc-create with the 'dir' storage
> backend?
> Or is there a better way?
If I may hazard a guess, there's two ways to achieve this:
1. Rebind the directories individually.
Use lxc.mount.* commands in the config or specify lxc.mount.fstab file with
your bindings.
2. Use overlayfs to merge two trees.
The end result will be different in each case, see what's best for your actual
needs.
> (Of course I can create the guest first, then move the files around
> afterwards, but I'd like to avoid this if possible.)
--
With best regards,
Andrey Repin
Monday, March 4, 2019 21:23:08
Sorry for my terrible english...
More information about the lxc-users
mailing list