Help to understand mount points

juju01

Member
May 16, 2020
87
3
13
I am getting myself confused with how to add storage on a separate local disk ( disk 2 ) to my containers - which live on another disk. ( disk 1)

For example, I have setup a container with zfs on disk 1. This is for a postgres database. I'd like to store the database itself - not the container, on disk 2. How do I add this storage from disk 2 and tell postgres to store its database there?

I also have another container on disk 1 for other things. I'd like to create a folder on disk 2 where I can store files ( csv, excel etv ) for programs on this container.

I am not sure how to mount disk 2? Do I partition it so different containers have their own space or just one big storage tank with custom mount point paths for each container/application? I'd like to use a single disk zfs setup for this one. Any insights into how to set this correctly will be appreciated.
 
You can try the following:
  1. Go to Node→Disks→ZFS and click Create: ZFS to add your second disk as ZFS storage to Proxmox VE.
  2. Go to your container→Resources→Add→Mount point. As storage you select the ZFS storage that you created in step 1. Path is for inside the container, for example entering /disk2/files would create this directory in the container.
  3. You can test this by
    1. On the host: zpool list
    2. In the container: dd if=/dev/urandom of=/disk2/files/test bs=1M count=5000
    3. On the host again: zpool list. ALLOC should have increased and FREE decreased.
    4. zfs list should show a line for each folder that you add to your container
 
You can try the following:
  1. Go to Node→Disks→ZFS and click Create: ZFS to add your second disk as ZFS storage to Proxmox VE.
  2. Go to your container→Resources→Add→Mount point. As storage you select the ZFS storage that you created in step 1. Path is for inside the container, for example entering /disk2/files would create this directory in the container.
  3. You can test this by
    1. On the host: zpool list
    2. In the container: dd if=/dev/urandom of=/disk2/files/test bs=1M count=5000
    3. On the host again: zpool list. ALLOC should have increased and FREE decreased.
    4. zfs list should show a line for each folder that you add to your container

Hello Dominic - Sorry for the delayed reply. Finally got around to looking at this. I setup the zfs pool and the mount point as directed above. I installed postgres in this container. And I needed to move a postgres conf file into my mount point folder. I am running into permissions issue. I cant rsync the file over. After some research I found this wiki article about mount points on unprivileged containers.

https://pve.proxmox.com/wiki/Unprivileged_LXC_containers

It says to change the container UID mapping in the file /etc/pve/lxc/1234.conf . Mine is /etc/pve/lxc/111.conf

But my file doesn't look like anything shown in the example! very very different file. here is my file:

Code:
arch: amd64
cores: 1
hostname: database
memory: 1024
mp0: /databank/database,mp=/storage,backup=1,shared=1
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=1E:47:70:1B:E2:88,ip=dhcp,type=veth
ostype: ubuntu
rootfs: local-zfs-vmstore:subvol-111-disk-0,size=30G
swap: 1024
unprivileged: 1

what to do now?