[SOLVED] how to share a volume data between container?

poisonVPE

Active Member
Feb 3, 2018
5
1
43
33
hello to everyone, I'm trying to create a small home server that through container provides nas, media server and other services, I'm encountering problems to make that the various containers can read and write on the same raid managed through btrfs, this is the scheme of how I would like it to work.
Code:
+-------------------+--------------------+---------------------+--------------------+
|                   |                    |                     |                    |
|                   |     container 1    |      container 2    |   container 3      |
|                   |                    |                     |                    |
|      proxmox      +---------+----------+-----------+---------+-------------+------+
|                   |         |                      |                       |
|                   |         +----------------+------------+                |
|                   |         |                |     |      |                |
|                   |         |  +----------------+--+      |                |
+---------+---------+         |  |             |  |         | +--------------+
          |                   |  |             |  |         | |              |
          |                   |  |             |  |         | |              |
+---------v---------+  +------v--v-----+-------v--v--+------v-v----+---------v------+
|  proxmox/vm/lxc   |  |     video     |    audio    |    misc     |     backup     |
+-------------------+  +------------------------------------------------------------+
+-------------------+  +------------------------------------------------------------+
|       EXT4        |  |                      BTRFS raid 1                          |
+-------------------+  +------------------------------------------------------------+
+-------------------+  +-------------------------+    +-----------------------------+
|    SSD 120GB      |  |          HDD 4TB        |    |           HDD 4TB           |
+-------------------+  +-------------------------+    +-----------------------------+
i'll try to setup the bind mount like described into the wiki but this seems not working, can someone look at my config?
in the host i mount btrfs raid at /storage path:
Code:
root@pve:/# mount | grep btrfs
/dev/sdb on /storage type btrfs (rw,relatime,space_cache,subvolid=5,subvol=/)
and change all the containers config at /etc/pve/lxc/<xxx>.conf with this bind mount config:
Code:
root@pve:/# cat /etc/pve/lxc/100.conf
#nas service -> 192.168.1.201%0A
...CUT...
mp0: /storage/Video, mp=/mnt/video
mp1: /storage/Audio, mp=/mnt/audio
mp2: /storage/Misc, mp=/mnt/misc
mp3: /storage/Backup, mp=/mnt/backup
after create a test file on /storage/Video i can not see it on a container:
Code:
-------------- PVE
root@pve:/storage/Video# ls -la
total 20
drwxr-xr-x 1 root root 16 Feb  3 10:04 .
drwxr-xr-x 1 root root 72 Feb  3 09:10 ..
-rw-r--r-- 1 root root 11 Feb  3 10:04 test.txt
-------------- LXC
root@NAS /mnt/video# ls -la
total 8
drwxr-xr-x 2 root root 4096 Feb  3 08:08 .
drwxr-xr-x 7 root root 4096 Feb  3 08:08 ..
where am I wrong? Is there a better way to get this? thx
 
I had once the same issue and had to delete a space:
mp0: /storage/Video, mp=/mnt/video -> mp0: /storage/Video,mp=/mnt/video.
 
  • Like
Reactions: poisonVPE
Would setup work with trying to share a folder in a trunkey fileserver container to a plex(ubuntu) container?
 
Would setup work with trying to share a folder in a trunkey fileserver container to a plex(ubuntu) container?
i can access all the files present into btrfs raid 1 folders in all my lxc container, in my current configuration i can access all shares with lxc debian 8/9.
If you have enough ram I recommend you zfs rather than btrfs, it facilitates management.
 
  • Like
Reactions: ajr
i can access all the files present into btrfs raid 1 folders in all my lxc container, in my current configuration i can access all shares with lxc debian 8/9.
If you have enough ram I recommend you zfs rather than btrfs, it facilitates management.

Ok cool. Thanks for the reply. I have a zfs raid setup. Would i just change btrfs to zfs through out your code above?
 

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!