OpenVZ Forum


Home » General » Support » *SOLVED* Mounting directory within a VE
*SOLVED* Mounting directory within a VE [message #10791] Thu, 01 March 2007 19:07 Go to next message
mperkel is currently offline  mperkel
Messages: 253
Registered: December 2006
Senior Member
This should be simple. I want to start a VE with a directory mounted outside the private area. How do I do that?

Thanks in Advance ...



[Updated on: Mon, 05 March 2007 11:59] by Moderator

Report message to a moderator

Re: Mounting directory within a VE [message #10793 is a reply to message #10791] Fri, 02 March 2007 07:25 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Hello,

after start of VE do:
# mount -n -o bind /pub /vz/root/101/pub
where 101 is an ID of VE in question.

If you want to do it automatically on VE start create a /etc/vz/conf/101.mount file with the following content:
#! /bin/sh
mount -n -o bind /mnt /vz/root/101/pub
and add executable bit to this file.

HTH,
Vasily.

Re: Mounting directory within a VE [message #10794 is a reply to message #10791] Fri, 02 March 2007 14:38 Go to previous messageGo to next message
mperkel is currently offline  mperkel
Messages: 253
Registered: December 2006
Senior Member
Thanks - that's exactly what I was looking for. I didn't know that part about creating the mount file.

Re: Mounting directory within a VE [message #11082 is a reply to message #10793] Tue, 13 March 2007 09:56 Go to previous messageGo to next message
szocske is currently offline  szocske
Messages: 35
Registered: September 2006
Member
Can multiple VEs mount the same directory?
It's fine even if read-only.

And if a file is mmapped from a shared mount, does that duplicate the IO and memory usage?
Re: Mounting directory within a VE [message #11089 is a reply to message #11082] Tue, 13 March 2007 12:32 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Quote:

Can multiple VEs mount the same directory?
It's fine even if read-only.
Yes, of course, even writable mounts are allowed.
Quote:

And if a file is mmapped from a shared mount, does that duplicate the IO and memory usage?
No, no duplicate memory usage: physical pages are the same.

Vasily
Re: Mounting directory within a VE [message #11093 is a reply to message #11089] Tue, 13 March 2007 12:56 Go to previous message
szocske is currently offline  szocske
Messages: 35
Registered: September 2006
Member
I think a major restructuring of our testing farm is in order to take advantage of this feature Smile

Thank you for your answer.
Previous Topic: Success: Nagios and Hyperic on OpenVZ VEs
Next Topic: *SOLVED* Typical Mem/HD/CPU settings
Goto Forum:
  


Current Time: Sun Aug 24 08:13:56 GMT 2025

Total time taken to generate the page: 0.06233 seconds