[PVE-User] more than one block device in LXC container, possible?

Emmanuel Kasper e.kasper at proxmox.com
Tue Oct 13 14:20:30 CEST 2015

On 10/13/2015 01:34 PM, hackru wrote:
> Hello
> Is it possible to mount(not bind mount) block device to lxc container? (pve4)
> What i'm trying to do - i need separate directory for /usr/ /var/ /opt/  mounts when using containers.

yes, you can do quite a lot with container mountpoints
you have two alternatives

mp0: local:102/vm-102-disk-3.raw,mp=/mnt/,size=1G
mp1: /dev/dm-3,mp=/mnt1/,size=1G

mp0 will mount here a disk image to /mnt
mp1 will mount the block device /dev/dm-3 to /mnt1 inside the container

I advise you to use the first type of mountpoints, as it allows you to
get all the boni of the pve storage backends (ex: direct resizing via
pct resize, storage independance so you can put the image on a a NFS

The second type of mountpoints would be mostly interesting, if you want
for instance to pass a plugged in USB device from the host to the guest.


More information about the pve-user mailing list