OpenVZ Forum


Home » General » Support » *SOLVED* Accessing Files outside the VPS
*SOLVED* Accessing Files outside the VPS [message #9425] Tue, 02 January 2007 18:08 Go to next message
mperkel is currently offline  mperkel
Messages: 253
Registered: December 2006
Senior Member
Is there a quick and easy way to allow a VPS to access files from the host outside of it's root?

[Updated on: Sun, 07 January 2007 18:21] by Moderator

Report message to a moderator

Re: Accessing Files outside the VPS [message #9439 is a reply to message #9425] Wed, 03 January 2007 11:20 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

From the host:
# mount --bind /host/directory-to-grant-to-VE /vz/root/<VEID>/directory-inside-VE

you can add this command to VEID.mount/umount scripts to create this mount on each VE start.


http://static.openvz.org/userbars/openvz-developer.png
Re: Accessing Files outside the VPS [message #9445 is a reply to message #9425] Wed, 03 January 2007 14:47 Go to previous messageGo to next message
mperkel is currently offline  mperkel
Messages: 253
Registered: December 2006
Senior Member
hey, that's kool. I didn't know mount could do that.

Re: Accessing Files outside the VPS [message #9468 is a reply to message #9445] Thu, 04 January 2007 20:26 Go to previous messageGo to next message
Kakihara is currently offline  Kakihara
Messages: 6
Registered: January 2007
Junior Member
Is it normal that the VE Administrator could umount this ?
Re: Accessing Files outside the VPS [message #9528 is a reply to message #9468] Tue, 09 January 2007 06:55 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Yes, it is expected behaviour.
Re: Accessing Files outside the VPS [message #9963 is a reply to message #9439] Wed, 31 January 2007 21:05 Go to previous messageGo to next message
seyko is currently offline  seyko
Messages: 2
Registered: January 2007
Junior Member
About VEID.umount script: Is there a need to umount something?
It's looks that all mounts inside /vz/root/${VEID} are unmounted automaticaly by openvz tools

I prefer classic style of /etc/mtab (it's file and not symlink to /proc/mounts in my VE0 and VE). I found that vztools do not remove unmounted info from VE0 /etc/mtab. Therefore there is only one line in my vps.umount:

#!/bin/sh
sed -ie "\|^.* /vz/root/${VEID}/.* .*\$|d" /etc/mtab
Re: Accessing Files outside the VPS [message #9967 is a reply to message #9963] Thu, 01 February 2007 07:56 Go to previous message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Hello,

You're right, and your way is good on my mind!

I've used the following technic:
1) in <veid>.mount I have mount with -n option, so no information about this mount appears in /etc/mtab in VE0
2) there is no <veid>.umount at all

But I like your way more,
Thanks,
Vasily
Previous Topic: Some problem !!!!
Next Topic: Error in Slackware Template - Where to upload the fix?
Goto Forum:
  


Current Time: Tue Feb 27 13:08:54 GMT 2024

Total time taken to generate the page: 0.02637 seconds