Search My Blog

Sunday, October 31, 2010

Clonezilla How Too's

Clonezilla Live - Single machine clone system without installation

[About] [How to make] [How to use] [Step by step] [Accounts] [Advanced modes] [Acknowledgment] [Copyright] [Authors]


1. About Clonezilla Live

Clonezilla server edition is used to clone many computers simultaneously. It is an extremely useful tool, however, it does have several limitations. In order to use it, you must first prepare a DRBL server AND the machine to be cloned must boot from a network (e.g. PXE/Etherboot). To address these limitations, the Free Software Lab at the NCHC has combined Debian Live with Clonezilla to produce "Clonezilla Live," a new software that can be used to easily clone individual machines. The primary benefit of Clonezilla Live is that it eliminates the need to set up a DRBL server ahead of time and the need for the computer being cloned to boot from a network. Clonezilla Live can be used to clone individual computers using a CD/DVD or USB flash drive. Though the image size is limited by the boot media's storage capacity, this problem can be eliminated by using a network filesystem such as sshfs or samba.

2. How to make Clonezilla Live ?

To make Clonezilla live, the basic steps are to download pre-build Clonezilla Live then put it in a boot media (CD, USB flash drive or USB hard drive). Two types of files are available, iso and zip. The former one is for CD, the latter is for USB flash drive. Besides, you can put Clonezilla live on hard drive or PXE server, too.
  • For CD/DVD:
  • For USB flash drive or USB hard drive:
      To put Clonezilla live on a USB flash drive or USB hard drive, check this doc.
  • For hard drive:
      To put Clonezilla live on a harddrive with OS installed already, check this doc.
  • For PXE server:
      To put Clonezilla live on a PXE server and boot your client via PXE, check this doc.
Now you may continue with the next step to use Clonezilla live.

3. How to use Clonezilla live ?

Once you have the bootable Clonezilla Live media, as created in the previous step, you can boot it in the machine you want to clone. Remember to use the Clonezilla live media, such as CD, USB flash drive, USB hard drive, hard drive or PXE 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.
  • You can refer to these step-by-step examples, which provide more details, e.g. how to save an image, to restore an image, to clone disk, to create recovery CD, and more... New! Examples are updated with Clonezilla live 1.2.5-35!

  • For general introduction about using the Clonezilla live, please check this doc.

4. Accounts

In Clonezilla live, two accounts are available: (1) account "user" with sudo privilege, password is "live", (2) administration account "root", no password. Therefore you can not login as root, the only way to get root privilege is to login as user, and run "sudo su -" to become root. Note, for old clonezilla live (naming is clonezilla-live-2007XXXX), root's password is "drbllive".
For better security, it is recommended to change the passwords of user and root by command "passwd" before you allow remote access. When Clonezilla live boots, the ssh service is NOT automatically started, and the setting in /etc/hosts.deny does NOT block any connection. If you want to remotely ssh login into your Clonezilla live, you have to start ssh service by "/etc/init.d/ssh start".

5. Advanced modes

Some advanced modes are available:
  1. Create your own recovery CD or USB flash drive.
  2. Use your own script and run it on clonezilla live.
  3. Use boot parameters to pre-set some selections

6. Acknowledgment

The authors would like to thank Mr. Jr-Jung Lin from Taipei County, Mr. Wei-Ji Hsiao from Huallien County and all others who helped put together this project for their time, effort, contribution and input.

7.Copyright

This copyright is preserved for the author and publisher. Anyone is permitted to copy and distribute verbatim copies of this document under the terms of the GNU FDL Free Documentation License. If you do make any distribution or modification of the document, please add your name to the authors list.

We recommend this document principally for works whose purpose is instruction or reference. The author and publisher will not take any responsibility if there is any damage caused by this document.


8. Authors

Steven Shiau (steven _at_ nchc org tw)
K. L. Huang (klhaung _at_ gmail com)
H. T. Wang (c00wht00 _at_ nchc org tw)
Ceasar Sun (ceasar _at_ nchc org tw)
Jazz Wang (jazz _at_ nchc org tw)
Thomas Tsai (thomas _at_ nchc org tw)

Get             Clonezilla at SourceForge.net. Fast, secure and Free Open             Source software downloads Privacy             policy

Modified: July 28 2010 03:59:37.

Go there...
http://www.clonezilla.org/clonezilla-live/

Clonezilla Live on Hard Drive


In this doc we explain how to put clonezilla live in your harddrive which already has an OS installed.
Here we use grub boot loader as an example. You have to put the clonezilla live files in a FAT, ext2/3, reiserfs or any grub supported partition.
If you do not have such a partition, you can use gparted to resize your partition and create another partition to put clonezilla live. Here we assume you already have a FAT partition /dev/hda4 to put clonezilla live. This is how to do that:
  1. Boot the OS in the harddrive, saying it's GNU/Linux.
  2. Mount /dev/hda4 as /mnt, you can make it by: mount /dev/hda4 /mnt
  3. Download clonezilla live zip file, and unzip all the files in /mnt, make sure you put all the files in /mnt, say, COPYING is in /mnt/, not in any subdir. You can make it by something like: "unzip clonezilla-live-*.zip -d /mnt" (Replace clonezilla-live-*.zip with the file name you just downloaded).
  4. Change the dir name "live" under /mnt as another name, say "live-hd". You can make it by: "cd /mnt; mv live live-hd"
  5. If your grub is version 1.x, edit your grub config file /boot/grub/menu.lst, and append the following:

    ================================================
    title Clonezilla live on harddrive
    root (hd0,3)
    kernel /live-hd/vmlinuz1 boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" vga=788 ip=frommedia nosplash live-media-path=/live-hd bootfrom=/dev/hda4 toram=filesystem.squashfs
    initrd /live-hd/initrd1.img
    boot

    ================================================

  6. If your grub is 2.x (grub-pc), e.g. on Debian Squeeze or Ubuntu 9.10, edit /etc/grub.d/40_custom, make it like:

    ================================================
    menuentry "Clonezilla" {
    set root=(hd0,4)
    linux /live-hd/vmlinuz1 boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" vga=788 ip=frommedia nosplash live-media-path=/live-hd bootfrom=/dev/hda4 toram=filesystem.squashfs
    initrd /live-hd/initrd1.img
    }

    ================================================
    //NOTE// In grub2, (hd0,4) means the first harddrive and the 4th partition. It's different from that in grub version 1. Then run "update-grub2" to update your grub2 config. (Thanks to Louie Chen for providing this).

    Besides, you can use only the Clonezilal live iso file in grub2 (Thanks to the patches files from grml). For example, put clonezilla-live-1.2.6-24.iso in dir /home/isos/, then make the grub2 custom menu (/etc/grub.d/40_custom) like:

    ================================================
    menuentry "Clonezilla live" {
    set isofile="/home/isos/clonezilla-live-1.2.6-24.iso"
    loopback loop $isofile
    linux (loop)/live/vmlinuz1 boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang="" vga=788 ip=frommedia nosplash toram=filesystem.squashfs findiso=$isofile
    initrd (loop)/live/initrd1.img
    }

    ================================================
    Then run "update-grub2" to update your grub2 config.

//NOTE//:
  1. Here we assign "live-media-path=/live-hd" since the files are not put in the default path (live). We force to use "bootfrom=/dev/hda4" (files are on /dev/hda4) so that if there is another Clonezilla live on your CD drive (e.g. /dev/hdc), the live initramfs wont's find the wrong files from your CD drvie. An extra param "toram=filesystem.squashfs" is added so that later later you can mount /dev/hda4 as clonezilla image dir if you want. If you want live-initramfs to copy all the files in /dev/hda4 to memory, you can use "toram" (not "toram=filesystem.squashfs") only. This is useful when you have some customized files you need in /dev/hda4/.
  2. Remember to check parameters in syslinux/syslinux.cfg from the zip file, copy them to here. It might be different from here, say vmlinuz path, username and hostname maybe different.
  3. If you do not change the dir name from "live" to "live-hd" in the above, you might encounter a problem when you have a version of Clonezilla live on harddrive and you want to boot your Clonezilla live CD or USB flash drive. There are some discussions about this. Check:

Get                 Clonezilla at SourceForge.net. Fast, secure and Free                 Open Source software downloads Privacy policy

Modified: September 26 2010 18:51:39.

Go there...
http://www.clonezilla.org/clonezilla-live/livehd.php


Clonezilla Server Edition

[How to setup] [How to use][Copyright] [Authors]


1. How to setup a Clonezilla server ?

A DRBL server must first be set up in order to use Clonezilla to do massively clone. You can use DRBL Live without installation it on a server, or to install and configure DRBL on GNU/Linux system. To install and configure a DRBL server, check this installation doc then follow it to setup such a Clonezilla server. The setup might take about 30 minutes to a few hours, it depends on your internet bandwidth. Once DRBL is installed on the server, Clonezilla is ready.

Besides, a testing feature to use Clonezilla live as the OS of client in Clonezilla SE can be found here.

When setting up the DRBL server, it is recommended to collect the MAC addresses of the client computers and let the DRBL server offer the same IP address for the clients every time it boots. If you prefer to use DRBL live, remember to isolate the network environment from others. This will keep you from cloning the system to incorrect or unknown clients. Besides, if you do not provide the static IP address to client, different operating systems (like GNU/Linux and MS windows), they use different DHCP client ID. Therefore even it's the same client, when it boots GNU/Linux via DRBL, it will leases one IP address, then next time when it boots into local MS windows, it will lease another different IP address. This is annoying sometimes. However, if you are 100% certain that no other computer will be involved in the DRBL environment, and you do not care about the different IP address leasing problem, you can use the range in dhcpd.conf. In this case, you can even use the "impatient method" to setup the DRBL environment.

2. How to use Clonezilla server edition ?

  • As root, run "/opt/drbl/sbin/dcs" in DRBL server to switch clients' mode. You will see two menus: clonezilla-start and clonezilla-stop like this:
    drbl_client_switch screenshot

    Check clonezilla-start by "space" key, various modes will be shown:
    • clonezilla-save-disk: clonezilla save disk mode
    • clonezilla-restore-disk: clonezilla restore disk mode
    • clonezilla-save-parts: clonezilla save partitions mode
    • clonezilla-restore-parts: clonezilla restore partitions mode
    • clonezilla mode
    • This is what the graphic mode looks like:

      clonezilla_save_disk

    Again, check the mode you want by "space" key, then follow the menus to do it. Once the mode in DRBL server is ready, you can boot your clients via PXE to save or restore the image.

    To stop clonezilla:
    As root, run "/opt/drbl/sbin/dcs", then choose "Clonezilla-stop". Or you can use "/opt/drbl/sbin/drbl-ocs stop".
  • Examples:
    • The following is an example of how to save an image from a single computer (called computer M) and then restore it to 39 computers in a 40-computer classroom:
      • Set the Clonezilla server to be clonezilla-save-disk mode: In the Clonezilla server,
        • run "/opt/drbl/sbin/dcs", then choose "clonezilla-start" (use the space key to mark it). Next, choose"clonezilla-save-disk" (use space key to mark it)
      • Turn on computer M, set it as network boot (PXE or etherboot) in the BIOS or by pressing the hotkey (refer to your motherboard manual) when it is booting.
      • When computer M finishes the network boot, if you do not enter image and device name when running /opt/drbl/sbin/dcs -> clonezilla-start -> clonezilla-save-disk, a prompt will ask you to name the image and choose the device. Now enter the name (e.g. nomorems) and then choose the disk you want to save it to. Otherwise, it will use the image and device name you already inputted in the clonezilla server to save the image.
      • Once the image is saved, set the mode to be clonezilla-restore-disk in the Clonezilla server. As an example, in the Clonezilla server,
        • run "/opt/drbl/sbin/dcs". Next, choose "clonezilla-start" (use space key to mark it). Next, choose "clonezilla-restore-disk" (use space key to mark it).
    The program will ask you which source image to restore. In this example, we chose the image "nomorems."
      • Make sure the clients (i.e. the computers to be cloned) will boot from the network (PXE or etherboot) then turn on the clients to let them boot from network.
      • The clients will begin to clone the system image "nomorems" to their harddisks.
      • Once all clients finish cloning, you can stop clonezilla by /opt/drbl/sbin/dcs -> clonezilla-stop.
  • More examples are available here.

  • PS: You can refer to DRBl-winroll to make the restored (cloned) MS Windows with a different hostname automatically.

3. Copyright

This copyright is preserved for the author and publisher. Anyone is permitted to copy and distribute verbatim copies of this document under the terms of the GNU FDL Free Documentation License. If you do make any distribution and modification on the documents, please add your name in the author list.

We recommend this document principally for works whose purpose is instruction or reference. The author and publisher will not take any responsibility if there is any damage caused by this document.


4. Authors

Steven Shiau (steven _at_ nchc org tw)
K. L. Huang (klhaung _at_ gmail com)
H. T. Wang (c00wht00 _at_ nchc org tw)
Ceasar Sun (ceasar _at_ nchc org tw)
Jazz Wang (jazz _at_ nchc org tw)
Thomas Tsai (thomas _at_ nchc org tw)

Get             Clonezilla at SourceForge.net. Fast, secure and Free Open             Source software downloads Privacy             policy

Modified: 2010/Sep/04

Go there...
http://www.clonezilla.org/clonezilla-server-edition/


Clonezilla
new-cool-list-linux.html
Clonezilla
Clonezilla
Clonezilla Live on hard drive
Clonezilla (OpenSource clone system)

Don
Clonezilla
new-cool-list-linux.html
Clonezilla
Clonezilla
Clonezilla Live on hard drive
Clonezilla (OpenSource clone system)

No comments: