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

Juan Carlos Alonso

New Member
Sep 17, 2016
2
0
1
38
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

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!