[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Import and Export of Zfs pools



On Thu, 26 Nov 2020 at 12:32, Dan Ritter <dsr@randomstring.org> wrote:
James Allsopp wrote:
> Hi,
> I've got a zfs pool that works fine in normal use on my debian system and
> remains after a reboot.
> When I reboot into recovery mode, I have to reimport the pool manually
> using
> zpool import -d /dev/disk/by-id <name of pool>
>
> I export before I reboot, but when I reboot into the full version of Debian
> 10, the pool isn't there. I can reimport it using the zpool import command,

That's expected.

zpool export prepares the zpool for use on a different system.
It is not part of the usual shutdown procedure.


> What I want to do is this;
>
>    - Reboot in single user mode
>    - import pool.
>    - 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..

-dsr-


>
> I tried this with a VM and it worked.
> Thanks
> James

--
https://randomstring.org/~dsr/eula.html is hereby incorporated by reference.
                there is no justice, there is just us.

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.

James

 

Reply to: