Menu

Auto-Restore then boot Windows

Help
Mike
2014-11-10
2014-11-16
  • Mike

    Mike - 2014-11-10

    Hello all,
    I am attempting to set up a PC that will automatically restore an image I have created with Clonezilla, and then after restoring the image, I want the computer to automatically boot into Windows.
    I do not want the end user to have to input anything, only to be able to turn on the PC and have it do the above.
    This is the 'template' I am using to try to set this up - http://www.rmprepusb.com/tutorials/clonezilla#TOC-Installing-the-CloneZilla-files-onto-a-target-system:
    This is the text of my 'menu.lst' file:
    /clonezilla/hotkey
    allow vbeprobe command to output text
    debug 1
    list all available BIOS modes
    vbeprobe > (md)0x220+5
    clear the display to keep it clean!
    clear
    debug 0
    look for 800x600 modes
    cat --locate=", 800x600x16" (md)0x220+5 > nul && set GM=800_16 && echo 800x600x16 supported
    cat --locate=", 800x600x32" (md)0x220+5 > nul && set GM=800_32 && echo 800x600x32 supported
    cat --locate=", 800x600x24" (md)0x220+5 > nul && set GM=800_32 && echo 800x600x32 supported
    wait 1 second so the user can see the modes supported by the BIOS
    pause --wait=1
    now change to the highest resolution supported and load the matching bitmap
    if "%GM%"=="800_32" graphicsmode -1 800 100:1000 24:32 && splashimage /clonezilla/aurora24.bmp.gz
    if "%GM%"=="800_16" graphicsmode -1 800 100:1000 16 && splashimage /clonezilla/aurora256.bmp.gz
    allow text output from any future commands so we can debug the menu items
    find source volume for Windows and our backup volume - use hda instead of sda if IDE HDD
    if exist (hd0,0)/windows/explorer.exe set WDRV=sda1
    if exist (hd0,1)/windows/explorer.exe set WDRV=sda2
    if exist (hd0,2)/windows/explorer.exe set WDRV=sda3
    if exist (hd0,3)/windows/explorer.exe set WDRV=sda4
    if exist (hd0,0)/clonezilla/live/vmlinuz set BAKDRV=sda1
    if exist (hd0,1)/clonezilla/live/vmlinuz set BAKDRV=sda2
    if exist (hd0,2)/clonezilla/live/vmlinuz set BAKDRV=sda3
    if exist (hd0,3)/clonezilla/live/vmlinuz set BAKDRV=sda4
    if exist (hd0,4)/clonezilla/live/vmlinuz set BAKDRV=sda5
    if exist (hd0,5)/clonezilla/live/vmlinuz set BAKDRV=sda6
    if exist (hd0,6)/clonezilla/live/vmlinuz set BAKDRV=sda7
    if exist (hd1,0)/clonezilla/live/vmlinuz set BAKDRV=sdb1
    if exist (hd1,1)/clonezilla/live/vmlinuz set BAKDRV=sdb2
    if exist (hd1,2)/clonezilla/live/vmlinuz set BAKDRV=sdb3
    if exist (hd1,3)/clonezilla/live/vmlinuz set BAKDRV=sdb4
    if exist (hd1,4)/clonezilla/live/vmlinuz set BAKDRV=sdb5
    if exist (hd1,5)/clonezilla/live/vmlinuz set BAKDRV=sdb6
    if exist (hd1,6)/clonezilla/live/vmlinuz set BAKDRV=sdb7
    if exist (hd2,0)/clonezilla/live/vmlinuz set BAKDRV=sdc1
    if exist (hd2,1)/clonezilla/live/vmlinuz set BAKDRV=sdc2
    if exist (hd2,2)/clonezilla/live/vmlinuz set BAKDRV=sdc3
    if exist (hd2,3)/clonezilla/live/vmlinuz set BAKDRV=sdc4
    if exist (hd2,4)/clonezilla/live/vmlinuz set BAKDRV=sdc5
    if exist (hd2,5)/clonezilla/live/vmlinuz set BAKDRV=sdc6
    if exist (hd2,6)/clonezilla/live/vmlinuz set BAKDRV=sdc7
    if exist (hd3,0)/clonezilla/live/vmlinuz set BAKDRV=sdd1
    if exist (hd3,1)/clonezilla/live/vmlinuz set BAKDRV=sdd2
    if exist (hd3,2)/clonezilla/live/vmlinuz set BAKDRV=sdd3
    if exist (hd3,3)/clonezilla/live/vmlinuz set BAKDRV=sdd4
    if exist (hd3,4)/clonezilla/live/vmlinuz set BAKDRV=sdd5
    if exist (hd3,5)/clonezilla/live/vmlinuz set BAKDRV=sdd6
    if exist (hd3,6)/clonezilla/live/vmlinuz set BAKDRV=sdd7
    set WDRV=sda2
    set BAKDRV=sdb1
    timeout 10
    default 0
    set menu colors - white normal menu text, purple highlighted, green heading, white console text, black menu border
    color normal=31 highlight=0x75 helptext=0x1D heading=0x0A standard=0x0F border=0x00
    write (md)0x220+1 !BAT\necho -n -P:0000 $[0133] --- CLONEZILLA BACKUP\RESTORE MENU --- \necho -n -P:2300 www.rmprepusb.com\0
    initscript (md)0x220+1
    autonumber menu entries
    write 0x8274 0x2001
    title Auto-Restore Windows\nRestore Windows from IMG
    find --set-root /clonezilla/live/vmlinuz
    set BOPT=boot=live quiet live-config noswap nolocales edd=on nomodeset ip=frommedia ocs_live_keymap="NONE"
    set RUN=ocs_live_run="ocs-live-general" keyboard-layouts="NONE" ocs_lang="en_US.UTF-8" live-media-path=/clonezilla/live bootfrom=/dev/%BAKDRV% toram=filesystem.squashfs ocs_live_batch="yes"
    set PRERUN=ocs_prerun="mount /dev/%BAKDRV% /mnt" ocs_prerun1="mount --bind /mnt/clonezilla/images /home/partimag/"
    set RUN1=ocs_live_run="ocs-sr --batch -e1 auto -e2 -j2 -k -p reboot restoreparts IMG %WDRV%"
    echo kernel /clonezilla/live/vmlinuz %BOPT% %RUN% %PRERUN% %RUN1%
    pause
    kernel /clonezilla/live/vmlinuz %BOPT% %RUN% %PRERUN% %RUN1%
    initrd /clonezilla/live/initrd.img
    title Windows\nBoot to Windows
    find --set-root --devices=h /bootmgr && chainloader /bootmgr
    find --set-root --devices=h /ntldr && chainloader /ntldr
    title Auto-Backup Windows\nBackup Windows to IMG
    find --set-root /clonezilla/live/vmlinuz
    set BOPT=boot=live quiet live-config noswap nolocales edd=on nomodeset ip=frommedia ocs_live_keymap="NONE"
    set RUN=ocs_live_run="ocs-live-general" keyboard-layouts="NONE" ocs_lang="en_US.UTF-8" live-media-path=/clonezilla/live bootfrom=/dev/%BAKDRV% toram=filesystem.squashfs ocs_live_batch="yes"
    set PRERUN=ocs_prerun="mount /dev/%BAKDRV% /mnt" ocs_prerun1="mount --bind /mnt/clonezilla/images /home/partimag/"
    set RUN1=ocs_live_run="ocs-sr -q2 -sc -rm-win-swap-hib --batch -j2 -z1 -i 2000 -p reboot saveparts IMG %WDRV%"
    echo kernel /clonezilla/live/vmlinuz %BOPT% %RUN% %PRERUN% %RUN1%
    pause
    kernel /clonezilla/live/vmlinuz %BOPT% %RUN% %PRERUN% %RUN1%
    initrd /clonezilla/live/initrd.img
    Can someone give me some insight as to what I am doing wrong here? So far, I can boot into Windows, I can do auto or manual backups and restores.
    I want to turn on the PC, have it automatically restore the image, then boot into Windows on its own.
    I can get it to restore the image, but then it comes back to the main menu where the user has to select an option, or it automatically selects the first choice after the timer runs down. I can't seem to merge the automatic restore and boot into Windows.

    Thanks,

    Mike

    P.S. If Clonezilla cannot do this, is there a recommendation for another program that can do what I want here?

    I'm trying to set this up so that once the image gets restored, it loads that, rather than reboots and goes into a continuous restore loop. Is there a switch or something I am missing here? Forgive me if a dumb question, this is my first time using Clonezilla.

     

    Last edit: Mike 2014-11-12
  • Steven Shiau

    Steven Shiau - 2014-11-16

    Why you have ocs_live_run="ocs-live-general" and another ocs_live_run="ocs-sr -q2 -sc -rm-win-swap-hib --batch -j2 -z1 -i 2000 -p reboot saveparts IMG %WDRV%"?
    Remove the first one, and just keep the 2nd one.

    Steven.

     

Log in to post a comment.