Mounting existing ZFS datasets

moxi

Member
Aug 18, 2017
16
0
21
61
Hi all,
I run an Ubuntu machine with ZoL and docker and I want to move to PROXMOX and use my existing ZFS datasets in LXC CTs and VMs. In docker I can specify volumes where guest and host can share data. I'm trying to achieve the same in PROXMOX with LXC CTs using the Mount Option in Resources but I see no option to mount an existing folder, instead a new dataset is created for every mount point. Sharing data within these folders between guest and host seems to be working OK but how can I migrate my existing datasets? Do I have to copy all data to the new datasets?
 
@dietmar: Thanks for the quick response!
This worked nicely for a shared dataset between proxmox and a CT. Now I'm trying to do the same with a whole ZFS pool with nested datasets in it. I have mounted the pool in proxmox and I can see all files in it. Then I created a mount point in the CT like this:
# pct set 100 -mp0 /mypool,mp=/mnt/mypool
The folder mypool is indeed mounted within the CT but the folders below mypool are empty! Also the option shared=1 didn't help.
Is this normal?
 
after reading a bunch of threads about it , I think it is a default behaviour.
you can not bind mount nested pool in container.
you will need to do bind mount for each subvol with in the pool.

that is something like :

# pct set 100 -mp0 /mypool,mp=/mnt/mypool
# pct set 100 -mp1 /mypool,mp=/mnt/mypool/subvol1
# pct set 100 -mp2 /mypool,mp=/mnt/mypool/subvol2
etc...

but you only have 9 bind mounts option so...
 
  • Like
Reactions: moxi
@jim.bond.9862 : Thanks for the quick response!
I have over 15 nested datasets so it's not an option. I'm forced to do what I want directly in proxmox...
I hope the developers extend the possible mount points.
 
@jim.bond.9862 : Thanks for the quick response!
I have over 15 nested datasets so it's not an option. I'm forced to do what I want directly in proxmox...
I hope the developers extend the possible mount points.
wouldn't hold my breath for it.

what I would like to know is , if there is a structure available in Proxmox that would do what you need?
I mean right now you have a Zpool with nested datasets, what if you had a Zpool with ZvoL and datasets under ZvoL, will it bind mount and shared correctly ?
 
what I would like to know is , if there is a structure available in Proxmox that would do what you need?
This particular pool is on an external device connected over USB. Maybe it would be possible to pass it through to a CT or a VM.
I mean right now you have a Zpool with nested datasets, what if you had a Zpool with ZvoL and datasets under ZvoL, will it bind mount and shared correctly ?
I think not...