[SOLVED] Moving /var/lib/vz

rcd

Well-Known Member
Jul 12, 2019
246
25
58
63
I had a requirement for a new Proxmox server with zfs. Unfortunately the hosting company I'm with did not have a bootable proxmox+zfs installer so I had to install Debian first, then adding Proxmox and zfs, By and large this wasn't too hard, and I now have the system setup with the base Proxmox on a smallish raid-1 partition, and the rest of the disks in zfs raidz1.

Problem now is that /var/lib/vz is on the root partition. I provisioned a filesystem "zfs create -o mountpoint=/var/lib/vz poolz/vz" but it compains that the /var/lib/vz partition isn't empty - there are a couple of directories. If I delete them they are just recreated again. What is the correct way to go by removing/recreating the /var/lib/vz partition please.

A pointer to documentation explaining this would work, I haven't been able to find any.
 
Cool, so it's just a matter of being fast enough ;)

Would it make sense to thin provision the directory? I guess to prevent it from running away and taking up all the zfs space? I'm kinda new to zfs, what's best practice? (https://wiki.debian.org/ZFS)
 
Last edited:
do it as a script;

mv /var/lib/vz /var/lib/vz.bak; zfs create [new pool]/var-lib-vz; zfs set mountpoint=/var/lib/vz [new pool]/var-lib-vz;
zfs mount -a;

since my rpool is only 250GB
via the WEBUI; I disabled the local which was pointed to /var/lib/vz
than ran
Bash:
zfs set mountpoint=/var/lib/vz [new pool]
where new pool is a my slow (SATA) but big storage

than
Bash:
zfs unmount rpool/var-lib-vz
zfs destroy -fr rpool/var-lib-vz

and reactived the local directory via the WebUI

thank for your inspiration