Menu

How to create preseed options for Clonezilla Server?

2014-02-02
2015-09-29
  • Peter Kuykendall

    There are articles on how to do this for the live USB & DVD versions, but not the server version. At least, I can't find any.

    I just want to add a small shell script to first prepare the hard drive by running badblocks with some specific options. Where can I find out how to make such changes (directories, files, etc.)? Presumably these mods would be made to the client that gets pushed down when "restore image XYZ" is chosen by the user.

    Any advice, pointers to existing HOW-TO articles, etc. would be most appreciated. Thanks.

     
  • Peter Kuykendall

    I will give it a try. Where would I add them? I'd be looking to modify the client script that restores the cloned image to the client's hard drive. I just want to do some bash stuff, a couple of lines. The goal is to be able to PXE boot a client and walk away. It would first run badblocks, then do the restore, then shut down. Would these options get placed into a script that later becomes part of the pxelinux.0 file?

    Thanks - Pete

     
  • Steven Shiau

    Steven Shiau - 2014-03-06

    For PXE booting, you should edit your PXElinux config file, it's /tftpboot/nb_img/pxelinux.cfg/default
    The boot parameters are in the "append" line.
    For more info, please check http://www.syslinux.org.

    Steven.

     
  • Peter Kuykendall

    I got it working by adding some parameters to the APPEND line of the /tftpboot/nb_img/pxelinux.cfg/default file as you suggested. I minimized the complexity needed on this line by invoking "prerun" and "postrun" bash scripts, which can then be altered as desired without having to touch the Clonezilla server configuration again. I added the following parameters:

    //First mount the server's directory which holds everything that the client machine will need (scripts and extra binary files such as badblocks, ntpdate, etc.)
    ocs_prerun="mount -t nfs 192.168.56.1:/home/partimag /home/partimag/"

    //Now execute my prerun bash script which invokes a bunch of stuff. In my case it includes doing some HW checks and wiping the hard drive.
    ocs_prerun1="/home/partimag/prerun.sh"

    //(Once prerun.sh completes, Clonezilla restores the image to the hard drive per my configuration.)

    //Finally execute my postrun bash script which invokes more stuff. In my case this expands one of the partitions on the disk and writes out some log files to the server via the nfs mount.
    ocs_postrun="/home/partimag/postrun.sh"

     
    • xireland

      xireland - 2015-09-29

      Hi Peter,

      By that you mean that you have (scripts and extra binary files such as badblocks)
      an option that before start the clonening on the client wil be check the HDD for bad sectors ?
      If is that i would like to have that option in my server too.

      thank you

       
  • Steven Shiau

    Steven Shiau - 2014-12-28

    Cool! Thanks for sharing that.

    Steven.

     

Log in to post a comment.

Auth0 Logo