Modify Clonezilla

Sprache ändern:

At work i need to use an application that can store and restore images of an computer. I am using Clonezilla to do so. Clonezilla is an distribution of Debian(sid) which does all those jobs. The advantage is that it is very customizable. Because i am storing all the images at the same space and using the same network setup i has become contra productive to setup it again and again for every single image . Thank god Clonezilla can run a prerunscript which does this for me. If you want to do the same get the lastest version of clonezilla as .zip file and extract it. Changes need to be done in the /syslinux/syslinux.cfgfile which defines the menu is shown when booting clonezilla.

Here we have two menu entries, i replaced those i did not need. I will explain the meaning of the syntax now for you:

  • label – Defines the option just for the config an can be set with any value
  • MENU DEFAULT – This defines which option should be booted if the countdown is over (define only once in config, use # for the rest)
  • MENU HIDE - Hides the menu.
  • MENU LABEL – The Label that is shown in menu.
  • MENU PASSWD – You could ask for an password when choosing the option but it is not needed to me.
  • “kernel /live/vmlinuzappend initrd=/live/initrd.img boot=live config noswap nolocales edd=on nomodeset” – Starts clonezilla as it is.
  • ocs_prerun=”mount -t cifs -o user=administrator,domain=domain.net 172.28.64.141:/Images /home/partimag” ocs_live_run=”/opt/drbl/sbin/ocs-sr -u restoredisk ask_user sda” ocs_live_extra_param=”" ocs_live_keymap=”/usr/share/keymaps/i386/qwertz/de-latin1.kmap.gz” ocs_live_batch=”no” ocs_lang=”en_US.UTF-8″ vga=788 toram=filesystem.squashfs nosplash- Here it becomes very tricky. Do not worry i will explain it for you:
    • ocs_prerun= – Commands in this value will run before clonezilla starts.
    • mount -t cifs -o- mounts a samba share with parameters:
      • user =admin – Login as “admin”
      • domain=domain.net – name of the domain (if you don’t know leave it blank. Home spaces do not use domains icon wink Modify Clonezilla )
      • 172.28.64.141:/Images – Place where the Images are stored or should be placed
      • /home/partimag – Clonezilla mounts the images here which is the reason it does not ask for any other place to search for the images.
    • ocs_live_run=”/opt/drbl/sbin/ocs-sr -u restoredisk ask_user sda” - ocs_live_run is defined two times in my config. This one runs the restore function of Clonezilla.
    • ocs_live_run=”/opt/drbl/sbin/ocs-sr -u -q2 -z1p -i 2048 -p poweroff savedisk ask_user sda- This is the second entry which runs the store function:
      • -u - Asks the user for the image name (could be set in config too).
      • restoredisk or savedisk - Which mode to run ? store, restore, partition or hard-drive ?
      • ask_user - This would be the name of the image but “-u” requests it from user.
      • sda – Which hard-drive should be written or red.
      • -q2 – Use “partclone”. I am preferring this .
      • -z1p – Use gzip-Kompression (with multicore)
      • -i 2048 – Splitzise in megabyte (Split every 2GB a new file for the backup.)
      • -p poweroff - power off after successfully running the script.
    • toram=filesystem.squashfs – Extracts all files to a ramdisk. Therefore you can remove the stick when clonezilla is booted.

After we modified our script we can flash it to an flashdrive (e.g using UnetBootIn or something like that) and test it.

If you have any problems with this how-to feel free to ask me for help and more information.

16 thoughts on “Modify Clonezilla

  1. Could you help me I’ve got the following error flashing in a sec Mount error(16): device or resource busy

  2. Hi Claw,

    Sorry, but i forgot to tell you something, my pendrive is format in NTFS and not in FAT32, because i need to store files greater than 2GB and i can´t split them.

    Thank you for you early answer.

    • I will need some more information about your case.
      How do you flash the drive with clonzilla (e.g. Unetbootin, dd) ?
      Do you realy need to use NTFS and why?
      FAT32 limitation is 4G by the way. 2G is for FAT16.
      Why cant you split the files? There is an option for splitting images.
      What do you mean by ‘doesn´t recognize’ ? Isn’t it listed in the bootmenu ? Is it recognized by the bios ?

  3. hi, i´m from spain and i want you to excuse my english.
    i´m trying to customize the syslinux.cfg. I want to boot with an usb clonezilla live, and to store the image of my hd computer into the pendrive. But it is imposible, it doesn´t recognize my usb pendrive. I´ve tried with”ocs_prerun=”mount /dev/sdb /home/partimag” but it doesn´t work. Could you help me, please?

    • Hi Juan,
      I did the same at work but cant remember how to do it.
      I’ll reply in about 9 hours how to do this :).

    • As i have promised:
      If you want to store or restore the image from your Stick/Pendrive/External HD/whatever you can use

      as an option to ocs-sr. This will change the default Location to the /home/partimag folder on your Stick.

      Here’s my ocs_live_run for this

      Have fun.

      • Hi Claw, I would like to add this into my boot menu. I already use the following restore script which was generated by the “Create restore iso/zip…” option in CZ-L 2.1.1-25-amd64:

        How would I formulate a script to save an image to the USB pen drive under home/partimag and overwrite the existing image “mainimage” (if it already exists..).

        Many thanks for your help

        Greetings
        Craig

      • Hey Craig,
        There is an batch mode suffix that prevents the script to perform any prompts.
        use

        To change the default path of partimag use

        which is the /home of your usb stick. I dont know if batch mode is required. Newer tried to store an image if it already exited on the target. Is there a prompt? If yes try to use the batch mode.

        Have fun.

        lg claw

  4. I really like your blog.. very nice colors & theme. Did you design this website yourself or did you hire someone to do it for you? Plz reply as I’m looking to construct my own blog and would like to know where u got this from. kudos

  5. Hi,
    the default splitsize of 2GB, is this to be considered a disadvantage?
    My target filesystem is NTFS, so in principal, there’s no need to split into hundreds of files…
    Thanks a lot !
    Mathias

    • It is just an example for function. I wanted to explain how you can do this. of course you can modify it for your needs. no matter where you want to store it. you don’t even have to use it at all if you don’t want the files to be spitted.

Leave a Reply

Connect with:

Your email address will not be published.


1 + = 5

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">