Saturday, July 19, 2014

Clone, Save, Backup, Restore Hard Disk Partitions – Part II

Read Part I here.

This is the continuation from Part I of the series on how to clone, save, backup and restore of hard drive partitions. In Part I, we’ve seen on, how to clone and backup hard drive partition as files. Here In Part II, we will see, how to restore it back to same hard drive to revert it back to a previous state or restore it to an entirely new hard drive to have a new clone of your existing system.

We are continuing with the same environment setup from Part I. So please go through it, if you’re not. Now for the restoration, we’re using a new hard disk, to which the back up will be restored. After the restore operation, this hard disk will represent a new clone of the the source hard disk. This is optional, for most of the time, as you’ll be restoring your backup to the original hard disk itself to revert it back to a previous state. Nevertheless, the steps are the same, for the two scenarios.

Now we are going with our live example.

1. Make your Back Up disk available

Ensure that you’ve plugged in your Backup disk, which contains the cloned image (that is to be restored) to the system. If you’ve saved the cloned image in the original hard drive, you don’t have to do anything here.

In our case, it is a secondary hard disk, identified as ‘Sdb’ (As detailed in Part I of this series) as shown in the figure. It is now properly detected.

image

2. Make your Target Drive available

Ensure that, you’ve your target hard drive plugged into the system, to which the cloned image should be restored. If you’re restoring the cloned image to the original hard disk, you' don’t have to do anything here.

In our case, we are using a third hard disk, identified as ‘Sdc’ as shown in the below figure. It is a blank disk unformatted and being used for the first time (1TB capacity).

image

Note: If you’ were restoring the image back to your original hard drive, from which the clone was made, we don’t have to do anything here. While restoring, you’ll select the same partition of the original hard drive (from which the clone was made), in ‘CloneZilla’ wizard for restoring the image. If we talk about our case, it will be ‘Sda1’. We will choose ‘Sda1’ as the target partition for clone restoration.

3. Boot into Parted magic live CD

Boot in to Parted Magic Live CD.

Note: If you opt, you can also download the free “CloneZilla” live cd from here and “Gparted” from here. But you may need to boot into them individually. Or you can try Ultimate Boot CD. You can download it from here. We haven’t used it, but it is said to include both clonezilla and gparted.

4. Unmount Target and Backup drives

Unmount the Target disk drive and back-up disk (if they already mounted), so that “CloneZilla” can detect those. Simply right click on the drive (Open the file manager, than in the left pane, you can view the drives) and choose unmount.

5. Restore the Source Drive Partition Layout to the Target Drive [*Onetime, *Optional: You can skip this step, if you’re restoring the backup to the original drive partition]

If we choose a separate hard drive, as the target for the clone restoration, first we may need to create the same partition layout in the target hard drive, as that of the original source hard drive. In our case, we’re using ‘Sdc’, which is a brand new hard drive, so this step is necessary.

As you remember, in Part I of this series, we’ve saved the ‘Partition Layout’ of the original hard drive in a text file named ‘partitiontable.txt’. Now we will recreate that partition layout in the target hard drive using ‘sfdisk’ command.

Open a command prompt and type in the below line to recreate the partition layout in the target drive. Sdc is our target drive.

sudo sfdisk --no-reread -f /dev/sdc <  /media/Archive/partitiontable.txt

image

As you can see in the above figure, after running the command the partition tables are created in the target drive (Sdc). We can also see plenty of unallocated space in the target drive after the operation, as it is of 1TB capacity. where as the source drive had only with 250GB capacity and the entire partition table only spanned at most 250GB in total. So the rest of 790GB will be unallocated in the target drive.

Note: If you’ve already recreated the partition table layout in the target disk before, you don’t have to do it again here. It only need to be done once. So you can skip this step, if already done earlier.If you’re using the original source disk also as the target, this is also the case!

We are planning now to restore the cloned image (Sda1 of the original drive) to the corresponding partition of the target drive (Sdc1 of the target drive) in the next step.

4. Restore the Backup, to the corresponding Target Drive Partition [*Step should repeated for each partition being restored]

Now open the “CloneZilla” application and perform the below steps.

Select default selected.

image

Select ‘local_dev’.

image

This is backup-disk selection step, which contains the cloned images that are to be restored. In our case we’ve the cloned image in ‘Sdb1’ as you’ve seen in Part I of this series.

image

Within the Back-up disk, Select the top level folder, that contains the cloned images. In our case the folder name is ‘CurrentClone’, as we’ve done in Part I of this series.

image

Go for expert mode.

image

Choose ‘restoreparts’ as we are doing a restore partition operation.

image

Now select a particular cloned image, that is to be restored to a particular target partition in the target drive. As we’ve seen in Part I of this series, we’ve the cloned image of our Windows XP partition (cloned image from Sda1). We’ve selected it.

image

Choose your target partition, to which the clone image to be restored. In our case it is the first partition of the brand new third hard disk. i.e “Sdc1_26.8GB_boot…”.

Please note that, the target partition should have identical structure and size, as that of the original source partition. i.e in our case ‘Sdc1’ should be identical with the original source partition ‘Sda1’. We have made it similar by recreating the exact partition layout in Step#4 above. If they are different “CloneZilla” will fail to perform the restoration.

Note (NB): If we’re restoring the cloned image back to the original source partition (i.e Sda1 itself), Simply select the very first entry in the below figure. i.e ‘Sda1 26.8GB_ntfs_WinXp…”. This is the case, when we used to perform a rollback of the original partition to a previous state, if we encounter any issues with a newly installed update.

image

Select only ‘-c’ option. Nothing else.

image

Select default selected.

image

Select default selected.

image

Confirm twice!

image

Now relax, the process will take some time to complete.

image

Once done you can confirm the same with Gparted. In our case, you can see the ‘Sdc1’ has been restored properly. You can see the boot flag, File System Type as NTFS, Sized, Used and UnUsed space in the figure. All other partitions have not defined those value, as they are not restored yet.

image

Now perform this step again for every other partitions as well, that you would like to restore back.

Now reboot your system. If everything works perfect, you can see the grub menu and can boot to your OS. Typically you will face with boot failures, especially if you’ve done the restoration to the very first time on the target disk drive. In that case you should jump to the next step.

6. Fix Boot Issues, If you encounter

The boot repair has been much detailed in Step#3 of this article.

 

No comments:

Post a Comment