Just a quick simple wizard of moving OpenVZ to another drive, since its stored in the plain folder of /vz
I presume youâ€™ve already partitioned and formatted your drive (ext3 or ext4 works best), so we need to mount your new drive.
mkdir /vznew mount /dev/<DRIVE IDENTIFIER HERE> /vznew (find identifier via fdisk -l)
Now we need to turn off your OpenVZ VPSs and move the data, including -p to reserve permissions.
service vz stop cp -Rvp /vz/* /vznew/
Now we need to disable the old /vz folder and mount the new one as /vz
mv /vz /vzold umount /vznew mkdir /vzÂ mount /dev/<DRIVE IDENTIFIER HERE> /vz service vz start
There you go, that should start all your OpenVZ VPSs from the new drive, youâ€™re also need to tell the OS that you want it to mount that drive as /vz every time you boot.
Youâ€™re need to edit /etc/fstab and add this line, Â remember to change the drive on the first part, and if your using a different drive format, change that too (ext3 etc)
/dev/sdc1 /vz ext3 defaults 1 1
So you should end up something similar to
LABEL=/ / ext3 defaults 1 1 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 LABEL=SWAP-sda2 swap swap defaults 0 0 /dev/sdc1 /vz ext3 defaults 1 1