OpenVZ Forum


Home » General » Support » *SOLVED* vps's directory on different hard disk
*SOLVED* vps's directory on different hard disk [message #14313] Fri, 22 June 2007 07:46 Go to next message
onyx is currently offline  onyx
Messages: 7
Registered: May 2007
Junior Member
Hi!

Is it possible, to have a VPS's directory on a different device, than /vz? For example I have two 140G hard drives, in raid1, and on top of that I have LVM, for the ability to have snapshots, and this is mounted az /vz. I'd like to have /vz/private/101/var to be on another device. Can I do that?

Thanks in advance!
Balint

[Updated on: Mon, 25 June 2007 08:29] by Moderator

Report message to a moderator

Re: vps's directory on different hard disk [message #14317 is a reply to message #14313] Fri, 22 June 2007 08:51 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
You can create a bind mount to /vz/root/101/var after VE start. This procedure can be automized by <veid>.mount file.

HTH,
Vasily.
Re: vps's directory on different hard disk [message #14324 is a reply to message #14317] Fri, 22 June 2007 11:45 Go to previous messageGo to next message
onyx is currently offline  onyx
Messages: 7
Registered: May 2007
Junior Member
But then the size of the VPS can't be bigger than the size of the hard drive, containing /vz. I know about raid10, or multiple phisical devices with LVM, but I'd like to avoid theese.

Thanks anyway.

[Updated on: Fri, 22 June 2007 11:46]

Report message to a moderator

Re: vps's directory on different hard disk [message #14325 is a reply to message #14324] Fri, 22 June 2007 12:01 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Sorry, don't get you.

Assume, you have /vz on /dev/hda1. It means, that VEs private files are located in /vz/private/<veid>. Then you have one more hard disk: hdb. After `vzctl mount` command you can give the following command:
mount /dev/hdb1 /vz/root/<veid>/var
After `vzctl start` your VE will be able to write in /var as much information, as big is hdb1 (but not /vz)

HTH,
Vasily.





Re: vps's directory on different hard disk [message #14331 is a reply to message #14325] Fri, 22 June 2007 12:20 Go to previous messageGo to next message
onyx is currently offline  onyx
Messages: 7
Registered: May 2007
Junior Member
Vasily Tarasov wrote on Fri, 22 June 2007 08:01

Sorry, don't get you.

Assume, you have /vz on /dev/hda1. It means, that VEs private files are located in /vz/private/<veid>. Then you have one more hard disk: hdb. After `vzctl mount` command you can give the following command:
mount /dev/hdb1 /vz/root/<veid>/var
After `vzctl start` your VE will be able to write in /var as much information, as big is hdb1 (but not /vz)

HTH,
Vasily.



But if I stop the VPS, every data will be - as in your example - on /dev/hda1, including /vz/private/<veid>/var. Or this is not as I think, and /vz/private/<veid>/var will be empty this time, because all the data it contains is on /dev/hdb1?

Re: vps's directory on different hard disk [message #14332 is a reply to message #14331] Fri, 22 June 2007 12:50 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Right, if initially /vz/private/<veid>/var was empty, after stop of VE all data placed by VE in /var will be on hdb1 (because hdb1 was mounted on /vz/root/veid/var), and /vz/private/<veid>/var - will be empty.

Just try it Wink

Vasily.
Re: vps's directory on different hard disk [message #14336 is a reply to message #14332] Fri, 22 June 2007 17:01 Go to previous message
onyx is currently offline  onyx
Messages: 7
Registered: May 2007
Junior Member
Strange, I replied to this post, but now I can't see it. So again:

Thank you for your help, I'll try it Smile
Previous Topic: *RESOLVED* iptables
Next Topic: VPS: sshd dead but subsys locked
Goto Forum:
  


Current Time: Tue Oct 07 14:28:39 GMT 2025

Total time taken to generate the page: 0.24148 seconds