Professional Documents
Culture Documents
142 - Automated UEFI-Windows Restore Using CloneZilla - RMPrepUSB
142 - Automated UEFI-Windows Restore Using CloneZilla - RMPrepUSB
We are using cookies to give you the best experience on our site. Cookies are files which are stored by your browser and are used by most websites to help personalise
your web experience. This site displays AdSense adverts which also store cookies. By continuing to use our website without changing the settings, you are agreeing to
our use of cookies. If you are using AdBlock to block AdSense adverts, please consider disabling it, to support this free site.
OK, got it
Custom Search
Home
Download
Grub4dos Guide
Win8 Dual Boot
Hirens
Boot from USB in Virtual Box
More
This tutorial is the equivalent of Tutorial 89 but it is for Windows 7 (64-bit) and Windows 8/10 (32-bit and 64-bit) UEFI
Windows systems which use GPT partitioning.
Contents
1. 1 Outline
2. 2 Setup
3. 3 Make a backup
4. 4 Troubleshooting
5. 5 Configuring the
Clonezilla menu
6. 6 Wallpaper and text
colours
7. 7 Tips
8. 8 No menu
9. 9 Password access
10. 10 Automatic Unattended
Backup and Restore
11. 11 Change the grub2 menu
heading
Outline x
1 of 15 5/13/18, 9:27 AM
142 - Automated UEFI-Windows Restore using Cl... http://www.rmprepusb.com/tutorials/142---window...
We will add two new GPT partitions to the Windows internal hard disk:
We will then use EasyUEFI or BootIce to set the UEFI Firmware Non-Volatile RAM (NVRAM) BIOS setting to boot to the grub2
Clonezilla menu before booting to Windows.
As well as booting via the grub2 menu, you will still be able to boot directly to Windows using your BIOS firmware boot
selection menu.
Note: The current scripts search disk 0 1 and 2 only for the backup folder (marked by backup.tag) and assume C: is the
Windows drive to be backed up which is device sda under CloneZilla.
Note that Secure Boot must be disabled in the system's BIOS options.
I have not tested this on a BitLocker-encrypted Windows volume. I believe CloneZilla uses dd on such volumes and so would
require a backup volume that is at least as large as the Windows volume.
Note that filenames and folder names are case-sensitive under grub2 - follow the Tutorial carefully!
You can modify the boot menu to password-protect some menu entries and you can change the grub2 menu heading too.
For non-English users, you can edit the grub.cfg file menu entries (but do not change the line set lang=eng).
A restore of an 18GB freshly-installed x64 UEFI Windows 10 system (SSD) takes about 5 minutes.
Setup
You must disable Secure Boot in the BIOS settings before you begin.
1. First use the Windows Disk Management to shrink the current partition and create two new GPT partitions (Windows key+R
- diskmgmt.msc):
The actual volume names are not important and can be changed to your own language.
The large Backup volume needs to be big enough to store a compressed image of your Windows partition.
e.g. To store all files from a minimal Windows 18GB volume (excluding pagefile) we need approx 10GB of space.
As a rough rule, to store just 1 backup image, the Backup partition should be 2/3 of the total Windows files excluding the
\pagefile.sys file (e.g. Windows = 300GB of files, Backup volume size = 180GB)
If you want to store several different backups, you will obviously need a lot more space for the backup volume.
Tip: Create another NTFS partition called 'Files' and use this volume to store any files that you do not need to be backed up
with the Windows OS.
For instance, any files which you have downloaded from the Internet or which also exist elsewhere (on another device or in the
'Cloud') do not need to be backed up with the Windows OS image.
2. Create a file called backup.tag in the root of the Backup volume and create a new Folder called images (lower case).
backup.tag
\images
NOTE: make sure it is not called backup.tag.txt by setting Explorer to show File Extensions!
Extract the \live and \EFI folders directly to the root of the Clonezilla volume
\EFI
\live
4. Download and extract the contents of this file to the (Clonezilla volume) \EFI\boot folder.
2 of 15 5/13/18, 9:27 AM
142 - Automated UEFI-Windows Restore using Cl... http://www.rmprepusb.com/tutorials/142---window...
(files)
\EFI\boot\grub.cfg
\EFI\boot\rmprep.png
(folders)
\EFI\boot\locales\
\EFI\boot\x86_64-efi\
\EFI\boot\i386-efi\
5. We need to modify the BIOS\Firmware Non-Volatile RAM so that it boots to grub2 first instead of the Windows Boot
manager file....
Either:
BootIce - UEFI - Add - (Clonezilla)\EFI\boot\bootx64.efi or bootia32.efi - (rename menu title to Clonezilla) - Save current
boot entry
- OR -
3 of 15 5/13/18, 9:27 AM
142 - Automated UEFI-Windows Restore using Cl... http://www.rmprepusb.com/tutorials/142---window...
IMPORTANT: Ensure that the new Clonezilla entry is the TOP entry (use the green arrow to move it up)
You should find that the grub2 menu now appears with Windows as the default boot entry. Check it boots to Windows OK.
Note: If you use the BIOS Boot Selection Menu of your UEFI (e.g. press F10 or F12 or F2 or whatever), you should see a
choice to boot Clonezilla or Windows Bootmgr (bootmgfw.efi).
If there is any problem with booting to Clonezilla and the grub2 menu, you can always use the BIOS Boot menu to boot to
Windows.
Make a backup
Click to enlarge image (the menu heading will be changed if you add the locales\en.mo file)
Most people will want just one backup image so they can restore it in case of emergency, so just press Z.
This will automatically make a backup called IMG to the \images\IMG folder on the Backup volume.
The user can restore it simply by booting to the Clonezilla menu and pressing A.
The A option is fully automated with no user prompts. If you prefer more control, use the R menu entry (user will be prompted
to choose a backup file).
You can edit the \EFI\grub\grub.cfg menu and delete any menu entries you do not want.
Troubleshooting
If it does not boot to the Clonezilla grub2 menu, check the EasyUEFI/BootIce settings again (tip: BootIce is actually easier to
use).
If it fails to boot to either the Clonezilla grub2 menu or Windows, use the BIOS Setup menu to set the first boot option as
Windows\bootmgfw.efi - boot to Windows and try again!
For VMs (and possibly some real UEFI-systems) you may not be able to boot to the Clonezilla menu - in this case, you will
need to do this:
4 of 15 5/13/18, 9:27 AM
142 - Automated UEFI-Windows Restore using Cl... http://www.rmprepusb.com/tutorials/142---window...
The menu entries should indicate which drive it will back up (e.g. sda4) and which drive will be used to store the backups (e.g.
sda5).
If either of these are missing, then check the \backup.tag file and that C:\Windows\Explorer.exe is present (your OS folder
should be \Windows) and that only one volume with this file exists.
Ensure you have downloaded the current standard stable release of CloneZilla (do not use older 'UEFI' versions as they are
not complete and do not detect NTFS volumes!).
If your Windows drive is not sda under CloneZilla, you will have to modify the grub.cfg menu (replace all occurrences of sda
with the correct device name).
sda$BAKDRV is the backup drive and sda$WDRV is the Windows OS volume to image. If you want the \images folder on a
different drive, change the sda$BAKDRV reference.
Sometimes, the BIOS setup utility will clear the CloneZilla UEFI entry or another UEFI tool may clear it.
It that case you will have to add it back in again!
#http://clonezilla.org/fine-print-live-doc.php?path=clonezilla-live/doc/99_Misc/00_live-boot-parameters.doc
#http://clonezilla.org/clonezilla-live/doc/02_Restore_disk_image/advanced/09-advanced-param.php
#http://drbl.org/faq/fine-print.php?path=./2_System/88_mbr_related_options.faq
#https://www.gnu.org/software/grub/manual/grub/grub.html
Note that if you add a parameter which requires double-quotes, you must precede each double-quote with a backslash \
symbol.
5 of 15 5/13/18, 9:27 AM
142 - Automated UEFI-Windows Restore using Cl... http://www.rmprepusb.com/tutorials/142---window...
insmod png
if background_image $pref/rmprep.png; then
set color_normal=black/black
set color_highlight=white/black
else
set color_normal=cyan/blue
set color_highlight=white/blue
fi
This menu will use the first colour scheme if the wallpaper file is successfully loaded, and the second scheme if it was not
successfully loaded.
menu text colours can be changed by changing the colour pairs (text\background) lines such as::
set color_normal=gray/black
set color_highlight=red/blue
Tips
File names/Folder names are case sensitive under grub2.
Before taking a backup - 'clean' Drive C to remove any junk (C: - right-click - Properties - Disk Cleanup - Clean up System
Files)
You can hide the Clonezilla volume and Backup volume from the user completely by using Diskpart:
Note that if you hide the Backup volume, the _Autoxxxx.cmd scripts will not work because the volume will not have a drive
letter.
If you set the System attribute on the IMG folder, it will not be visible in Explorer - use this command in an Admin cmd shell -
attrib d:\images +h +s /d /s
To list the drives seen by grub2, press 'C' in the Clonezilla menu and type
ls
to list the drives in the system. Then try listing folders, e.g.
ls (hd0,gpt3)/Windows/
No menu
To suppress the menu text but still show the wallpaper, add the line to grub.cfg:
set timeout_style=hidden
set timeout_style=countdown
If this option is set to ‘countdown’ or ‘hidden’, then, before displaying the menu, grub2 will wait for the timeout set by timeout to
expire. If ESC is pressed during that time, it will display the menu and wait for input. If a hotkey associated with a menu entry is
pressed, it will boot the associated menu entry immediately. If the timeout expires before either of these happens, it will boot
the default entry. In the ‘countdown’ case, it will show a one-line indication of the remaining time.
Change the timeout value to vary the length of time the wallpaper is displayed.
Password access
To prevent unauthorised access (or accidental access if the user presses 'c' or 'e') set a password (in grub.cfg file) by
uncommenting the lines and editing:
x
6 of 15 5/13/18, 9:27 AM
142 - Automated UEFI-Windows Restore using Cl... http://www.rmprepusb.com/tutorials/142---window...
With the above settings, to get access to the grub2 console (superusers only), press C and then enter a username of root and
a password of root.
I have added --unrestricted to all the menu entries to allow any menu entry to be used without needing a password.
Change this to --users "" for any entry you want to allow superuser access only or --users "doris" if a password has been set
for non-superuser doris. (e.g.add line password doris passwd to the password section)
The three files provided can be copied to any folder (or the Desktop) and must be run with Administrator rights:
_AutoBackup (run as admin).cmd - deletes the current IMG image backup and writes C:\autobackup.tag
_AutoRestore (run as admin).cmd - writes C:\autorestore.tag
_CancelAutoCmd (run as admin).cmd - cancels any previously set backup or restore operation by deleting the .tag
files - you should always run this after backup or restore has successfully completed
Note that if a restore is unsuccessful, the operation may loop infinitely (but you have 10 seconds to stop it).
Also, CloneZilla may not reboot on failure!
You could duplicate the menus and code to have a USER backup as well as a IMG backup image if you wish, but I'll leave this
up to you!
If you set a timeout value of 0, it will always immediately boot to Windows (unless you use the _Autoxxxxx.cmd scripts to start
an operation).
You can use a hex editor to modify the bytes in the en.mo file - OR -
title Patch EN.MO file\n Patch the en.mo grub2 language file
set GRUBHEAD=Windows Backup\\Restore Menu
# Modify grub2 file
cat --locate="ion %s\x00" /en.mo > nul
cat --skip=%?% --number=1 --locate=\x00 --replace="\x00%GRUBHEAD%\x00" /en.mo > nul
echo
cat --hex /en.mo
echo
pause
root ()
boot
Change the 2nd line to whatever heading you want - note that \ must be written as \\
2. Copy the en.mo file to the root of the E2B USB drive
3. Boot to E2B (use a real system or VBOX_VMUB - do NOT use the TEST_QEMU.cmd script or VBox alone or the changes
x
7 of 15 5/13/18, 9:27 AM
142 - Automated UEFI-Windows Restore using Cl... http://www.rmprepusb.com/tutorials/142---window...
4. Copy the \en.mo file to replace the one in the Clonezilla folder.
Note: the grub2 lang variable must be set to eng so that eng.mo is used. This is already done in the grub.cfg file.
ċ Tut142_CloneZilla_UEFI_Restore.zip
Download
13k v. 5 22 Sep 2017, 01:29 Steve Si
Sign in | Recent Site Activity | Report Abuse | Print Page | Powered By Google Sites
89 - Automated Windows
partition backup\restore boot
menu using CloneZilla -
RMPrepUSB
www.rmprepusb.com
Download - RMPrepUSB
www.rmprepusb.com
Subpages - RMPrepUSB
www.rmprepusb.com
8 of 15 5/13/18, 9:27 AM
142 - Automated UEFI-Windows Restore using Cl... http://www.rmprepusb.com/tutorials/142---window...
steve6375
YouTube 2K
More Info
9 of 15 5/13/18, 9:27 AM
142 - Automated UEFI-Windows Restore using Cl... http://www.rmprepusb.com/tutorials/142---window...
10 of 15 5/13/18, 9:27 AM
142 - Automated UEFI-Windows Restore using Cl... http://www.rmprepusb.com/tutorials/142---window...
11 of 15 5/13/18, 9:27 AM
142 - Automated UEFI-Windows Restore using Cl... http://www.rmprepusb.com/tutorials/142---window...
12 of 15 5/13/18, 9:27 AM
142 - Automated UEFI-Windows Restore using Cl... http://www.rmprepusb.com/tutorials/142---window...
13 of 15 5/13/18, 9:27 AM
142 - Automated UEFI-Windows Restore using Cl... http://www.rmprepusb.com/tutorials/142---window...
14 of 15 5/13/18, 9:27 AM
142 - Automated UEFI-Windows Restore using Cl... http://www.rmprepusb.com/tutorials/142---window...
Quick Links
Home
Download
Grub4dos Guide
Win8 Dual Boot
Hirens
Boot from USB in Virtual Box
Top Menu
Follow Us
Privacy Policy
back to top
15 of 15 5/13/18, 9:27 AM