Clonezilla

The Free and Open Source Software for Disk Imaging and Cloning
lite server

In this example: Run a Clonezilla lite server to do massive deployment from an image via multicast mechanism
  1. Boot the machine via Clonezilla live
  2. The boot menu of Clonezilla live
  3. Here we choose 800x600 mode, after pressing Enter, you will see Debian Linux booting process
  4. Choose language
  5. Choose keyboard layout
  6. Choose "Start Clonezilla"
  7. Choose "lite-server" option
  8. Start Clonezilla lite server
  9. Now we have to mount the image repository.
  10. Select sdb1 as image repository, then choose "restoredisk" option
  11. Select image name and destination disk

[Back to 'Clonezilla Live Doc']

  • Boot the machine via Clonezilla live     ^TOP^
  •  In this example, the machine will run as a Clonezilla lite server, which can be used to deploy an image to many computers. Assume we already have a Clonezilla image in sdb, the image name is called "disco-x64-20190424" and will be deployed to other computers using multicast mechanism. We will use the existing DHCP service in the LAN when providing network booting service for clients:
    root@debian:~# ls -lh /home/partimag/
    total 1.0K
    drwxr-xr-x 2 root root 680 Apr 24 02:08 disco-x64-20190424
    drwxr-xr-x 2 root root 832 Apr 20 12:46 disco-x64-efi-20190420
    drwxr-xr-x 2 root root  48 Apr 25 12:08 Docs
    drwxr-xr-x 2 root root  48 Apr 25 12:08 Photos
    
    root@debian:~# ls -alFh /home/partimag/disco-x64-20190424
    total 568M
    drwxr-xr-x 2 root root  680 Apr 24 02:08 ./
    drwxr-xr-x 8 root root  208 Apr 25 12:08 ../
    -rw-r--r-- 1 root root 1.1K Apr 24 02:07 blkdev.list
    -rw-r--r-- 1 root root  460 Apr 24 02:07 blkid.list
    -rw-r--r-- 1 root root 4.7K Apr 24 02:08 clonezilla-img
    -rw-r--r-- 1 root root  144 Apr 24 02:07 dev-fs.list
    -rw-r--r-- 1 root root    4 Apr 24 02:08 disk
    -rw-r--r-- 1 root root  96K Apr 24 02:08 Info-dmi.txt
    -rw-r--r-- 1 root root  187 Apr 24 02:08 Info-img-id.txt
    -rw-r--r-- 1 root root  60K Apr 24 02:08 Info-lshw.txt
    -rw-r--r-- 1 root root 4.6K Apr 24 02:08 Info-lspci.txt
    -rw-r--r-- 1 root root  225 Apr 24 02:08 Info-packages.txt
    -rw-r--r-- 1 root root   96 Apr 24 02:08 Info-saved-by-cmd.txt
    -rw-r--r-- 1 root root    5 Apr 24 02:08 parts
    -rw------- 1 root root 566M Apr 24 02:08 sda1.ext4-ptcl-img.gz.aa
    -rw-r--r-- 1 root root   35 Apr 24 02:07 sda-chs.sf
    -rw-r--r-- 1 root root 1.0M Apr 24 02:07 sda-hidden-data-after-mbr
    -rw-r--r-- 1 root root  512 Apr 24 02:07 sda-mbr
    -rw-r--r-- 1 root root  273 Apr 24 02:07 sda-pt.parted
    -rw-r--r-- 1 root root  260 Apr 24 02:07 sda-pt.parted.compact
    -rw-r--r-- 1 root root  133 Apr 24 02:07 sda-pt.sf
    
    Now the image "disco-x64-20190424" will be deployed to other machine's sda.

    Once you have the bootable Clonezilla Live CD/DVD or USB flash drive, you can boot the machine you want to clone via Clonezilla live. Remember to use the Clonezilla live CD or USB flash drive to boot the machine. For example, if you have Clonezilla Live in USB flash drive, you have to boot it via USB device (Ex. USB-HDD or USB-ZIP). If necessary, you can set the first boot priority in the BIOS as USB-HDD or USB-ZIP so that it can boot Clonezilla Live from your USB flash drive.
    Here we take CD as an example. You can either set CD as first boot priority in machine's BIOS like this:


    Or by pressing a hotkey (e.g. Esc or F9) when you boot the machine, you will see the boot menu of BIOS like this:


    Check your motherboard manual for more details about how to boot your machine via CD.


  • The boot menu of Clonezilla live     ^TOP^
  •  Here is a screenshot of Clonezilla Live boot menu:


    The first one is the default mode for Clonezilla Live. It will default to framebuffer mode with a resolution of 1024x768.
    There are more modes which you can choose in the 2nd choice "Other modes of Clonezilla live", e.g. 800X600 or 640x480 one if you want, as shown here:


    The choice, "Default settings, KMS" is for you to use KMS (Kernel Mode Setting) for your graphics card. If you have some problem to use the framebuffer mode of your graphics card, you can try it.
    The choice, "Clonezilla live (To RAM. Boot media can be removed later)", is the same function with the 1st one except when Clonezilla live booting finishes, all the necessary files are copied to memory. Therefore you can remove the boot media (CD or USB flash drive) then.
    If you do not need Chinese or Japanese environment or if your computer experiences problems in the framebuffer mode, you can choose the one "Clonezilla Live (no framebuffer)" to clone in the English environment.
    The choice, "Clonezilla live (failsafe mode)", is for something goes wrong when you are not be able to boot your machine, such as ACPI of your machine is not supported in the kernel.
    If you want to boot local OS in your harddrive, you can choose the one "Local operating system in harddrive (if available)". This is an extra function in the boot media that has nothing to do with Clonezilla Live.
    The choice, "FreeDOS", allows you to boot your machine into Free DOS. This is an extra function in the boot media that has nothing to do with Clonezilla Live.
    The choice, "Memory test using Memtest86+," is for memory testing using Memtest86+. This is an extra function in the boot media that has nothing to do with Clonezilla Live.
    The choice, "Network boot via iPXE" is used to perform a network boot via iPXE. If your computer does not have a PXE network, you can use this to do boot from a network. This is an extra function in the boot media that has nothing to do with Clonezilla Live.

  • Here we choose 800x600 mode, after pressing Enter, you will see Debian Linux booting process     ^TOP^
  •  


  • Choose language     ^TOP^
  •  


  • Choose keyboard layout     ^TOP^
  •  

    The default keyboard layout is US keyboard, therefore if you are using US keyboard, just press enter (i.e. use the option "Keep the default keyboard layout - US keyboard").
    If you want to change keyboard layout, you can choose "Change keyboard layout", then follow the dialog menu to change that.

  • Choose "Start Clonezilla"     ^TOP^
  •  


  • Choose "lite-server" option     ^TOP^
  •  


  • Start Clonezilla lite server     ^TOP^
  •  Now choose start Clonezilla lite server:


    Decide the client machine booting mechanism. Here we choose clients will boot from network (PXE or uEFI network booting):


    Here we choose to detect DHCP service automatically. If the existing one is found, we can reuse it. Otherwise we have to start our own DHCP service:


    So now Clonezilla lite server will detect the existing DHCP service. Once it is found, the Clonezilla lite server will borrow (reuse) the existing service, i.e., relay the client's DHCP request to the existing DHCP server:


    The existing DHCP service in the LAN has been detected, so now Clonezilla lite server will relay the client's DHCP request to existing DHCP service.
    //NOTE// Pay attention to the prompt. You have to make sure the DHCP service will provide enough IP addresses to all the clients. Besides, this mechanism is risky because all the PXE or uEFI network booting clients will enter DRBL or Clonezilla mode. Please make sure this is what you want.

  • Now we have to mount the image repository.     ^TOP^
  •  Choose "local_dev" option to assign sdb1 as the image home


    There are other options, e.g. sshfs, samba, nfs or webdav, AWS S3 or Openstack Swift, you can use when network is available. This is very useful when 2nd local disk is not available.
    Since we choose "local_dev" option, we can use 2nd disk or USB flash drive to save 1st disk's image. If using USB flash drive as repository, inster USB flash drive and wait a few secs.


    Clonezilla will scan the disks on the machine in every few secs, and show you the results:


    Once you see the device you have inserted shown on the status, you have to press Ctrl-C to quit the scanning report.

  • Select sdb1 as image repository, then choose "restoredisk" option     ^TOP^
  •  

    If you are not familiar with the disk or partition name in GNU/Linux, read the hints:
    'The partition name is the device name in GNU/Linux. The first partition in the first disk is "sda1", the 2nd partition in the first disk is "sda2", the first partition in the second disk is "sdb1" or "sdb1"... If the system you want to save is MS windows, normally C: is sda1, and D: could be sda2, or sda5...'

    Choose the directory name on /dev/sdb1 as the image repository. Here we put image on the top directory (i.e., Current selected dir name is "/"):

    Then Clonezilla shows you the disk usage report:


    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.

    Since we will do massive deployment, now choose "massive-deployment":


    We'd like to restore the image to other client machines, so now choose "from-image":

    If we'd like to deploy the system in the local hard drive without an image, we should choose "from-device". However, if this is the case, later only the mechanism "bittorrent" will be available, no "multicast" or "broadcast" can be chosen.

    Now select "restoredisk" option:




  • Select image name and destination disk     ^TOP^
  •  Choose the Clonezilla live image as source image:


    Select the destination disk "sda" we want to restore in the clients:


    Choose to check the image integrity before really restoring the image to disk sda:


    It's recommended to check the image before restoring it because you do not know if the image is broken or not. If you are very sure that the integrity is OK, then of course you can choose "-scr" to skip checking.

    Select the mode you want after the image restoring is done in the client machines:


    By default we choose "-p reboot" here. But if you have decided, you can choose poweroff the machine, choose in the client when the clone finishes, or do nothing after is restored.

    Select to use multicast, broadcast or bittorrent mechanism. Here we take multicast as the example:


    Choose the method for multicast mode as clients+time-to-wait, i.e., we will assign the number of client machines and the time we will wait before the multicast mode starts:


    Enter the number of clients. We here assume we will have 10 machines to deploy:


    Moreover, we will wait until 300 secs before 10 client machines connect. For example, if only 9 machines connect to this lite server, and the time has passed 300 secs, the multicast deployment will start without waiting for the 10th client machine:


    Since we choose to check the image before deploying, now Clonezilla will check the image integrity:


    Clonezilla will prompt us the command to restore the image. This command is very useful when you want to create a customized Clonezilla live. In addition, it now starts all the services on the server and wait for the network booting clients to boot and receive the image to restore to the disk /dev/sda:

    As described in the screen, only when all clients have finished jobs you can press "y" to terminate the required services. Do not press "y" if there are some clients still restoring.

    Now you can boot the client machine via PXE or uEFI network booting to receive the image and write to its disk /dev/sda. All the steps in the client machine should be in unattended mode.

    Once all the clients are done, you can press "y" twice to terminate the required services:


    Check the prompt in the end. Once you press "Enter", Clonezilla will show you the prompt to poweroff, reboot, or rerun...


[Back to 'Clonezilla Live Doc']

Clonezilla project. All Rights Reserved. Anyone is permitted to copy and distribute verbatim copies of this document under the terms of the GNU FDL Free Documentation License.