Skip to main content

Raymii.org Logo (IEC resistor symbol)logo

Quis custodiet ipsos custodes?
Home | About | All pages | RSS Feed | Gopher

Customize your Clonezilla Live CD

Published: 01-01-2010 | Author: Remy van Elst | Text only version of this article


Table of Contents


At work we need to image laptops. We do that with clonezilla.
But some people think the clonezilla menu is to hard. So A colleague and I madea script to do it in 2 steps (mount and enter image name).
But that had to be integrated in to the clonezilla live CD.
That is a pain to do if you're on a windows vista PC.
But it worked, and I wanted to share it with the rest of the world.
Our script to backup can be found at the bottom of the page.
But how do I get that script on to the live USB?

This is how I do it:

mkdir rw.fs  mkdir clonscript  (above is only required once).  mount -t unionfs -o dirs=rw.fs=rw:/mnt=ro unionfs clonscript  cd clonscript  mkdir clondir1  copy the scripts, or nano them.  (To launch a clonezilla script as root, make a launcher script, and put this in it:  *#!/bin/sh  sudo su -c /path/to/script/you/just/made.sh*  cd ../../  umount clonscript  mksquashfs ./rw.fs ./filesystem.squashfs

Now the 2 filesystems are being put together.
The next time, mount it again, make a new directory (say clondir2) and cp allthe scripts from clondir1 into clondir2, and edit them from there. Also changeyour root launch script to the new dir.

Now edit the isolinux/isolinux.cfg file. To start a script as root,
make a link to it as described earlier. Here is my setup:

* label RESTORE  # MENU DEFAULT  # MENU HIDE  MENU LABEL RESTORE  # MENU PASSWD  kernel /live/vmlinuz1  append initrd=/live/initrd1.img boot=live union=aufs  hostname=jaunty edd=on nolocales ocs_live_run="/path/to/your/root/launcher/script.sh"  ocs_live_extra_param="" ocs_live_keymap="NONE" ocs_live_batch="no"  ocs_lang="" noprompt mode_option=800x600 toram=filesystem.squashfs  ip=frommedia  TEXT HELP  TEST RESTORE  ENDTEXT  *  

Note this part: ocs live run="/path/to/your/root/launcher/script.sh". Changethat every time you make a change to the script. (For every change to the scriptyou make you must make a new directory and change your root launcher script.This is because your merging a read only file system. And read only cannot beoverwritten.) Now make an ISO of it again. (At work I need to use the tool
folder2iso which can be downloaded here.

after you made the ISO, unetbootin it to USB or burn it to CD.

You can remove the USB stick or CD when clonezilla is imaging, because this bootscript loads it into the ram.

If this can be done with less work, please post it in a comment, I hate thisway... (first start fcking vista, then virtualbox a mint, then share a folder,then mount and edit, then folder2iso and at last unetbootin...)... And thanks tothe people of clonezilla for making such a wonderfull alternative to ghost andacronis ^.^

Example Backup Script
#!/bin/sh  dhclient  echo "###############################"  echo "# Script made by Remy & David #"  echo "###############################"  echo  echo  echo Voer nu het wachtwoord van de laptop in   echo  mount -t cifs -o username="daniel" //192.168.1.2/image /home/partimag  echo  echo  echo "Er komt nu een lijst met images"  echo "IMAGES: "  ls -n /home/partimag  echo  echo -n "Voer de naam van het image in(schoon#): "; read NAME;  /opt/drbl/sbin/ocs-sr -q -c -z1 -p true saveparts "$NAME" "sda2"
Tags: bash, clonezilla, imaging, live-cd, tutorials