Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need a second filesystem inside one of my VEs in OpenVZ that I will want mounted with mandatory locking. Does anyone know how to do this?

share|improve this question

This is normally done from /etc/vz/conf/vps.mount and vps.umount scripts

sample script


if [ -z "${VEID}" ]; then
        exit 1

[[ ! -f /etc/vz/vz.conf ]] && exit 1
[[ ! -f $VE_CONFFILE ]] && exit 1

. /etc/vz/vz.conf

mount --bind /some/where/mount_point $VE_ROOT/mount_point

see also manual around page 88

share|improve this answer

I solved same issue on machine with ploop and modern OpenVZ kernel in this way:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.