Cannot see new files added from KVM on LXC container using bind mounts

Juan Carlos Alonso

New Member
Sep 17, 2016
2
0
1
39
Hi!

I have the following setup:


Proxmox with two hard drives
-> Disk 1 for OS
-> Disk 2 for files
And then 2 machines:
-> KVM with physical disk2 attached (https://pve.proxmox.com/wiki/Physical_disk_to_kvm)
-> LXC container with the same disk2 using bind mounts (https://pve.proxmox.com/wiki/LXC_Bind_Mounts)

From each machine I can read files but if I create new ones, they are only visible from the same machine.

If I restart the KVM then the files written by the LXC container appears.

Can someone explain why this is happening and how to fix it?

Thanks!
 
You cannot do that. KVM mounts a block device, which is a dumb array of bytes. LXC "mounts" a file system which is a higher abstraction over the block device (has files & directories, for example).
The only way to have access in both is to share that filesystem (NFS, SMB) in one of the machines and network mount it in the other
 
  • Like
Reactions: Juan Carlos Alonso