You are not logged in.

#1 2017-04-25 22:06

FlexQ4
Member
Registered: 2017-02-19
Posts: 170

The Cloning Challenge

The situation:
Once i decided to leave Windows behind, i grabed my ,experimental/backup' hard disk, tried several distros, and finally found Q4OS to be the new OS of my choice.
At that point i installed Q4 freshly on my other (newer/faster) main disk besides Windows, avoiding some mistakes i did on the first run (on the backup-hd).

On that hd however (besides some Win partitions) resides that ,first' usable (yet somewhat early-state) Q4OS-partition.

The Task:
My plan is, to use that second disk further as a backup: as well for the Q4OS-partition - exactly as i use it for backing up Windows from time to time:

The Q4OS partition is to be cloned from one disk to the other, and it has to be further bootable, besides win (as it is at the moment).
That's the job.

The Champion:
In Windows i use xxClone for that task (http://xxclone.com/).
I used it for about a decade, i use it on a weekly basis and never wasted one single thought about trying something different.

Once the backup-disk is connected("mounted") to the system (AHCI), the task above - clone the windows system partition from one disk to another - is as complicated as:

-> launch xxClone
-> select the source-partition
-> select the destination-partition
-> click the start-button
-> control if the selected partitions are correct and press 'start' once more.

Assuming a 12-GiB installation, after 2-5 Minutes (depending on how much changed since the last backup) the act is done, and booting in it, i will find myself in an identical clone of the original installation. Nice.

Some characteristics of his method are imo worth to be mentioned:

- i do not have to boot into another OS.
- i do not have to care about the exact sizes of the both partitions:
  if there' enough space on the destination, it will work
- The age of that "Wonder-Cloning App" is about 10 years (version 0.58 for Win-XP). It's size: 1.4 MB.
- it just copies (and deletes) files, and it replaces only those which changed.
- it works completely without creating archives, iso's, images or whatever.

This fact has one significant advantage: Once my daily disk has a severe error or problem, i will shut down the system, disconnct the hd, connect the backup disk and boot into a clean system (to immediately order a new hd at my preferred seller on the web).
Afterwards i'm able to investigate what can be saved from the corrupt disk... (I've had that 2 times, so i know of what i'm speaking here).

One final addition: For Cloning a simple data partition i do not bother that ,complicated' procedure described above, and rather type xxclone d:\Data x:\Data /CLONE  to get the incremental/decremental backup done.

Sure to have bored you the pants off with my windows stories, i turn back to Linux in regard of this exiguous cloning job to be carried out:

The Linux contenders:

After reading a lot about cloning/back-up for linux
Clonezilla
Ping
Mondo Rescue
Storix (a commercial Backup tool for about $500)
Partclone
Partimage
FSArchiver
two things seem to be apparently law for Linux:

a) it's not destined to do the backup-task under the Linux-system which is to be cloned - in a ,running' state.
    It's to be done however in a separate live-environment

b) All of the tools' (primary) aim seems to be to create an image/iso/archive of the partiton -
    rather than to clone it directly to another disk.

Is that true?

Whilst the 1. point initially seems only somewhat strange to me (and [would] make cloning under linux less comfortably imo), the 2. leaves me really perplexed:

1. my aim isn't to crate an image at all. I want to have a clone of a system on a separate disk!
    In case of an emergency i do not want to deal with live-systems, cd's or usb-sticks.
    I really would like to have a second disk which i can connect and work along with.

2. If, let's say 500 of the 50000 files of a partition have changed since it's last backup, doing a full backup
    into an archive/image doesn't make great sense for me.

3. Supposing again a 12-GB installation: How big will be the image/archive? 4, 5 or 6 GB?
    Where should i place/locate it, with the objective to unpack it on the backup-disk?

Please let me state frankly and honestly: i do not get the idea of the whole approach & philosphy of cloning under linux after 2 days of investigation on the web.

But maybe i can find enlightment and help here, in the forum?

Many thanks in advance!

Flex

Offline

#2 2017-04-26 02:39

cjoliprsf
Member
Registered: 2017-04-23
Posts: 71

Re: The Cloning Challenge

Flex,
First it is important to understand there are 2 types of cloning programs.
- file by file simply reads files from first disk and writes them on the second.
- sector by sector reads raw data from sectors of disks to write them on the second.

File by file has the limitation that you see with your xxclone - it simply can't read the files from an unknown partition type. Hence your program can't work with a Linux partition. On the other hand, a sector by sector program doesn't care, and can copy any type of partition since it reads raw data by sector.

The other important thing is to have the copied disk at rest. I know some programs claim to be able to clone a disk even if it is at work, but maybe I am old school, I don't trust this.

So... If I want to clone a disk I'll do 1 of 2 things:
1- physically remove the disk and bring it in a second computer where the OS at work will be that of the second computer.
2- or boot from a live CD or USB key that contains the cloning program I want to use.

This being said, here is the way I do it.
First, on a new computer, I  make a perfect clone of the disk (sector by sector) as soon as the computer is up and running. I usually use for this the EaseUS Disk Copy, on a live disk booted from a CD, but there are other equivalents. For a 1T disk this may take more than 12 hours... So I only do that once for a new disk. This cloning insures all the partitions (hidden, rescue, or whatever) are copied to the clone disk.
When I got it, the Disk Copy program from EaseUS was free, but it seems you now have to buy it. You can get a free equivalent here:
http://windowsmatters.com/2015/04/03/wi … able-apps/
this is an ISO image based on Windows PE that you will have to burn on a CD or USB key. It contains Active Disk Imager which is very good.
Other equivalents are available based on different Linux live disks.

After that I will do some "mirror" copying from the main disk to the clone. For this I use robocopy in Windows or rsync in Linux. These 2 programs have a lot of options and it is better to handle that in scripts. But once you master them they are great. They will work file by file, insuring the clone remains a perfect mirror of the main disk, and only copying the files that have changed or are new. They will also delete extra files in the clone (if you set the appropriate option and if you have deleted them in the master). This is fast, and if done on a regular basis, only takes a few minutes to keep the clone up to date.

Claude

Offline

#3 2017-05-04 09:57

FlexQ4
Member
Registered: 2017-02-19
Posts: 170

Re: The Cloning Challenge

Many Thanks Claude,

for your detailed answer and explanations! Unfortunately your method (utilizing EaseUS Disk Copy) isn't suitable for my task since the destination disk in my case is smaller than the disk with the source partition.

In general, sector-by-sector cloning (besides it's obvious restriction to eaqual sized disks as target) has imo two big drawbacks:
- it copies data that hasn't changed
- it copies unused sectors / free space

For my projection (rapid partition backup's, on a weekly basis, target-disk smaller than source) the file-by-file method seems to be the cloning type to prefere.

Flex

Offline

#4 2017-05-04 12:14

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,992

Re: The Cloning Challenge

There is another option I have used in the past called unison this might be of some help although I only used it to maintain an identical system (as far as data files go) on two seperate machines on my home network, so whichever one I used it changed the files on both machines. Not sure if it will do all you want but might be worth looking into.

Offline

#5 2017-05-10 04:40

cjoliprsf
Member
Registered: 2017-04-23
Posts: 71

Re: The Cloning Challenge

FlexQ4 wrote:

Many Thanks Claude,
for your detailed answer and explanations! Unfortunately your method (utilizing EaseUS Disk Copy) isn't suitable for my task since the destination disk in my case is smaller than the disk with the source partition.

Yes, I agree if the target disk is smaller, this can be a problem. If larger however, it is fine...

In general, sector-by-sector cloning (besides it's obvious restriction to eaqual sized disks as target) has imo two big drawbacks:
- it copies data that hasn't changed
- it copies unused sectors / free space

Yes, and this is why it has to be done only once, when you wish to transfer the exact structure of the source disk, including boot sector, hidden partitions and so on.
After that, a file-by-file backup/mirror is fine and much faster. It can even be done on a daily basis.
For my part, being an author (see http://www.chelseagreen.com/the-new-cid … -handbook), backup of my files is vital - all my manuscripts, photos, research results, are simply non replaceable, and I need a rock-solid backupping strategy.
Claude

Offline

#6 2017-05-10 17:40

FlexQ4
Member
Registered: 2017-02-19
Posts: 170

Re: The Cloning Challenge

Dear folks,
i think that i have found a solution for cloning a partition: rsync - and it's inherently part of linux!
https://wiki.archlinux.org/index.php/fu … with_rsync

I'll have to investigate that very carefully, since e.g. the fstab file is copied/replaced as well, and - that's part of the task - the backup-disk has to bootable thereafter wink

Offline

#7 2017-05-10 18:04

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,992

Re: The Cloning Challenge

I think you will first need to create the cloned partition, rsync will not be able to do that for you, but once it is created you can use rsync as the article explains.

Gparted can easily create a clone of your system but would need the system to be off-line in order to do it, I use a live-cd for this. But be warned having two filesystems with the same UUID can cause issues! It might be safer to do a fresh install on the backup drive and then you could use rsync but I would guess that too would have problems due to the articles rsync exclusions...

Offline

Board footer

Powered by FluxBB