Menu

Automated / Unattended Image Restore using Grub2 and Clonezilla

Help
2016-02-24
2016-03-06
  • Brian K. Smith

    Brian K. Smith - 2016-02-24

    Hello,

    I am running:
    Ubuntu LTS 14.04.03
    Clonezilla-live-2.4.2-61-amd64.iso
    Grub2

    Using Clonezilla I have created an image of a partition and stored it on another partition of the same disk.

    I need a solution that requires no user input that will restore the saved image to the original partition via the Grub menu.

    Currently I receive a generic error message with no details in the logs and am left at the Clonezilla GUI menu to select the command line option.

    Here is my current Grub2 menu item:

    menuentry 'Unattended Image Restore for Primary Boot' --class ubuntu --class gnu-linux --class gnu $menuentry_id_option 'gnulinux-simple-45f2cba8-3870-42df-84fe-1f195cde3f84' {
    set iso='clonezilla-live-2.4.2-61-amd64.iso'
    loopback loop (hd0,6)/$iso
    linux (loop)/live/vmlinuz boot=live config union=overlay username=user noswap noprompt ip=frommedia toram=filesystem.squashfs findiso=$iso quiet splash ocs_pre_run='sudo mount --bind /dev/sda7 /home/partimag/' ocs_live_run='sudo ocs-sr auto -e1 auto -e2 -t -r -j2 -k --batch -p reboot restoreparts 2016-02-22-21-img sda1' ocs_live_extra_param='' keyboard-layouts='NONE' locales='en_US.UTF-8' ocs_live_batch='yes'
    initrd (loop)/live/initrd.img
    }

    Please let me know if more information is needed, and thanks for the help.

    Brian

     
  • Brian K. Smith

    Brian K. Smith - 2016-02-25

    This is now working as a fully unattended restore. The menu entry is below in the hopes that it may help someome tyring to accomplish this task.

    The Default, recordfail and save_env recordfail are only required for my specfic needs not required for the restore functionality. Also this syntax is specific for use directly in the Grub.cfg file.

    menuentry 'Unattended Image Restore for Primary Boot' --class ubuntu --class gnu-linux --class gnu $menuentry_id_option 'gnulinux-simple-45f2cba8-3870-42df-84fe-1f195cde3$
    Default=0
    set recordfail=0
    save_env recordfail
    set iso='clonezilla-live-2.4.2-61-amd64.iso'
    loopback loop (hd0,6)/$iso
    linux (loop)/live/vmlinuz boot=live config union=overlay username=user noswap noprompt ip=frommedia toram=filesystem.squashfs findiso=$iso quiet splash \ ocs_prerun='mount /dev/sda7 /home/partimag' \ ocs_prerun1='sleep 5' \ ocs_live_run='ocs-sr -e1 auto -e2 -batch -t -r -j2 -k -p reboot -f sda1 restoreparts 2016-02-22-21-img sda1' \ ocs_live_extra_param='' \ keyboard-layouts=NONE \ ocs_live_batch=yes \ locales=en_US.UTF-8
    initrd (loop)/live/initrd.img
    }

     
  • Steven Shiau

    Steven Shiau - 2016-03-06

    Cool. Thanks for sharing that.

    Steven.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.