[ale] how do I clone a hard drive with clonezilla

Phil Turmel philip at turmel.org
Thu Oct 25 09:31:32 EDT 2012


On 10/25/2012 09:01 AM, James Sumners wrote:
> He said he wants to clone the _larger_ drive to the smaller drive.
> Since dd is a block-for-block copy, it won't be able to copy to the
> smaller drive; unless you don't care that it will error out with 20GB
> of blocks left to copy.

Ron's request specifically stated that the last partition was within the
size of the target.  So yes, the out-of-space error as the end is
expected and harmless.

> In regard to Clonezilla, directly from clonezilla.org: "The
> destination partition must be equal or larger than the source one."
> Also, "For unsupported file system, sector-to-sector copy is done by
> dd in Clonezilla."
> 
> I think the best way to "clone" this drive to the smaller one is to
> prepare the partitions on the second drive and then copy the file
> system over. You can do it with two computers or with both drives in
> one computer, and there are multiple ways of doing it. I usually just
> use ssh, netcat, and tar:
> 
> (on the destination machine) `cd /where/the/partition/is/mounted/ &&
> nc -l 5555 | tar xf - `
> (on the source machine) `cd /where/the/partition/is/mounted/ && tar cf
> - * | nc 192.168.0.5 5555`

I suspected from Ron's other postings that one of the partitions was
ntfs... this scrambles the ACLs and renders that partition effectively
unusable.  Ron later confirmed, so no, this isn't appropriate.

I heartily approve of this approach for pure linux FSs, the target ends
up without fragmentation.

> You can work `pv` in to get progress bars
> (http://www.ivarch.com/programs/pv.shtml).

That is a useful tool.  Thanks for that tip.

> You should do this with both machines booted to some sort of rescue
> system (http://www.sysresccd.org/).

My favorite.

> You should also zero out the free space on the source drive before
> starting the copy.

Not necessary with the tar/untar approach, as you aren't doing a sector
copy.  With a sector copy, it's only needed if using a compression ==>
slow link ==> decompression pipeline.

Regards,

Phil


More information about the Ale mailing list