[SOLVED] Moving /var/lib/vz

rcd

Active Member
Jul 12, 2019
245
23
38
62
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
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!