142 - Automated UEFI-Windows Restore using CloneZilla

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.


We can backup or restore Windows with just the press of a key!
The backup is kept on the same system, no external drive is required.

We will add two new GPT partitions to the Windows internal hard disk:
  • 300MB FAT32 - Clonezilla
  • (large) NTFS - Volume to store backup image(s)
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.


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):

300MB FAT32 - Name=Clonezilla
(large) NTFS - Name=Backup - Volume to store backup image(s)

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).


NOTE: make sure it is not called backup.tag.txt by setting Explorer to show File Extensions!

3. Download the latest stable CloneZilla .zip file.

Extract the \live and \EFI folders directly to the root of the Clonezilla volume


4. Download and extract the contents of this file to the (Clonezilla volume) \EFI\boot folder.

grub.cfg is overwritten with the grub.cfg file in the download.

I have also included a rmprep.png wallpaper file which should also be placed in the same \EFI\boot folder.

Copy the three folders (locales, x86_64-efi and i386-efi) folder to the \EFI\boot folder:

New files/folders added should now be:



The three _Autoxxxxxxxx.cmd files can be copied or moved to any convenient folder (e.g. Windows Desktop or the Backup or CloneZilla volumes)

They are only required if you want to run an unattended backup or restore from Windows.

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....


5.1 Download and run BootIce... (no need to install)

BootIce - UEFI - Add - (Clonezilla)\EFI\boot\bootx64.efi or bootia32.efi - (rename menu title to Clonezilla) - Save current boot entry

Ensure Clonezilla entry is at top of list using Up button.

- OR -

5.2 Download EasyUEFI (free) and run it to install it.

Use these options to add a new default UEFI boot option.
The NVRAM in the system (the same memory that holds the UEFI firmware and BIOS Settings) is programmed.
It will add a new entry and change the BIOS boot order of your system.

Manage EFI Boot Option -
Create a new entry - (click on Clonezilla partition which should turn red if it is FAT32) -
Type=Linux or other OS -
Description=Clonezilla -
File path=\EFI\boot\bootx64.efi (or bootia32.efi if a 32-bit UEFI system)

IMPORTANT: Ensure that the new Clonezilla entry is the TOP entry (use the green arrow to move it up)

6. Now test by rebooting.

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)

The Clonezilla menu options are:
  • [W] Boot to Windows
  • [A] Auto-Restore Windows from backup file
  • [R] Restore Backup Image
  • [Z] Auto-Backup Windows
  • [N] Create New Backup Image

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 R and N options will create/restore more backups.

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.


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:

1. Run an Administrator Command shell
2. Type cmd to get to a cmd shell (in case you are running Powershell)
3. Type mountvol S: /s to mount the EFI volume as drive S:
4. Copy (Clonezilla) \EFI\grub\*.EFI to S:\EFI\boot folder
5. Create a S:\EFI\boot\grub.cfg file and add this text:

search --set -f /live/vmlinuz
configfile /EFI/boot/grub.cfg

(I have not tested this! Let me know if it doesn't work!)

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!

Configuring the Clonezilla menu

The grub.cfg file contains helpful info and URLs

# hint: cat /proc/cmdline - check clonezilla parameters
# hint: user:user pass:live

# Preseed codes (ocs = Opensource Clone System)
# video=uvesafb:mode_option=1024x768-32
# vga=788 - use video mode 788 (800-600) or 791=1024x768, 785=640x480, vga=normal (no frame buffer)
# nosplash - does not show splash screen
# quiet - reduce amount of boot messages
# keyboard-layouts=fr -set french kbd or use NONE (=US) or uk
# locales=en_US.UTF-8 - choices are de_DE.UTF-8 en_US.UTF-8 es_ES.UTF-8 fr_FR.UTF-8 it_IT.UTF-8 ja_JP.UTF-8 pt_BR.UTF-8 ru_RU.UTF-8 zh_CN.UTF-8 zh_TW.UTF-8
# - use locale -a in shell to display available locales
# noprompt - does not ask to eject CD
# vga - vieo mode 791=1024x768 788=800x600

# ocs_live_run ocs-sr parameters:
# --batch - Automate run
# -c - Asks user before completing action - Are you sure you want to continue ? (y/n)
# -e1 auto - Automatically adjust filesystem geometry for a NTFS boot partition if exists
# -t - Client does not restore the MBR (Master Boot Record)
# -g auto - Reinstall grub in client disk MBR (only if grub config exists)
# -e1 auto - Automatically adjust filesystem geometry for a NTFS boot partition if exists
# -e2 - sfdisk uses CHS of hard drive from EDD (for non-grub boot loader)
# -u - Asks the user for the image name (could be set in config too).
# restoredisk or savedisk - Which mode to run, store, restore, partition or hard-drive
# ask_user - requests name from user.
# sdax – Which hard-drive should be written or read.
# -q2 – Use “partclone".
# -z1p – Use gzip-compression (with multicore)
# -i 2048 – Split filesize in megabyte (Split every 2GB a new file for the backup - use if FAT32 backup ptn.)
# -sc - Suppress verify check after backup
# -p poweroff - power off after successfully running the script. or reboot or choose
# -rm-win-swap-hib Removes the page and hibernation files in Win if exists

You may want to change the keyboard layout or locale (language).

To prevent unattended operation add -c to the RUN1 parameters.

Note that if you add a parameter which requires double-quotes, you must precede each double-quote with a backslash \ symbol.

Wallpaper and text colours