Menu

Unattended USB Stick (Save 'n' Recovery)

Help
2013-02-15
2013-04-05
  • Thomas Müller

    Thomas Müller - 2013-02-15

    Hello out there,

    I have been using Clonezilla for many years, so thank you everyone for you work.

    Recently, I have been running into some difficulties regarding CloneZilla, some of the difficulties in which I've been running have been resolved by viewing and reading toipics throughout this forum.

    What is needed:

    Simple & unattended Backup and Restore the System disk (sda with all partions) to / from an USB stick.
    The operating system in all cases is Windows 7 Professional Edition (x86/x64)

    My current solution

    I partitioned the USB stick using gParted (~200 MB FAT32 / ~15,5 GB ext3), don't ask why it has it reasons, because the Backups should not be seen by unexperienced Windows users.

    What works by now

    System Backup and Restore, but the last System Backup should be removed prior to having a new System Backup removed.

    What does still need effort

    - Last System Backup is not deleted from sdb2 (which is used as partimage Repository (command rm not forund)), this is needed because the USB stick isn't big enough to allow more then one backup beeing made.
    -  After restored filesystem check is done (doesn't work because it is NTFS though, not a EXTFS or REISER FS variant), this behaivor should be skipped (if possible though).

    My current syslinux.cfg:

    # Created by generate-pxe-menu! Do NOT edit unless you know what you are doing!
    # Keep those comment "MENU DEFAULT" and "MENU HIDE"! Do NOT remove them.
    # Note!!! If "serial" directive exists, it must be the first directive
    default vesamenu.c32
    # timeout 600
    prompt 0
    noescape 1
    MENU MARGIN 5
    MENU BACKGROUND ocswp.png
    # Set the color for unselected menu item and timout message
    MENU COLOR UNSEL 7;32;41 #c0000090 #00000000
    MENU COLOR TIMEOUT_MSG 7;32;41 #c0000090 #00000000
    MENU COLOR TIMEOUT 7;32;41 #c0000090 #00000000
    MENU COLOR HELP 7;32;41 #c0000090 #00000000

    # MENU MASTER PASSWD

    say **********************************************************************
    say Clonezilla, the OpenSource Clone System.
    say NCHC Free Software Labs, Taiwan.
    say clonezilla.org, clonezilla.nchc.org.tw
    say THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
    say **********************************************************************

    # Allow client to edit the parameters
    ALLOWOPTIONS 0

    # simple menu title
    MENU TITLE Systemsicherung und Systemrücksicherung

    # Since no network setting in the squashfs image, therefore if ip=frommedia, the network is disabled. That's what we want.

    label Systemsicherung / Backup
          # MENU DEFAULT
          # MENU HIDE
    MENU LABEL Systemsicherung / Backup
    kernel /live/vmlinuz
         append initrd=/live/initrd.img boot=live config noswap nolocales noprompt nomodeset ocs_prerun="sudo mount /dev/sdb2 /mnt" ocs_prerun1="sudo mount -bind /mnt /home/partimag/" ocs_prerun2="sudo rm -Rf /home/partimag/system" union=aufs ocs_live_run="ocs-live-restore" ocs_live_extra_param="-e1 auto -e2 -r -j2 -p poweroff savedisk system sda" ocs_numlk=on ocs_live_keymap="NONE" ocs_live_batch="yes" ocs_lang="en_US.UTF-8" vga=788 ip=frommedia
      TEXT HELP
      /++++++++++++++++++++++++++++++++++++++++++++++++\
      *                                                *
      * Systemsicherung durchfuehren                   *
      *                                                *
      \++++++++++++++++++++++++++++++++++++++++++++++++/
      ENDTEXT

    label Systemwiederherstellung / Restore
    # MENU DEFAULT
    # MENU HIDE
    MENU LABEL Systemwiederherstellung / Restore
    kernel /live/vmlinuz
    append initrd=/live/initrd.img boot=live config noswap nolocales noprompt nomodeset ocs_prerun="sudo mount /dev/sdb2 /mnt" ocs_prerun1="sudo mount -bind /mnt /home/partimag/" union=aufs ocs_live_run="ocs-live-restore" ocs_live_extra_param="-e1 auto -e2 -r -j2 -p poweroff restoredisk system sda" ocs_numlk=on ocs_live_keymap="NONE" ocs_live_batch="yes" ocs_lang="en_US.UTF-8" vga=788 ip=frommedia
      TEXT HELP
      /++++++++++++++++++++++++++++++++++++++++++++++++\
      *                                                                                                               *
      * Systemwiederherstellung durchfuehren                                      *
      *                                                                                                               *
      \++++++++++++++++++++++++++++++++++++++++++++++++/
      ENDTEXT

    Except of the rm of the last backup and the disabling of the checkups, everything has been verfied to work (EFI boot is not wanted, so no configuration on this thing is been done so far…).

     
  • Thomas Müller

    Thomas Müller - 2013-02-15

    Figured out my issue myself, rm-rf /* instead of rm -rf /

    kvbblog

     
  • Fuchs

    Fuchs - 2013-02-16

    Have you any mistaken
    ocs_live_run="ocs-live-restore" ocs_live_extra_param="-e1 auto -e2 -r -j2 -p poweroff savedisk system-img sda"
    with
    ocs_live_run="ocs-live-general"
    for savedisk ?

     
  • Thomas Müller

    Thomas Müller - 2013-02-17

    Savedisk works except of two failures with filesystem check (because it is NTFS and not a Linux native filesystem like ext2/3/4). If this error could be skipped, everything would be perfect. If not I would have to add it in the documentation.

    Isn't ocs-restore crucial for the quiet / unattended mode?

    kvbblog

     
  • Steven Shiau

    Steven Shiau - 2013-02-20

    "If this error could be skipped, everything would be perfect." -> What did you mean? Please post the complete error messages shown on the screen.
    Or you should run "chkdsk /f" under your MS Windows to check the file system integrity first before you take an image of it.

    Steven.

     
  • Fuchs

    Fuchs - 2013-02-23

    In this case I had made any tests with `syslinux.cfg`. The results and hints can you see in this file too.

    syslinux.cfg:
    # Created by generate-pxe-menu! Do NOT edit unless you know what you are doing!
    # Keep those comment "MENU DEFAULT" and "MENU HIDE"! Do NOT remove them.
    # Note!!! If "serial" directive exists, it must be the first directive
    default vesamenu.c32
    #default menu.c32

    # timeout 600
    prompt 0
    noescape 1
    MENU MARGIN 5
    MENU BACKGROUND ocswp.png
    # Set the color for unselected menu item and timout message
    MENU COLOR UNSEL 7;32;41 #c0000090 #00000000
    MENU COLOR TIMEOUT_MSG 7;32;41 #c0000090 #00000000
    MENU COLOR TIMEOUT 7;32;41 #c0000090 #00000000
    MENU COLOR HELP 7;32;41 #c0000090 #00000000

    # MENU MASTER PASSWD

    say **********************************************************************
    say Clonezilla, the OpenSource Clone System.
    say NCHC Free Software Labs, Taiwan.
    say clonezilla.org, clonezilla.nchc.org.tw
    say THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
    say **********************************************************************

    # Allow client to edit the parameters
    ALLOWOPTIONS 0

    # simple menu title
    MENU TITLE Systemsicherung und Systemruecksicherung

    # Since no network setting in the squashfs image, therefore if ip=frommedia, the network is disabled. That's what we want.

    label Systemsicherung  (Backup)
          # MENU DEFAULT
          # MENU HIDE
    #clonezilla-live-2.0.1-15-i686-pae
    #Message 'deprecated':
    # ocs_lang="en_US.UTF-8"  ocs_live_keymap="NONE" nolocales(?)

    #errors:
    #ocs_live_extra_param="-e1 auto -e2 -r -j2 -nogui -p true savedisk system-img sda3"
    # with the message /usr/sbin/clonezilla -e1 invalid option usage: -l -language 0,1,2,a

    #Info-saved-by-cmd.txt: '/usr/sbin/ocs-sr -p true saveparts NTFS-sda3-img sda3'  It's very short.

    #without `ocs_prerun="mount /dev/sdb2 /mnt"   ocs_prerun1="mount -bind /mnt /home/partimag/" ` no ASK-User for repository

    #not necessary:
    # sudo,  ocs_prerun2="rm -Rf /home/partimag/system-img" not necessary, NTFS-sda3-img will be overwritten
    #not used:
    # ocs_live_run="ocs-live-general"  ocs_live_run="ocs-live-restore"    ocs_live_batch="yes" with or without quotes
    #other ocs_live_run is possibly with:
    # .. autoname ask_user,  .. savedisk NTFS-sda-img sda,  .. restoredisk NTFS-sda-img sda

    MENU LABEL Systemsicherung     (Backup)
         kernel /live/vmlinuz
         append initrd=/live/initrd.img boot=live config noswap  noprompt nomodeset  union=aufs ip=frommedia ocs_numlk=on vga=788 locales=de_DE.UTF-8  keyboard-layouts=de keyboard-variants=de-latin1-nodeadkeys  ocs_prerun="mount /dev/sdb2 /mnt"   ocs_prerun1="mount -bind /mnt /home/partimag/"  ocs_live_run="ocs-sr -q2  -j2 -nogui -z1p -i 2000 -p true saveparts NTFS-sda3-img  sda3" 
        
      TEXT HELP
      * Systemsicherung durchfuehren *
      ENDTEXT

    label Systemwiederherstellung  (Restore)
             # MENU DEFAULT
             # MENU HIDE
    MENU LABEL Systemwiederherstellung  (Restore)
         kernel /live/vmlinuz
         append initrd=/live/initrd.img boot=live config noswap  noprompt nomodeset  union=aufs ip=frommedia  ocs_numlk=on  vga=788 locales=de_DE.UTF-8  keyboard-layouts=de keyboard-variants=de-latin1-nodeadkeys  ocs_prerun="mount /dev/sdb2 /mnt"   ocs_prerun1="mount -bind /mnt /home/partimag/" ocs_live_run="ocs-sr -g auto -e1 auto -e2 -r -j2 -p true restoreparts NTFS-sda3-img sda3" 

      TEXT HELP
      > Systemwiederherstellung durchfuehren  < 
      ENDTEXT

     
  • Thomas Müller

    Thomas Müller - 2013-02-25

    Thx for your answer, but without the sudo in front, it has been always using the SDB1 Partition which only offered arround 100 Mb of free space, meaning it did abort the operation.

    kvbblog

     
  • Steven Shiau

    Steven Shiau - 2013-03-03

    @fusi1939,
    Could you wrap up your problem? I am not very sure the problem is…

    Steven.

     

Log in to post a comment.