Home

Proxmox configuration tricks

Bind Mounts from a central nfs-storage to a VM

mount a NFS export from a fileserver inside a kvm or lxc

nfs-server: (has ip 192.168.123.22 in this example)
edit file: /etc/exports

/YOUR/DATA/LOCATION 192.168.123.0/24(rw,fsid=5,insecure,no_subtree_check,async) 192.168.1.0/24(rw,insecure,no_subtree_check,async) 10.0.88.0/24(rw,insecure,no_subtree_check,async)

and - asuming you installed nfs-server - just type:
~# exportfs -a
REMINDERS: change fsid // change ip-ranges or limit to specific ip's from machines allowed to connect to your nfs-share

nfs-client: edit file /etc/fstab (nfs-clients are the proxmox-machines)

	192.168.123.22:/YOUR/DATA/LOCATION      /YOUR/MOUNT/POINT       nfs     rsize=32768,wsize=32768,intr,noatime
Then execute:
mkdir /YOUR/MOUNT/POINT
~# mount -a

BInd mount to VM
~# vi /etc/vz/conf/8000.mount

#!/bin/bash
. /etc/vz/vz.conf
. ${VE_CONFFILE}
SRC1=/mnt/shares
DST1=/mnt/shares
mount -n -t simfs ${SRC1} ${VE_ROOT}${DST1} -o ${SRC1}
SRC2=/home
DST2=/home
mount -n -t simfs ${SRC2} ${VE_ROOT}${DST2} -o ${SRC2}

now all you need to do is restart your vm et voila...

see also here for other examples on bind mount.