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

Ron Frazier (ALE) atllinuxenthinfo at techstarship.com
Thu Oct 25 09:00:27 EDT 2012



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

Hi Phil,

Thanks for that info.  That brings up a few of more questions.

a) Will this work even if the target device is the shorter one?
b) Will it work if the final partition doesn't end on a 1M boundary?
c) Does it copy the MBR?
d) What happens if there is a read error on the source or write error on the target?
e) Does it copy partition attributes like "active" and "boot", etc.?
f) Will it work if the source file system is mounted, ie, I'm running from the HDD, or do I have to use a live CD?

I never said why I wanted to do this in the original post, but, I want the target drive to be a backup of the source, so, I could just swap it in and run it in the event of a failure of the source drive.  In my case, I have both NTFS and EXT4 file systems, and the boot loader is Win NT.

Thanks for the help.

Sincerely,

Ron



--

Sent from my Android Acer A500 tablet with bluetooth keyboard and K-9 Mail.
Please excuse my potential brevity.

(To whom it may concern.  My email address has changed.  Replying to former
messages prior to 03/31/12 with my personal address will go to the wrong
address.  Please send all personal correspondence to the new address.)

(PS - If you email me and don't get a quick response, you might want to
call on the phone.  I get about 300 emails per day from alternate energy
mailing lists and such.  I don't always see new email messages very quickly.)

Ron Frazier
770-205-9422 (O)   Leave a message.
linuxdude AT techstarship.com




More information about the Ale mailing list