Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We are using Clonezilla with its Debian based OS and want to make a bootable image on a USB. All PCs are exactly identical, the hard drive is sda1. The PC runs under Windows XP and has about 4GB of used HD space.

Both the cloner as well as the restorer are end users. Therefore the process is too complicated. We need a Swiss key mapping for both create and restore process.

How do we automate at least the create process using shell scripts?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Clonezilla allows creation of automated procedures of cloning and restoring by adding a simple script to its live cd or dvd .iso image.

In a nutshell, you can:

  1. Add a shell script with appropriate clone or restore commands into the .iso image of the Clonezilla live cd or dvd

  2. Edit the isolinux.cfg file adding an appropriate boot menu entry that passes the /path/to/script as a parameter to Clonezilla

  3. Burn the modified .iso image and boot it on the machine you want to clone or restore

The script should contain a CloneZilla command line looking like

   /opt/drbl/sbin/ocs-sr -q -c -z1 -p true saveparts "<imagefile_name>" "<partition_to_save>"

Your operators now have just to boot the PC with the live cd and choose the operation to perform from the initial menu.

Of course, when you want to clone a partition or disk your script must include instructions to mount an external storage to save the image onto.

When, on the other hand, you'll be going to restore the data, then you might choose to include the image file(s) in the live cd or dvd itself.

Keep in mind that Clonezilla supports the use of remote (SMB, CIFS) image files storage devices as well, for both cloning and restoring operations.

Take a look to the Clonezilla documentation for further details.

share|improve this answer
    
Sorry, I just realized that you were asking about a USB based solution, while I mentioned only optical live media. Of course you can use the same procedure on a USB Clonezilla live support, mutatis mutandis. It should be even easier. –  MariusPontmercy Aug 11 '10 at 10:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.