James Allsopp wrote: 
> On Thu, 26 Nov 2020 at 12:32, Dan Ritter <d...@randomstring.org> wrote:
> 
> > >    - cp -a /var to /tank/var
> > >    - Set the mount point on /tank/var to /var
> > >    - Remove /var entry from /etc/fstab
> > >    - Export the pool
> > >    - Reboot
> > >
> > >
> > > And then I should have a ZFS var for VMs and Docker containers when the
> > > main OS imports ZFS for /var.
> >
> > Don't export the pool. Unmount all ZFS mounts before or as part
> > of shutdown..
> 
> Ok, got all this to work almost; When the system comes back up, it sees no
> /var directory and tries to fill it. Then the zfs-mount service starts
> later and can't mount over a non-empty directory. I'm out of ideas now.

So you need ZFS to be up earlier. I've never seen anyone use ZFS
for /var without also using it for /, but the procedure should
be basically the same: you need to get everything set up in your
initramfs  as though you were going to use a ZFS root, and then
don't.

See
https://openzfs.github.io/openzfs-docs/Getting%20Started/Debian/Debian%20Buster%20Root%20on%20ZFS.html

and zfs-initramfs

-dsr-

Reply via email to