Open main menu

OpenVZ Virtuozzo Containers Wiki β

Talk:Physical to container

RSync Command

Please check the following command, Ive used with success:

rsync -arvpz --numeric-ids --exclude dev --exclude proc --exclude tmp --exclude mnt --exclude sys -e "ssh -l root@a.b.c.d" root@a.b.c.d:/ /vz/private/123/

Migration Script

I composed a little Script to migrate a Debian Sarge Box to OpenVZ. (Some System specific steps have been removed)

#!/bin/sh
echo "Stopping VE 300..."
vzctl stop 300
echo "Creating base filesystem /dev /proc ..."
mknod /vz/private/300/dev/ptmx c 5 2
mkdir /vz/private/300/dev/pts
rm -f /vz/private/300/dev/null
mknod /vz/private/300/dev/null c 1 3
chmod o+rw /vz/private/300/dev/null
echo "Copy the tty's to VE and Set Permissions"
cp -r /dev/ttyp* /dev/ptyp* /vz/private/300/dev/
chmod o+wx /vz/private/300/dev/*typ*
echo "Creating /dev/random and Set Permissions"
mknod -m 644 /vz/private/300/dev/random c 1 8
mknod -m 644 /vz/private/300/dev/urandom c 1 9
chown root:root /vz/private/300/dev/random /vz/private/300/dev/urandom
echo "clearing mtab / fstab..."
echo -n > /vz/private/300/etc/fstab
rm /vz/private/300/etc/mtab
ln -s /proc/mounts /vz/private/300/etc/mtab
Return to "Physical to container" page.