[pve-devel] /var/lib/vz as a dataset

Jean-Francois Dagenais jeff.dagenais at gmail.com
Fri Jun 17 03:55:55 CEST 2016

While we are on the subject of /var/lib/vz…

Does anyone see a problem with having the “local” storage be a zfs dataset. I don’t really need it, but I can’t delete it from the UI. I need to exclude the dir from my znapzend auto-snapshot plan.

I succeeded by doing:

zfs create -o mountpoint=/var/lib/vz rpool/vz/local
cannot mount '/var/lib/vz': directory is not empty
filesystem successfully created, but not mounted

Ok, all normal… then I:
cd /var/lib
mv vz vz.bak

At which point a new vz dir appeared with the proper subdirs in it (dump, images, etc.). HA!

So I did:

rm -rf vz/* ; zfs mount rpool/vz/local

the mount worked.

The dir is a dataset (which lets me exclude it from my znapzend autosnapshot plan) but considered a “Directory” storage from the proxmox code.

The only potential problem I see is on reboot, perhaps some daemon could recreate subdirs inside /var/lib/vz and the zfs auto-mount of the dataset would fail with the “directory not empty” error. Zfs mounts should come pretty early in the boot process so most likely not an issue.

Anyone disagree or see any problem with this?


More information about the pve-devel mailing list