0

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.

0

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.

| 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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