Difference between revisions of "LXC Bind Mounts"

From Proxmox VE
Jump to navigation Jump to search
(page created)
m (Protected "LXC Bind Mounts" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
(22 intermediate revisions by 8 users not shown)
Line 1: Line 1:
= Introduction =
#REDIRECT [[Linux_Container#_bind_mount_points]]
This is an experimental feature.
Bind mounts allow you to access a directory, or a storage volume from your Proxmox VE host inside a container. There can be many purposes:
* Accessing your home directory in the guest
* Accessing a USB device directory in the guest
* Accessing a NFS mount from in the host in the guest
Note that the device you want to use has to be already accessible in the pve host. For security reasons, it is not possible to mount a device of NFS share directly in the guest.
= Step by step examples =
Suppose you want to access the following directories in your LXC container with ID100:
* /target which is a local directory
* /mnt/pve/freenas which is a NFS mounted directory
Then you need to add the following parameters to /etc/pve/lxc/100.conf
mp0: /target/test,mp=/target
mp1: /mnt/pve/freenas,mp=/mnt/pve/freenas
reboot your container and log in:
pct enter
mount | egrep '(target|freenas)'
/dev/dm-0 on /target type ext4 (rw,relatime,errors=remount-ro,data=ordered)
= Caveats =
Settings a bind mount, prevent the backup of the whole container.
This is to prevent large exported directory that you had mounted in the guest.
[[Category: HOWTO]][[Category: Technology]]

Latest revision as of 08:57, 22 September 2016