The ability to create a system image serves many purposes: for creating your own system with your favorite applications pre-installed, preparing an image of an easily mountable game server, cloning a fine-tuned server, or simply making a backup of your system.
The process is really quite simple and may be done by anyone who follows these steps carefully:
You must first create a data disk with a maximum of 3 GB (this limit is temporary). This can be done from the disk creation interface in your hosting account. If you do not have enough disk space, you can purchase more during the operation.
Simply attach your new disk to the server you want to make an image of.
To create the image of your system and copy it to your newly-created data disk, you must first use the UNIX command dd
.
The syntax of the command requires a bit of attention, however. Here is an example that we will examine in a second:
dd if=/dev/xvda of=/dev/xvdc conv=sync
The if
parameter corresponds to the path of the source (the system that we want to copy), while of
is the path to the destination disk (the data disk where you want to copy the data that you just created).
df
command.
Please note, however, that the path to use for the if
operation will always be /dev/xvda
. If not set up this way, the image will not be bootable.
dd
takes some time, because it is copying the source disk to the destination disk bit by bit.
root=/dev/xvda1
on the boot command line). If you copy an existing system disk, the partition table will be correct. Otherwise, please make sure your primary disk partition contains your system files and is bootable. You can also add a second partition containing a swap space.
Return to your disk management interface in your Gandi hosting account and unmount the destination disk (onto which you have copied the system image) from your server.
On the Gandi.net control panel, you are now able to define a kernel for the data disk which is adapted to the image you have just created.
For example, take a data disk on the control panel that you want to transform into a system/image disk:
Use the link to modify the disk information. You will find an option at the bottom of the page to use the data disk as a system disk:
You will then have access to the advanced options found on a system disk:
Now all that remains is to create a new server. The only difference will be in the choice of your system, as you now have an extra option: use your custom-made image!
Afterwards, if you find you have forgotten something or need to correct a parameter, all you have to do is attach the image to a server, correct the error and detach the disk. The image will be available once again for creating new servers without having to spend time making copies via dd
again.
The process is essentially the same as described above, except for these extra steps:
dd
command as described above.
dd
.
For example, it may be that the particular requirements of your runtime CD require a specific volume some, or specific settings for the dd
command in order to work. We can't know this in advance, and so we can't tell you exactly how to do this.
Therefore, please do not attempt this unless you are sure you know exactly what you are doing. We won't be able to guide you through the steps.