Comments on OpenVZ: Mounting Host Devices/Partitions/Directories In A Container With Bind Mounts (Debian/Ubuntu)

OpenVZ: Mounting Host Devices/Partitions/Directories In A Container With Bind Mounts (Debian/Ubuntu) Sometimes you are in a situation where you need to mount a hard drive, partiiton or directory from the OpenVZ host inside an OpenVZ container - for example, you add a fast SSD to the host and want to put your container's MySQL databases on it to make MySQL faster. This tutorial explains how you can mount host devices/partitions/directories in an OpenVZ container with bind mounts.

4 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Gerrie

Just wondering, if you make backups is the content of /var/lib/mysql in your container being stored in the backup? 

https://bugzilla.proxmox.com/show_bug.cgi?id=459#c0

 

By:

Thanks for the great tutorial - wondering if there's any way to say segment off this SSD (which is exactly what im doing) into size limited chunks for each container, much like proxmox/vz already segments up /var/lib/vz with limits. Rather give 10 or 15 gigs of the small SSD to each container than let them all compete for it.

By: Mike

You should be able to assign individual partions in the bind mount script. If your ssd is /dev/sdb and has partitions /sdb1 and /sdb2 you would then use the specific partion that you want to bind to the container in the script.

By: saar

Thanks, that was really helpful 

especially since theres no documentation on openvz site :/