OpenVZ Forum


Home » General » Support » difference between /vz/private/ and /vz/root/ ? [Solved]
difference between /vz/private/ and /vz/root/ ? [Solved] [message #20467] Tue, 18 September 2007 12:27 Go to next message
piavlo is currently offline  piavlo
Messages: 159
Registered: January 2007
Senior Member
Hi,

What is the difference between /vz/private/ and /vz/root/ ?
I see that /vz/private/101 and /vz/root/101 are hard linked.
So now i want to move /vz/private/101 to dedicated filesystem
how should i handle /vz/root/101?
Can i just symlink /vz/root/101 to /vz/private/101?

Thanks
Alex

[Updated on: Sat, 22 September 2007 19:44]

Report message to a moderator

Re: difference between /vz/private/ and /vz/root/ ? [message #20492 is a reply to message #20467] Wed, 19 September 2007 06:02 Go to previous messageGo to next message
vaverin is currently offline  vaverin
Messages: 708
Registered: September 2005
Senior Member
Hi Alex,

/vz/private/<VEID> are private areas, i.e. the directories containing the private files of the given VEs.

/vz/root/<VEID> -- are mountpoints. The private area is mounted to the /vz/root/<VEID> directory on the Hardware Node and provides VE users with a complete Linux file system tree.

If you want to move VE files from HN to some other place it's better to avoid /vz/private using and handle /vz/root directory.

thank you,
Vasily Averin
Re: difference between /vz/private/ and /vz/root/ ? [message #20502 is a reply to message #20492] Wed, 19 September 2007 09:53 Go to previous messageGo to next message
piavlo is currently offline  piavlo
Messages: 159
Registered: January 2007
Senior Member
Hi Vasya,

vaverin wrote on Wed, 19 September 2007 08:02


/vz/private/<VEID> are private areas, i.e. the directories containing the private files of the given VEs.

/vz/root/<VEID> -- are mountpoints. The private area is mounted to the /vz/root/<VEID> directory on the Hardware Node and provides VE users with a complete Linux file system tree.


Ok now that i stopped VE i see that /vz/root/<VEID> is empty and not hard liked to /vz/private/<VEID> anymore.
This means i can just move /vz/private/<VEID> to separate partition ,on the same HN, while VE is stopped.

Quote:

If you want to move VE files from HN to some other place it's better to avoid /vz/private using and handle /vz/root directory.

I did not get the meaning of this comment, could you please
elaborate?

Thanks
Alex
Re: difference between /vz/private/ and /vz/root/ ? [message #20506 is a reply to message #20502] Wed, 19 September 2007 10:35 Go to previous messageGo to next message
vaverin is currently offline  vaverin
Messages: 708
Registered: September 2005
Senior Member
piavlo wrote on Wed, 19 September 2007 13:53

Ok now that i stopped VE i see that /vz/root/<VEID> is empty and not hard liked to /vz/private/<VEID> anymore.
This means i can just move /vz/private/<VEID> to separate partition ,on the same HN, while VE is stopped.

Quote:

If you want to move VE files from HN to some other place it's better to avoid /vz/private using and handle /vz/root directory.

I did not get the meaning of this comment, could you please
elaborate?



It's disk-quota related issue.

I would note that disk quota is calculated on /vz/private/<VEID> subtree. However it's able to track the operation only if VE is mounted. Quota is initialized on the first VE mount -- it is relative log procedure. When VE unmounts the collected quota information is saved to special file that reads again on the next VE start.

However if you have changed something inside private area where VE was unmounted, it makes inconsistent the quota information saved in file. Unfortunately we will know nothing about this fact and quota will show incorrect values when VE will be started again.

Thank you,
Vasily Averin
Re: difference between /vz/private/ and /vz/root/ ? [message #20507 is a reply to message #20506] Wed, 19 September 2007 11:28 Go to previous messageGo to next message
piavlo is currently offline  piavlo
Messages: 159
Registered: January 2007
Senior Member
Quote:

However if you have changed something inside private area where VE was unmounted, it makes inconsistent the quota information saved in file. Unfortunately we will know nothing about this fact and quota will show incorrect values when VE will be started again.

Then how can i force full quota recalculation then VE is starting(or is already started) similar to quotacheck command from
the Linux quota tools?

Thanks
Alex
Re: difference between /vz/private/ and /vz/root/ ? [message #20509 is a reply to message #20507] Wed, 19 September 2007 11:55 Go to previous messageGo to next message
vaverin is currently offline  vaverin
Messages: 708
Registered: September 2005
Senior Member
You can use 'vzquota drop' to remove quota file.

But to re-init quota you need restart VE -- I'm not sure that initialization on running VE is possible.

[Updated on: Wed, 19 September 2007 11:58]

Report message to a moderator

Re: difference between /vz/private/ and /vz/root/ ? [Solved] [message #23687 is a reply to message #20467] Thu, 22 November 2007 09:22 Go to previous messageGo to next message
RobinVossen is currently offline  RobinVossen
Messages: 36
Registered: November 2007
Member
Sorry for Replying on this.
Since its old and Its a Hijack Question.
But I just cant put my finger on this.
Well I want to mount /vz/portage to the running system
Do I have to mount to the root or the private?
I tryed both.. And sometimes It works.. And sometimes it doesnt.
Well I cross-mount the system like crazy.. (I first mount /var/lib/vz/private (and root) to /vz/private (and root), then I want to mount Portage in that again. from /vz/protage to /vz/../usr/portage) but well sometimes it works and sometimes it doesnt.
How to fix? What do I have to mount? And were to?
I just want to have one Portage tree on my box -.-' should that be this hard.. Sad
Re: difference between /vz/private/ and /vz/root/ ? [Solved] [message #23688 is a reply to message #23687] Thu, 22 November 2007 09:56 Go to previous messageGo to next message
piavlo is currently offline  piavlo
Messages: 159
Registered: January 2007
Senior Member
If you want to share gentoo portage tree for you VEs with HN
then you can simply bind mount it
>cat /etc/vz/bin/mount-portage
#!/bin/bash

mount -n --bind /usr/portage /vz/root/${VEID}/usr/portage
exit ${?}
>chmod 700 /etc/vz/bin/mount-portage

now symlink the VE id you want to have portage in
>cd /etc/vz/conf
>ln -snf /etc/vz/bin/mount-portage 105.mount

Next time you start the VE it will auto bind mount /usr/portage from HN
Re: difference between /vz/private/ and /vz/root/ ? [Solved] [message #23689 is a reply to message #23687] Thu, 22 November 2007 10:14 Go to previous messageGo to next message
vaverin is currently offline  vaverin
Messages: 708
Registered: September 2005
Senior Member
There is simple recomendation: do not touch /vz/private, use /vz/root instead.

However I do not understand what do You means under "cross-mounts".
Could You please explain why You need to mount something to /vz/private? If you do not have enough diskspace on filesystem where /vz is placed -- you can just make symlink /vz --> something else. IMHO it should work.

Thank you,
Vasily Averin
Re: difference between /vz/private/ and /vz/root/ ? [Solved] [message #23690 is a reply to message #23688] Thu, 22 November 2007 10:50 Go to previous messageGo to next message
RobinVossen is currently offline  RobinVossen
Messages: 36
Registered: November 2007
Member
Well I mount the Private since else the program just doesnt work...
if I run vzctl start 1 it says it cant find /vz/private/1
So thats why I mount that one.. And well I thanks for that script. But I already got that Razz the thing is, it doesnt work. Since I mount it when the system already started With Running. (I dont want users to be able to use portage. Only when I want to run portage I want to be able to) so I mount the portage tree to /vz/root/1/usr/portage when 1 is running.
The /vz/root/ folder is mounted from the /var/lib/vz/root/ so thats CrossMounting in case you arnt known with that term.
Example of Cross-Mounting:
mount -o bind /var /home/user
mount -o bind /etc /home/user/etc
Now you can write to the etc folder using 3 Folders.
/etc /home/user/etc /var/etc

thats cross mounting
Re: difference between /vz/private/ and /vz/root/ ? [Solved] [message #23691 is a reply to message #23690] Thu, 22 November 2007 11:09 Go to previous messageGo to next message
vaverin is currently offline  vaverin
Messages: 708
Registered: September 2005
Senior Member
Hi Robin,
Where You have VE private areas? Usually it is /vz/private direcory. Why You do not use it too?

I would note that script provided by piavlo should work well. But it looks like You have changed usual mounting schema -- and probably it is the cause of your troubles.

thank you,
Vasily Averin
Re: difference between /vz/private/ and /vz/root/ ? [Solved] [message #23693 is a reply to message #23691] Thu, 22 November 2007 11:33 Go to previous message
RobinVossen is currently offline  RobinVossen
Messages: 36
Registered: November 2007
Member
I think my problem is there.
I just installed it like the Doc said.
And well the Private and the Roots are in the most Crazy dir. I am really annoyed that they are there..
/var/lib/vz/private....
So, I mount them to /vz/private every time the system boots..
Previous Topic: I get OpenVZ now, but what about NFS support?
Next Topic: FTP login problem
Goto Forum:
  


Current Time: Tue Feb 27 07:12:43 GMT 2024

Total time taken to generate the page: 0.02702 seconds