Hyper Open Edge Cloud

Howto Clone A VPS By Clonezilla On Rapid.Space

How to Clone A VPS By Clonezilla On Rapid.Space
  • Last Update:2021-07-22
  • Version:001
  • Language:en

How to Clone A VPS By Clonezilla On Rapid.Space

This tutorial teaches how to clone a Rapid.Space machine by Clonezilla. 

Agenda

  • Prerequisites
  • Boot Clonezilla
  • Configure Network
  • Mount point
  • Clone the image
  • Verification

Prerequisites

To use Clonezilla on Rapid.Space, you are supposed to Deploy Clonezilla on the VPS you want to clone.

The image of Clonezilla Live, you can find the stable live release (.iso) from Clonezilla - Downloads Page. You can also find MD5SUMS from the checksums list. 

Boot Clonezilla

Select Clonezilla as boot device by sending the corresponding number.

Please follow the offcial documentation: Clonezilla Live Doc to use it. 

Choose language and keyboard layout

Set Language and Keyboard to get started.
The default keyboard layout is US keybaord, therefore if you are using US keyboard, just press enter (i.e. use the option "Keep").
If you want to change keymap, you can choose "Change" then follow the dialog to change it.

Choose "Start Clonezilla"

Let's start clonezilla!

Choose "device-image" option

Pay attention to the hints, too. You might need that:
Note: From now on, if multiple choices are available, you have to press space key to mark your selection. A star sign (*) will be shown when the selection is done.

Choose "enter_shell" option

Here we will enter command line prompt to configure the network and mount the image directory to a SSH sever.
There are other options, e.g. ssh_server, samba, nfs or webdav, AWS S3 or Openstack Swift, you can use when network is available; local_dev when 2nd local disk is available.

Configure IPv6

Entering shell, you should be logged in as root of debian-based Clonezilla, if you are not as root, you can simply type $ sudo su - to be root.

To install IPv6 address for Clonezilla, you can refer How To Install IPv6 Inside The VPS:

$ nano /etc/network/interface

Type the information from your hosting subscription into /etc/network/interface. 

$ ifup ens4

Mount Clonezilla image directory

Here is the important command line to mount the image directory:

$ LC_ALL=C sshfs USERNAME@HOSTNAME_OR_IP:/REMOTE/DIRECTORY /home/partimag -p 22 -o noatime

Replace the username, hostname and remote directory with your server. /home/partimag is the local mounting point defined by Clonezilla. More information about SSHFS.

Once it's correctly mounted, you can exit the shell with ctrl + d or typing exit in the shell.

Choose "Beginner" mode to run wizard

Here we choose "Beginner" mode. 

If you choose "Expert" mode, you will have some chances to choose advanced parameters, e.g. imaging program, compression program, etc.. You can see more details here.

Save local disk

Now we can select "savedisk" option.

Input image name

Enter the image name, Clonezilla will give an image name based on date and time, feel free to change it

select source disk

Select the source disk "vda" we want to save:

 

Select compression option

Select the compression option "-z1p" (Use parallel gzip), or "-z9p" (parallel zstd, will be faster and the size is slightly smaller than that of gzip)

 

Advanced extra parameters

Select if the source file system need to be checked or not.

Here we skip the file system check. However, if you are not sure if the source file system is clean, it's recommended to do such a check.

Advanced extra parameters

Select if you want to check the saved image.

By default this will be done. It's recommended to do such a check.

Advanced extra parameters

Select if you want to encrypt the image.

By default the image won't be encrypted. If you want to encrypt the image, it will prompt you to enter a passphrase for the image.
Note: You have to remember the passphrase otherwise the image will NOT be useable in the future. There is no back door to decrypt the image.

Advanced extra parameters

Select the mode you want after the image saving is done.

By default we will choose later, but if you have decided, you can choose to reboot or poweroff the machine.

Save the image

Clonezilla will prompt us the command to save the image. This command is very useful when you want to create a customized Clonezilla live.

Comfirm the action 

Before starting to save the disk image, we still have a chance to say yes or no.

Saving the image

Clonezilla now is saving disk sda as an image. The job is done by saving:

  • MBR (by dd)
  • Partition table (by sfdisk and parted), CHS of disk.
  • Data on every partition or LV (logical volume) (by partimage, ntfsclone, partclone or dd. It depends on the "-q" option you choose)

Once the image is saved, since we have choosed to check the saved image, Clonezilla will do a check

Saving the image

When everything is done, Clonezilla will prompt you if you want to run it again (when something goes wrong or you want to choose different options),

  1. 'Stay in this console (console 1), enter command line prompt'
  2. 'Run command "exit" or "logout"'

Advanced extra parameters

When everything is done, Clonezilla will prompt you if you want to run it again (when something goes wrong or you want to choose different options),

  1. 'Stay in this console (console 1), enter command line prompt'
  2. 'Run command "exit" or "logout"'

Choose mode

Then you can choose to:

  • Poweroff
  • Reboot
  • Enter command line prompt
  • Start over (image repository /home/partimag, if mounted, will be umounted)
  • Start over (keep image repository /home/partimag mounted)
  • Start over (Remount subdir in medium of current repository)

Poweroff

Here we choose Poweroff, then when the shutdown process is done, it will ask you to remove the disk and close the try (if any) then press ENTER if you boot Clonezilla live from CD. If you boot Clonezilla live from USB flash drive, then there is no such prompt.

Verify the image on remote server

That's all. We have successfully saved disk image (vda) on the remote server. The image on the remote server is a directory with name "2021-07-21-06-img" and its contents are:

clonezilla@hydro66-leopard-007:~$ ls -lh /home/clonezilla/
total 8.0K
drwxr-xr-x 2 clonezilla clonezilla 4.0K Jul 21 13:41 2021-07-21-06-img
clonezilla@hydro66-leopard-007:~$ ls -lh /home/clonezilla/2021-07-21-06-img/
total 6.2G
-rw-r--r-- 1 clonezilla clonezilla  290 Jul 21 13:41 Info-OS-prober.txt
-rw-r--r-- 1 clonezilla clonezilla  33K Jul 21 13:41 Info-dmi.txt
-rw-r--r-- 1 clonezilla clonezilla  236 Jul 21 13:41 Info-img-id.txt
-rw-r--r-- 1 clonezilla clonezilla  48K Jul 21 13:41 Info-lshw.txt
-rw-r--r-- 1 clonezilla clonezilla 1.1K Jul 21 13:41 Info-lspci.txt
-rw-r--r-- 1 clonezilla clonezilla  195 Jul 21 13:41 Info-packages.txt
-rw-r--r-- 1 clonezilla clonezilla   95 Jul 21 13:41 Info-saved-by-cmd.txt
-rw-r--r-- 1 clonezilla clonezilla  447 Jul 21 13:41 Info-smart.txt
-rw-r--r-- 1 clonezilla clonezilla  603 Jul 21 13:28 blkdev.list
-rw-r--r-- 1 clonezilla clonezilla  487 Jul 21 13:28 blkid.list
-rw-r--r-- 1 clonezilla clonezilla 5.9K Jul 21 13:41 clonezilla-img
-rw-r--r-- 1 clonezilla clonezilla  175 Jul 21 13:28 dev-fs.list
-rw-r--r-- 1 clonezilla clonezilla    4 Jul 21 13:37 disk
-rw-r--r-- 1 clonezilla clonezilla   10 Jul 21 13:37 parts
-rw-r--r-- 1 clonezilla clonezilla   38 Jul 21 13:28 vda-chs.sf
-rw-r--r-- 1 clonezilla clonezilla 1.0M Jul 21 13:28 vda-hidden-data-after-mbr
-rw-r--r-- 1 clonezilla clonezilla  512 Jul 21 13:28 vda-mbr
-rw-r--r-- 1 clonezilla clonezilla  345 Jul 21 13:28 vda-pt.parted
-rw-r--r-- 1 clonezilla clonezilla  304 Jul 21 13:28 vda-pt.parted.compact
-rw-r--r-- 1 clonezilla clonezilla  207 Jul 21 13:28 vda-pt.sf
-rw-r--r-- 1 clonezilla clonezilla   33 Jul 21 13:28 vda1.info
-rw------- 1 clonezilla clonezilla 304M Jul 21 13:28 vda1.ntfs-ptcl-img.gz.aa
-rw------- 1 clonezilla clonezilla 3.9G Jul 21 13:36 vda2.ntfs-ptcl-img.gz.aa
-rw------- 1 clonezilla clonezilla 2.1G Jul 21 13:37 vda2.ntfs-ptcl-img.gz.ab