/etc/default/zfs should have a way to do that. does anyone remember the option ? years ago i used to do it but lost the notes.
yea I did clear the directory. somehow zfs mounts failed at boot, yet pve created directories in the mount point. I had not seen that in awhile.. just checking if there is another solution . I do not want to automate the rm -fr /tank/* ;-)
yes there is you can set the "mkdir" or "is_mountpoint" options for the directory storage, see "man pvesm" for details.
edit: just realized those are only available in git yet - should hit no-subscription soon. see bug #1012
systemd-udev-settle
lvm2-activation-early.service/start
/lib/systemd/system/zfs-mount.service
ExecStart=/sbin/zfs mount -a
ExecStart=/sbin/zfs mount -O -a
See Comment 7 in bug entry #1012[1]
[1] https://bugzilla.proxmox.com/show_bug.cgi?id=1012
PS: @SirMaster: I recommend undoing your change once you added the options mentioned in the above link to keep your zfs "cleaner".
pve9 /tank/lxc # zfs mount -a
cannot mount '/tank': directory is not empty
pve9 /tank/lxc # zfs list|grep tank
tank 10.3T 3.78T 192K /tank
tank/bkup 208K 3.78T 208K /bkup
tank/home 721G 3.78T 721G /home
tank/ht 8.16T 3.78T 8.16T /ht
tank/kvm 192K 3.78T 192K /tank/kvm
tank/lxc 183G 3.78T 208K /tank/lxc
tank/lxc/subvol-2200-disk-1 1.50G 4.07G 949M /tank/lxc/subvol-2200-disk-1
tank/lxc/subvol-2209-disk-1 17.9G 41.3G 8.71G /tank/lxc/subvol-2209-disk-1
tank/lxc/subvol-2214-disk-1 964M 4.10G 919M /tank/lxc/subvol-2214-disk-1
tank/lxc/subvol-2217-disk-1 51.3G 309G 10.8G /tank/lxc/subvol-2217-disk-1
tank/lxc/subvol-2219-disk-1 1.91G 2.96G 1.04G /tank/lxc/subvol-2219-disk-1
tank/lxc/subvol-2224-disk-1 192K 4.00G 192K /tank/lxc/subvol-2224-disk-1
tank/lxc/subvol-2227-disk-1 3.53G 2.47G 3.53G /tank/lxc/subvol-2227-disk-1
tank/lxc/subvol-2228-disk-1 1.99G 2.65G 1.35G /tank/lxc/subvol-2228-disk-1
tank/lxc/subvol-2244-disk-1 102G 123G 39.4G /tank/lxc/subvol-2244-disk-1
tank/lxc/subvol-2249-disk-1 1.63G 2.37G 1.63G /tank/lxc/subvol-2249-disk-1
tank/pve 1.04T 3.78T 1.04T /pve
tank/pve-zsync 167G 3.78T 208K /tank/pve-zsync
tank/pve-zsync/15Minutes 192K 3.78T 192K /tank/pve-zsync/15Minutes
tank/pve-zsync/Daily 3.49G 3.78T 192K /tank/pve-zsync/Daily
tank/pve-zsync/Daily/subvol-2200-disk-1 1.47G 3.78T 993M /tank/pve-zsync/Daily/subvol-2200-disk-1
tank/pve-zsync/Daily/subvol-2214-disk-1 957M 3.78T 919M /tank/pve-zsync/Daily/subvol-2214-disk-1
tank/pve-zsync/Daily/subvol-2265-disk-1 1.09G 3.78T 1.09G /tank/pve-zsync/Daily/subvol-2265-disk-1
tank/pve-zsync/Monthly 192K 3.78T 192K /tank/pve-zsync/Monthly
tank/pve-zsync/Weekly 192K 3.78T 192K /tank/pve-zsync/Weekly
tank/pve-zsync/subvol-2100-disk-1 554M 3.78T 552M /tank/pve-zsync/subvol-2100-disk-1
tank/pve-zsync/subvol-2217-disk-1 51.1G 3.78T 10.9G /tank/pve-zsync/subvol-2217-disk-1
tank/pve-zsync/subvol-2219-disk-1 1.85G 3.78T 1.01G /tank/pve-zsync/subvol-2219-disk-1
tank/pve-zsync/subvol-2227-disk-1 3.53G 3.78T 3.53G /tank/pve-zsync/subvol-2227-disk-1
tank/pve-zsync/subvol-2228-disk-1 1.96G 3.78T 1.35G /tank/pve-zsync/subvol-2228-disk-1
tank/pve-zsync/subvol-2244-disk-1 102G 3.78T 39.5G /tank/pve-zsync/subvol-2244-disk-1
tank/pve-zsync/subvol-2249-disk-1 1.63G 3.78T 1.63G /tank/pve-zsync/subvol-2249-disk-1
See Comment 7 in bug entry #1012[1]
[1] https://bugzilla.proxmox.com/show_bug.cgi?id=1012
PS: @SirMaster: I recommend undoing your change once you added the options mentioned in the above link to keep your zfs "cleaner".
is_mountpoint 1
ExecStart=/sbin/zfs mount -O -a
dell1 ~ # zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 40.8G 228G 96K /rpool
rpool/ROOT 3.75G 228G 96K /rpool/ROOT
rpool/ROOT/pve-1 3.75G 228G 3.75G /
rpool/swap 37.1G 261G 4.68G -
tank 819G 6.22T 83.3G /tank
tank/bkup 717G 6.22T 717G /bkup
tank/kvm 192K 6.22T 192K /tank/kvm
tank/lxc 16.6G 6.22T 208K /tank/lxc
tank/lxc/subvol-100-disk-1 1.34G 6.66G 1.34G /tank/lxc/subvol-100-disk-1
tank/lxc/subvol-110-disk-1 2.05G 5.95G 2.05G /tank/lxc/subvol-110-disk-1
tank/lxc/subvol-116-disk-1 1.30G 4.70G 1.30G /tank/lxc/subvol-116-disk-1
tank/lxc/subvol-12101-disk-1 1.69G 2.31G 1.69G /tank/lxc/subvol-12101-disk-1
tank/lxc/subvol-3032-disk-1 1.56G 8.45G 1.55G /tank/lxc/subvol-3032-disk-1
tank/lxc/subvol-3108-disk-1 1.57G 6.43G 1.57G /tank/lxc/subvol-3108-disk-1
tank/lxc/subvol-3110-disk-1 1.49G 6.51G 1.49G /tank/lxc/subvol-3110-disk-1
tank/lxc/subvol-3945-disk-1 1.14G 4.86G 1.14G /tank/lxc/subvol-3945-disk-1
tank/lxc/subvol-4444-disk-1 2.91G 11.1G 2.91G /tank/lxc/subvol-4444-disk-1
tank/lxc/subvol-9999-disk-1 1.56G 3.44G 1.56G /tank/lxc/subvol-9999-disk-1
tank/pve 192K 6.22T 192K /tank/pve
dell1 ~ # ls /tank
bkup/ kvm/ lxc/ pve/
/lib/systemd/system/zfs-mount.service
/lib/systemd/system/zfs-mount.service
ExecStart=/sbin/zfs mount -O -a
zfs mount -O -a
You can use overlay=on (ZFS settting) which does revert the mount behavior to Linux stand one, allowing mounting in non-empty directories.