Tuesday, April 3, 2018

How To Backup/Restore/Clone UEFI Disk Using Clonezilla

Previously, I had published a 'how-to' on how to clone a Linux HDD or SSD using Gparted, a software utility that normally comes with all major Linux distributions. However, that 'how-to' only refers to non-UEFI based PC's (i.e, PC's based on the old-fashioned legacy BIOS firmware) and can only perform with non-UEFI Linux distributions which were already installed on the HDD or SSD.

This 'how-to', however, differs from that 'how-to' in that it will handle any UEFI based GPT partitions and uses Clonezilla software utility instead of Gparted. Note that this 'how-to' will cover the cloning of HDD or SSD on a PC that has Secure Boot - you need not disable this in the firmware before proceeding any further. Make sure to use the Ubuntu-based 'amd64' alternative version of Clonezilla live for Secure Boot.


NOTE: The Clonezilla utility software is based on a frame buffer - hence the lack of screen shots. Although it is possible to create screen shots with Clonezilla, it takes some trickery - therefore NO screen shots are presented in this 'how-to'.

Also you need access to working Linux or Windows PC for downloading the additional software.


STEP 1: Preparations

Download the Clonezilla Live image here. Download the latest iso/zip image amd64 64-bit stable release (2.5.2-31 as of March 2018).

Once downloaded, create a USB/CD/DVD boot drive with the downloaded zip/iso image. Use only the 'tuxboot' utility here. Run 'tuxboot' (on Debian Linux click on Menu > Administration > Tuxboot and enter your password). The main 'tuxboot' screen will appear. On the assumption that wish to create a USB boot disk, follow the steps below below:
  1. Select 'Pre Downloaded' to '7zs' (zip).

  2. Click on the '...' button and browse to the directory where the Clonezilla zip image file is stored (most likely in the 'Downloads' folder).

  3. Select 'Type' to USB Drive (if it is not already set).

  4. Select the USB drive to use by clicking on the 'Down Arrow' button (make sure that you select the correct USB drive!).

  5. Click on the 'OK' button to start the process.

  6. Click on the 'Exit' button when finished.
You now have created a bootable Clonezilla USB disk.


STEP 2: Assumptions

For this 'how-to', I will make the following assumptions:
  1. You wish to clone/backup the SMALLER disk to a LARGER/SAME-SIZED disk. This SMALLER disk will be referred to as the SOURCE disk in this 'how-to'.

  2. The LARGER/SAME-SIZED disk is unformatted (with a GPT type partition table). This disk will be referred to as the TARGET disk in this 'how-to'.

  3. The SOURCE disk contains the OS which you want to clone or perform a backup/restore.

  4. The clone/backup/restore process will be performed on the multi-boot UEFI Linux PC here. Refer to this 'how-to' for details.


STEP 3: Backup of SOURCE Disk to a Backup Disk

The backup procedure is as follows:
  1. Insert the Clonezilla USB boot disk into a working USB port of the target PC and power it on.

  2. Press the Boot Menu key (F12 for Gigabyte motherboard, F8 for ASUS motherboard, etc.) after you hear the POST beep and the boot menu should appear.

  3. Position the cursor or highlight to the USB disk with the 'UEFI' as part of its name - usually at the beginning of the disk name. Then press the 'Enter' key and the PC will boot up from the USB disk.

  4. The Clonezilla GRUB menu will appear. The first item 'Clonezilla live (Default settings, VGA 800x600)' is already selected. Press the 'Enter' key if acceptable, or use the up/down cursor key to select the correct display mode, press the 'Enter' key and the PC will boot up.

  5. Select the language you wish to use. Note that 'English' is already selected - press the 'Enter' key if this is acceptable.

  6. Select the keymap. If 'Don't touch keymap' is acceptable to you, press the 'Enter' key - else select your choice and press the 'Enter' key.

  7. Select 'Start Clonezilla' and press the 'Enter' key.

  8. On the next screen, select the first item on the menu - 'device-image    Work with disks or partitions using images' and press the 'Enter' key.

  9. On the next screen, select 'local dev    Use local device (E.g.: hard drive, USB drive)' and press the 'Enter' key.

  10. Insert the disk for the backup image and wait for about 5 seconds. Press the 'Enter' key to start detection and the PC will mount it later under /home/partimg. Clonezilla will display the layout of the disks of the PC. If correct, press the 'Ctrl-C' key to exit the screen.

  11. On the next screen, select the correct disk for the backup and press the 'Enter' key.

  12. On the next screen, select the directory for the image, then press the 'Enter' key to browse that directory. Make sure that you select the correct directory! Then move the cursor to 'Done', then the 'Enter' key to exit. Press the 'Enter' key again as prompted.

  13. Select 'Beginner    Beginner mode: Accept the default options' and press the 'Enter' key.

  14. Select 'Saveparts    Save_local_partitions_as_an_image' and press the 'Enter' key.

  15. Input the name of the image and press the 'Enter' key.

  16. Select the partition to backup by using the 'Space-bar' on your PC and the 'asterisk' mark will appear for the selected item. Make sure that you select the correct partition! When done, press the 'Enter' key.

  17. Select '-sfsck    Skip checking/repairing source file system' and press the 'Enter' key.

  18. You can now select to check if the saved image is restorable by moving the cursor up or down. Then press the 'Enter' key.

  19. You can now select to encrypt the saved image by moving the cursor up or down. Then press the 'Enter' key.

  20. You can now select whether to shutdown, reboot or remain at the console of the PC when the backup is done. Then press the 'Enter' key.

  21. Note the information about executing the backup directly from the command line and press the 'Enter' key to proceed.

  22. The backup process will start when a confirmation is given by you pressing the 'y' key followed by the 'Enter' key. The 'partclone' process will start - at the end of the successful backup process, 'partclone' will tell you so.

  23. Depending on your choice in (20), the system will reboot, or shutdown, or remain at the console. Select 'reboot' or 'poweroff' when done.

  24. If you had power off the PC, remove the backup disk and store it in a safe place.

  25. To verify that you have actually created a backup directory/file(s), boot up the PC to one of the Linux distribution in the multi-boot system, insert the backup disk, and use the file manger to verify the existence of the directory/file(s).
Thats it - you have just performed a backup of a partition using Clonezilla.


STEP 4: Restore of a Disk from a Backup Disk Image

For this process, a blank GPT and ext4 formatted disk was inserted into the multi-boot PC to act as the target disk for the restore. This way any mistakes in the process can be avoided and the original Linux disk will not be affected.

The restore procedure is as follows:
  1. Insert the Clonezilla USB boot disk into a working USB port of the target PC and power it on.

  2. Press the Boot Menu key (F12 for Gigabyte motherboard, F8 for ASUS motherboard, etc.) after you hear the POST beep and the boot menu should appear.

  3. Position the cursor or highlight to the USB disk with the 'UEFI' as part of its name - usually at the beginning of the disk name. Then press the 'Enter' key and the PC will boot up from the USB disk.

  4. The Clonezilla GRUB menu will appear. The first item 'Clonezilla live (Default settings, VGA 800x600)' is already selected. Press the 'Enter' key if acceptable, or use the up/down cursor key to select the correct display mode, press the 'Enter' key and the PC will boot up.

  5. Select the language you wish to use. Note that 'English' is already selected - press the 'Enter' key if this is acceptable.

  6. Select the keymap. If 'Don't touch keymap' is acceptable to you, press the 'Enter' key - else select your choice and press the 'Enter' key.

  7. Select 'Start Clonezilla' and press the 'Enter' key.

  8. On the next screen, select the first item on the menu - 'device-image    Work with disks or partitions using images' and press the 'Enter' key.

  9. On the next screen, select 'local dev    Use local device (E.g.: hard drive, USB drive)' and press the 'Enter' key.

  10. Insert the USB drive for the backup image and wait for about 5 seconds. Press the 'Enter' key to start detection and the PC will mount it later under /home/partimg. Clonezilla will display the layout of the disks of the PC. If correct, press the 'Ctrl-C' key to exit the screen.

  11. On the next screen, select the correct disk for the backup and press the 'Enter' key.

  12. On the next screen, select the directory for the image, then press the 'Enter' key to browse that directory. Make sure that you select the correct directory! Then move the cursor to 'Done', then the 'Enter' key to exit. Press the 'Enter' key again as prompted.

  13. Select 'Beginner    Beginner mode: Accept the default options' and press the 'Enter' key.

  14. Select 'Restoreparts    Restore_an_image_to_local_partitions' and press the 'Enter' key.

  15. Choose the name of the image and press the 'Enter' key.

  16. Select the partition to restore by using the 'Space-bar' on your PC and the 'asterisk' mark will appear for the selected item. Make sure that you select the correct partition! When done, press the 'Enter' key.

  17. On the next screen, select the device to restore to (the target partition) and press the 'Enter' key.

  18. You can now select to check if the restore image is restorable by moving the cursor up or down. Then press the 'Enter' key.

  19. You can now select whether to shutdown, reboot or remain at the console of the PC when the restore is done. Then press the 'Enter' key.

  20. Note the information about executing the restore directly from the command line and press the 'Enter' key to proceed.

  21. The Clonezilla software will ask you to confirm several times. The actual restore process will start when a confirmation is given by you pressing the 'y' key followed by the 'Enter' key. The 'partclone' process will start - at the end of the successful restore process, 'partclone' will tell you so.

  22. Depending on your choice in (19), the system will reboot, or shutdown, or remain at the console. Select 'reboot' or 'poweroff' when done.

  23. If you had power off the PC, remove the backup/restore disk and store it in a safe place.

  24. To verify whether the restore was done properly, boot up the multi-boot PC and check the Linux distribution that was restored.
Thats it - you have just performed a restore of a partition using Clonezilla.


STEP 5: Cloning of SOURCE Disk to TARGET Disk

For this process, a blank disk was used as the target disk to clone the Windows 10 disk. The backup image was stored on the disk normally used as the backup disk and the Windows 10 was cloned from the this backup image.

The cloning procedure is as follows:
  1. Insert the Clonezilla USB boot disk into a working USB port of the target PC and power it on.

  2. Press the Boot Menu key (F12 for Gigabyte motherboard, F8 for ASUS motherboard, etc.) after you hear the POST beep and the boot menu should appear.

  3. Position the cursor or highlight to the USB disk with the 'UEFI' as part of its name - usually at the beginning of the disk name. Then press the 'Enter' key and the PC will boot up from the USB disk.

  4. The Clonezilla GRUB menu will appear. The first item 'Clonezilla live (Default settings, VGA 800x600)' is already selected. Press the 'Enter' key if acceptable, or use the up/down cursor key to select the correct display mode, press the 'Enter' key and the PC will boot up.

  5. Select the language you wish to use. Note that 'English' is already selected - press the 'Enter' key if this is acceptable.

  6. Select the keymap. If 'Don't touch keymap' is acceptable to you, press the 'Enter' key - else select your choice and press the 'Enter' key.

  7. Select 'Start Clonezilla' and press the 'Enter' key.

  8. On the next screen, select the first item on the menu - 'device-image    Work with disks or partitions using images' and press the 'Enter' key.

  9. On the next screen, select 'local dev    Use local device (E.g.: hard drive, USB drive)' and press the 'Enter' key.

  10. Insert the USB drive for the backup image and wait for about 5 seconds. Press the 'Enter' key to start detection and the PC will mount it later under /home/partimg. Clonezilla will display the layout of the disks of the PC. If correct, press the 'Ctrl-C' key to exit the screen.

  11. On the next screen, select the correct disk for the backup and press the 'Enter' key.

  12. On the next screen, select the directory for the image, then press the 'Enter' key to browse that directory. Make sure that you select the correct directory! Then move the cursor to 'Done', then the 'Enter' key to exit. Press the 'Enter' key again as prompted.

  13. Select 'Beginner    Beginner mode: Accept the default options' and press the 'Enter' key.

  14. Select 'Savedisk    Save_local_disk_as_an_image' and press the 'Enter' key.

  15. Input the name of the image and press the 'Enter' key.

  16. Select the partition to clone by using the 'Space-bar' on your PC and the 'asterisk' mark will appear for the selected item. Make sure that you select the correct partition! When done, press the 'Enter' key.

  17. Select '-sfsck    Skip checking/repairing source file system' and press the 'Enter' key.

  18. You can now select to check if the saved image is restorable by moving the cursor up or down. Then press the 'Enter' key.

  19. You can now select to encrypt the saved image by moving the cursor up or down. Then press the 'Enter' key.

  20. You can now select whether to shutdown, reboot or remain at the console of the PC when the clone is done. Then press the 'Enter' key.

  21. Note the information about executing the clone directly from the command line and press the 'Enter' key to proceed.

  22. The cloning process will start when a confirmation is given by you pressing the 'y' key followed by the 'Enter' key. The 'partclone' process will start and may take some time to complete (especially if you have a large Windows 10 disk) - remember you are cloning a whole disk! At the end of a successful clone process, 'partclone' will tell you so.

  23. Depending on your choice in (20), the system will reboot, or shutdown, or remain at the console. Select 'reboot' or 'poweroff' when done.

  24. If you had power off the PC, you can verify that you have actually created a clone directory/file(s) by removing the Clonezilla USB drive and booting up the PC using a Linux live distribution. Use a file manager to verify the existence of the directory/file(s).

  25. After you have verified that a clone image does exist on the backup disk, you now have to perform a restore of the clone image. Power down the PC and remove the current Windows 10 disk, the backup disk, and insert the target disk (onto which you want to place the image) into the PC.

  26. Repeat step (1) to (13) as given above to start Clonezilla - where you will specify the language to use, select the keymap, start Clonezilla, select 'device-image' and 'local dev', insert the backup drive and select the correct directory, and select the 'beginner' mode of Clonezilla.

  27. Select the 'restoredisk    Restore_an_image_to_local_disk' and press the 'Enter' key to proceed.

  28. Choose an image to restore and press the 'Enter' key.

  29. Choose the target disk for the restoration and press the 'Enter' key.

  30. You can now select to check if the clone image is restorable by moving the cursor up or down. Then press the 'Enter' key.

  31. You can now select whether to shutdown, reboot or remain at the console of the PC when the clone is done. Then press the 'Enter' key.

  32. The cloning process will start when a confirmation is given by you pressing the 'y' key followed by the 'Enter' key. The 'partclone' process will start and may take some time to complete (especially if you have a large Windows 10 disk). At the end of a successful clone process, 'partclone' will tell you so.

  33. Depending on your choice in (31), the system will reboot, or shutdown, or remain at the console. Select 'reboot' or 'poweroff' when done.

  34. If you had power off the PC, you can now test the cloned Windows 10 to see if it works by first removing the Clonezilla USB disk and then booting up the PC. You will find that the new Windows 10 cloned disk is the same as the old one - after all, disk cloning is nothing but the act of copying the contents of a computer's hard drive. Everything is the same and you can verify this using the Administrative Tools of the PC and check the partitions on the disk.


NOTE: On some PC, you may get a notification on some problems with the disk. To avoid this type of errors in future, check the source Windows 10 disk BEFORE it is cloned.

In any event, if you have NOT done this and if you have cloned the disk and the notification appears, it is best to scan and fix errors before you use the new cloned disk. To scan the disk and fix errors, it is best to run the proper tool on the next restart.

This tool can be found by launching Windows Explorer, right click on the system disk, click on 'Properties', click on the 'Tools' tab on the window that appears.

Click on the 'Check' button, and if any errors are found while scanning the system drive, an additional item will appear saying to scan the drive and fix the errors. Click on this and the message to scan on next reboot will appear.

Then perform a restart, let the PC check the system disk (and fix any errors it finds) and the problem will disappear.


Thats it - you have just performed a clone of a whole Windows disk using Clonezilla.

The beauty of using Clonezilla this way is that you keep a backup copy of the cloned disk on your backup disk and you can choose to restore the cloned image at any time - even if you made a boo-boo on the Windows 10 system and wants to go back to an earlier image of it.

You also have avoided using Clonezilla to clone disks directly using the 'device-device' option.

Enjoy!

No comments:

Post a Comment