3

I have a number of ZFS sub-filesystems (so that I can granularly manage snapshots and ZFS options) like so:

tank/media
tank/media/pictures
tank/media/pictures/photos
tank/media/movies
tank/media/music
tank/media/documents
tank/media/documents/public

I am running Debian GNU/Linux 8.6 (jessie) with ZFS-on-Linux, kernel 4.4.19-1-pve. My goal is to share the parent ZFS filesystem (tank/media) with a LXC container via a bind mount and have the sub-filesystems be accessible.

If I bind mount tank/media inside the container, then the sub ZFS filesystems (E.G. tank/media/pictures) do not show up. I need to mount --make-rshared tank/media in order for the sub-mounts to also appear.

How can I make ZFS sub filesystems be mounted make-rshared by default using ZFS on Linux?

1

I have found that mounting with the rbind (rather than bind) option in the lxc mount line solves the issue (syntax for proxmox):

lxc.mount.entry: /tank/media media none rbind,create=dir,optional 0 0

Going off the RedHat documentation on sharing mounts, rbind achieves replication of mounts on the source in the bound directory (which is what we need), the difference being make-rshared allows a mount on the bind to be reflected in the source.

Just came across the issue myself, and this is the only relevant result on google, so I thought it was appropriate to give an answer despite the age of the question.

  • Had to wait until the next reboot of the server, but I tried this solution and it worked perfectly. Thank you!!! – Josh Jul 23 '17 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.