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.

johannes
  • 125
  • 1
  • 5

1 Answers1

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.

Jay
  • 6,544
  • 25
  • 34