I'm totally new in these enviroments but I'm trying to learn. I installed proxmox on a single SSD, then attached one HDD(/dev/sdb) to the system for media storage. The basic idea was to create one container for Plex app and one for rtorrent app. I would like to share the same space(disk) between these containers.
On the host I mounted /dev/sdb1 to /mnt/mediastorage, and created a user called "mediastorage"(110:117) and add access to this space. Both of the containers I added this(/mnt/mediastorage) to /mediastorage mount point.Like this:
mp0: /mnt/mediastorage/,mp=/mediastorage
After that,I tried to grant access for these files for plex(107:115) user in the "plex" container:
lxc.idmap: u 0 100000 107
lxc.idmap: u 107 110 1
lxc.idmap: u 108 100125 64410
lxc.idmap: g 0 100000 115
lxc.idmap: g 115 117 1
lxc.idmap: g 116 100136 64399
On the host I did this:
root@proxmox:~# cat /etc/subuid
root:100000:65536
root:110:1
root@proxmox:~# cat /etc/subgid
root:100000:65536
root:117:1
Later, I created the other container, where created a user called rtorrent(107:115) and did the same config like the "plex" container.
There was a moment where everything seemd fine but after a reboot(host) incomprehensive things happened like this: Previous thread where it started
Noticed that at the "plex" container, appeared a new entry in the /etc/passwd file:
mediastorage:x:108:116:...etc
/etc/group:
mediastorage:x:116:
-these were not there earlier and the container was in shutdown state.
root@plex:/# ls -al /home
total 12
drwxr-xr-x 3 root root 4096 Jan 23 20:57 .
drwxr-xr-x 23 root root 4096 Jan 24 22:42 ..
drwxr-xr-x 2 nobody nogroup 4096 Jan 23 20:57 mediastorage
Can somebody explain it what happened here please? How can I achieve my main idea?(share storage between the containers) Is it possible in this way?
EDIT1: Reinstalled the container, first mounted the /mediastorage than installed plex than add uid mapping to the container's config.(Somewhere I read that maxbe it will work).Now the storage works but the plex service can't start because of permission issues. From the host -- lxc container's disk mounted as /mnt/lxc102:
/mnt/lxc102/etc/passwd:
plex:x:107:115::/var/lib/plexmediaserver:/bin/bash
/mnt/lxc102/etc/group:
plex:x:115:
ls -al /mnt/lxc102:
drwxr-xr-x 2 100000 100000 4096 Jan 25 23:22 mediastorage
ls -al /mnt/lxc102/var/lib:
drwxr-xr-x 3 100107 100115 4096 Jan 25 23:25 plexmediaserver
On the container, the plexmediaserver directory listed as nobody:nogroup again.
ls -n
rather than from the container: you will then get the real host uid, rather than always get the "overflow uid/gid" 65534:65534. Then you might do some (difficult) calculations to get an idea. Obviously the hosts uids don't map (anymore?) into the container uids.