[ale] how do I clone a hard drive with clonezilla
Jim Kinney
jim.kinney at gmail.com
Thu Oct 25 09:12:21 EDT 2012
Thanks for the link on pv! Nice tool. I've been using a spinner in
shell scripts to indicate the process _is_ still running and not hung
but pv looks better for some other stuff.
On Thu, Oct 25, 2012 at 9:01 AM, James Sumners <james.sumners at gmail.com> 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.
>
> 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`
>
> You can work `pv` in to get progress bars
> (http://www.ivarch.com/programs/pv.shtml).
>
> You should do this with both machines booted to some sort of rescue
> system (http://www.sysresccd.org/).
>
> You should also zero out the free space on the source drive before
> starting the copy.
>
> On Thu, Oct 25, 2012 at 8:33 AM, Phil Turmel <philip at turmel.org> wrote:
>> On 10/24/2012 03:10 AM, Ron Frazier (ALE) wrote:
>>> Hi all,
>>>
>>> How do I make an exact sector by sector clone of a hard drive with
>>> clonezilla?
>>>
>>> I want to clone /dev/sda, a 320 gb hard drive with several partitions
>>> and various file systems but only less than 300 gb allocated to the
>>> partitions
>>>
>>> to
>>>
>>> /dev/sdb, a 300 gb hard drive.
>>>
>>> I want every partition to be copied exactly sector by sector to the
>>> 2nd drive. I also want the mbr to be copied. However, I want the
>>> unallocated space at the end of the drive to be ignored. The big
>>> drive will have more than 20 gb at the end unallocated. The small
>>> drive will have about 3 gb unallocated when done.
>>>
>>> I know this can be done, because Acronis true image does it fine.
>>>
>>> Every time I try it with clonezilla, it complains about the 2nd drive
>>> being too small and aborts.
>>>
>>> I specifically want all sectors within all partitions to be copied,
>>> even unused ones. But I don't want unallocated space at the end of
>>> the drive to be copied.
>>
>> I don't use clonezilla... but I know that 'dd' does exactly what you
>> want. Any liveCD will have it available:
>>
>> dd if=/dev/sda of=/dev/sdb bs=1M
>>
>> This copies sector for sector until the end of the shorter device. The
>> "bs=1M" dramatically improves the speed of the copy.
>>
>> Personally, I use 'dc3dd' for such tasks, as it provides a nice progress
>> indicator and other options. You usually have to modify a liveUSB to
>> include it, so might not suit you at this point.
>>
>> HTH,
>>
>> Phil
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo
>
>
>
> --
> James Sumners
> http://james.roomfullofmirrors.com/
>
> "All governments suffer a recurring problem: Power attracts
> pathological personalities. It is not that power corrupts but that it
> is magnetic to the corruptible. Such people have a tendency to become
> drunk on violence, a condition to which they are quickly addicted."
>
> Missionaria Protectiva, Text QIV (decto)
> CH:D 59
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
--
--
James P. Kinney III
Every time you stop a school, you will have to build a jail. What you
gain at one end you lose at the other. It's like feeding a dog on his
own tail. It won't fatten the dog.
- Speech 11/23/1900 Mark Twain
http://electjimkinney.org
http://heretothereideas.blogspot.com/
More information about the Ale
mailing list