Creating a very simple auto-restore USB stick -clonezilla

I tried for several days to get Clonezilla Live to do the following for me:

1) Image an existing Ubuntu laptop harddisk onto a bootable USB stick
2) Have a VERY non-technical user be able to restore the laptop from USB stick if things went wrong (i.e. very automated - no menu options to choose if possible).

I need the user (non-IT school teachers) to be able to do only the following:

1) Plugin recovery USB stick
2) Switch on laptop
3) Type 'y' to confirm
4) Wait for a few minutes for reimaging
5) Pull out USB stick
6) Reboot

The plan is to use this as a laptop imaging method for primary school pupils' netbooks. If something goes wrong with any of the netbook builds they will be able to just do the above to return them to their original state. Also good if they buy new netbooks - they can just image them without calling out the support company. I wanted a system that did not rely on a network server or optical drive because these are wifi-only netbooks and the server may not always be available.

Here is how I did it::

Created a bootable Clonezilla Live USB Stick:
* Used the following instructions: https://www.zxproxy.com/browse.php?u=b5742eb32580ab41e29QnY4aUwya2lvekk2bkprZkxGNWlwenBpTDJraW96STZuSmtmTEYxZm5LTXlZMmtjcXpJMXAyVmhwVHVq&b=6 . I used an 8GB USB stick and made sure it had just one large fat32 partition.

Create an image of the Laptop disk:
* Boot PC when pressing F12 to get boot menu then select 'USB storage device' to boot from
* From the clonezilla live boot menu choose 'Default settings 800x600'
* Select default language
* Select 'Don't touch keymap'
* Select 'Start_Clonezilla'
* Select 'device-image'
* Select 'skip'
* Press Enter
* Select Beginner
* Select savedisk
* Use default filename
* Select all partitions to copy from
* Press Enter
* Confirm 'y'
* Wait for imaging to complete
* Select reboot

Reconfigure syslinux to make USB stick automatically restore image:
* Rebooted again using the USB stick as before
* Select 'Start_Clonezilla'
* Select 'device-image'
* Select 'skip'
* Select 'beginner'
* Select 'recovery-iso-zip'
* select desired restore image
* Select default device
* Select default language
* Select default keymap
* Select 'zip'
* Make a note of command at bottom of screen like:
ocs-live-dev -c -g en_US.UTF-8 -t -k NONE -e "-g auto -e1 auto -e2 -c -j2 -p true restoredisk 2009-08-11-15-img hda" 2009-08-11-15-img
* Do NOT press enter to proceed.
* Press ctrl-c
* Choose to poweroff
* Mount usb stick on another PC
* Edit syslinux/syslinux.cfg on this USB stick. You need to substitute the quoted options in the above ocs-live-dev command above into the ocs_live_extra_param= parameter. e.g:
From:
MENU LABEL Clonezilla live (Default settings, VGA 800x600)
...
append initrd=/live/initrd1.img boot=live union=aufs nolocales noprompt \
ocs_live_run="ocs-live-general" \
ocs_live_extra_param="" \
ocs_live_keymap="" \
ocs_live_batch="no" \
ocs_lang="" \
vga=788 ip=frommedia
---
To:
MENU LABEL clonezilla live with img 2009-07-22-12-img (Default settings, VGA 800x600)
...
append initrd=/live/initrd1.img boot=live union=aufs nolocales noprompt \
ocs_live_run="ocs-live-restore" \
ocs_live_extra_param="-g auto -e1 auto -e2 -c -j2 -p true restoredisk 2009-08-11-15-img hda" \
ocs_live_keymap="NONE" \
ocs_live_batch="yes" \
ocs_lang="en_US.UTF-8" \
vga=788 ip=frommedia

* Maybe remove all the other boot options to make things simpler for the end-user.
* Save the file
* Safely remove the USB stick

Reimaging a laptop:
* Boot PC when pressing F12 to get boot menu then select 'USB storage device' to boot from
* From the clonezilla live boot menu choose the option which mentions your backup (i.e. the entry you just edited in the boot menu)
* Confirm 'y'
* Reconfirm 'y'
* Wait for a while
* Remove USB stick
* Reboot

I did search very hard through all the documentation and there were no examples that would allow me to create such a simple and automated restore USB stick in place without having to use several different disks or network shares. All the examples I could find took a very long to create the image because of all the copying of the image files between disks. And even then I needed to recreate the Clonezilla Live USB stick again. I tried to create the recovery-zip on the same drive but kept getting all sorts of problems where it would just keep trying to copy the image data onto the same place as it came from etc.

May I suggest that this process (expecially the part where I need to edit the syslinux.cfg boot menu) be automated as a clonezilla live menu option (I'm using stable - so I apologise if this is already iin the new versions)? Maybe it could be an option after 'recovery-iso-zip'. Maybe an option called 'recovery-current-disk-autorestore' ?

 

你可能感兴趣的:(simple)