Changes

Jump to: navigation, search

Physical to container

894 bytes added, 07:27, 9 February 2007
added copy method using tar with live cd or exclude file
Copy all your data from the machine to an OpenVZ box. Say you'll be using VE with ID of 123, then all the data should be placed to <code>/vz/private/123/</code> directory (so there will be directories such as <code>/vz/private/123/bin</code>, <code>etc</code>, <code>var</code> and so on). This could be done by scp or rsync.
 
'''Advantage:''' Your system doesn't really go down.
 
Another way to do is using a live cd, booting up and use tar to dump the complete disk in a tar you save over the network or on a USB device.
 
Another approach is using tar and excluding some dirs, you could do it like this:
 
Create a file /tmp/excludes.excl with these contents:
.bash_history
/dev/*
/mnt/*
/tmp/*
/proc/*
/sys/*
/usr/src/*
 
Then create the tar. But remember, when the system is 'not' using udev, you have to look into /proc/ after creating your VE because some devices might not exist. (/dev/ptmx or others)
 
# tar cjpf /tmp/mysystem.tar.bz2 / -X /tmp/excludes.excl
 
Naturally, you can only do this when the critical services (MySQL, apache, ..) are stopped and your /tmp filesystem is big enough to contain your tar.
 
'''Advantage:''' You don't need to boot from a livecd, so your system doesn't really go down.
== Set VE parameters ==
6
edits

Navigation menu