Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Mounting filesystems

61 bytes added, 10:49, 27 December 2007
Requirement: use $VZROOT
=== Requirement ===
'''On the HN we have a directory '<code>/home' </code> which we wish to make available (shared) to all VEs.'''
You would think that you could bind mount this directory, as in: '<code>mount --bind /home /vz$VZROOT/private/777/home' </code> but this does not work — the contents of <code>/home </code> cannot be seen within the VE.
This is where the second directory listed above (/vz<code>$VZROOT/root/777</code>) is used. If a VE is not started, this directory is empty. But after starting a VE, this directory contains what the VE sees as its mounted filesystemsfile systems.
The correct command to issue on the HN is:
mount --bind /home /vz$VZROOT/root/777/home
The VE must be started and the destination directory must exist. The VE will see this directory mounted like this: