Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want my vm to use a filesystem tree consisting of multiple filesystem mounted together:

mount <root-path> /var/lib/vz/private/<id>/
mount <home-path> /var/lib/vz/private/<id>/home/

Using this layout vzctl start fails since vzquota can not work on busy directories. /var/lib/vz/private/<id>/ is busy since there is something mounted inside it.

How can I create such a filesystem tree and still use it for a vm?

Some solutions which do not work

mount --bind

When bind mounting a directory, the busy flag is preserved, and is therefore still preventing vzquota from working.

aufs

Using aufs with only one source filesystem is much alike bind mounting. Unfortunately my root filesystem is already aufs, and aufs on debian squeeze cannot be used inside aufs itself.

share|improve this question

1 Answer 1

mount --bind does work, you are simply binding on the wrong directory.

You need to mount --bind on the ROOT directory defined in the <VEID>.conf file, something like:

mount --bind /what/to/bind /var/lib/vz/root/<id>/home/

Example script: http://wiki.openvz.org/Bind_mounts. This will make a <VEID>.mount directory which is called directly after the container is mounted.

share|improve this answer
    
If i mount directory to /var/lib/vz/root/<id>/ will the disk quota be followed? –  johannes Oct 13 '12 at 10:40

Your Answer

 
discard

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.