Proxmox and zfs(onlinux) issue

jinjer

Renowned Member
Oct 4, 2010
204
7
83
I've been experimenting with zfs onlinux in the last few days.

ZFS is running fast and stable and all looks great.

There is however a small issue with proxmox and the shares mounted from zfs.

The preconditions are:
By default, zfs will not mount a zfs dataset in a directory if the directory is not empty.
By defaults, proxmox will create directories in it's datastore, if it finds it empty.

You see the race:
Sometimes you dismount a zfs filesystem containting something (images/iso... whatever) and proxmox will create a new empty directory called "images" in the mount point. Some other times, zfs will just have a problem and not mount, leading to the same issue above.

ZFS will refuse to mount the dataset until you delete the empty directories.

The fix.... is not easy. I know.
 
Ouch... same issue indeed. I still think its unfortunate as a FS can fail to mount for any reasons. Initializing an empty directory with default data shall not be allowed to happen at any other time than at setup (i.e. when adding the storage via the gui, or when explicitly forcing a storage to be initialized).