OpenVZ Forum


Home » General » Support » moving containers need help
moving containers need help [message #42851] Wed, 08 June 2011 08:57 Go to next message
Duke is currently offline  Duke
Messages: 1
Registered: June 2011
Junior Member
Hi all,

I have a question that seems straightforward but before ruining my system I'd rather have your view on this.

My system is currently running openvz kernel and standard install in the directory /vz but due to limited space on my primary partition (/dev/sda2 mounted on /) I created a new partition and I would like to move all containers to this new partition /dev/sda3

What should I do ?

I think I should tar/mv all the /vz directory to this new partition and then change my fstab to mount /dev/sda2 as /vz ?

But is this the only change required ?

thanks in advance for your help.
Duke
Re: moving containers need help [message #42912 is a reply to message #42851] Thu, 16 June 2011 11:34 Go to previous message
seanfulton is currently offline  seanfulton
Messages: 105
Registered: May 2007
Senior Member
Simplest thing is:

mkdir /newvz

mount /dev/sda2 /vz
mount /dev/sda3 /newvz

/etc/rc.d/init.d/vz stop

cd /vz
find . -print | cpio -pvdum ../newvz

when it's done,
umount /vz
umount /newvz

mount /dev/sda3 /vz
/etc/rc.d/init.d/vz start

THEN MAKE SURE YOU EDIT /etc/fstab

With this approach, you will still have your data on /dev/sda2 if for some reason you messed it up, and you can retrieve it by doing:
mkdir /oldvz
mount /dev/sda2 /oldvz

Good luck!

sean
Previous Topic: Can't Execute Mount on Container to Mount From Different Machine Server
Next Topic: mysql on HM
Goto Forum:
  


Current Time: Tue Jul 29 22:05:42 GMT 2025

Total time taken to generate the page: 0.06269 seconds