[nmglug] cloning HD

Eric Krieger grammatoncleric at ubuntu.com
Tue Jan 4 09:39:47 PST 2011


No need to either…  the command...

dd if=/dev/sda of=/dev/sdb bs=1M conv=notrunc,noerror


...will copy everything from hard drive sda to sdb  (i.e. all
partitions, swap and all data), a true clone.  No need to create
partitions or format them on the target hard drive as the dd command
will create them because it is copy of every single block of sda.

Now if you where copying a single partition to a new drive yes you
would have to create the target partition on the new hard drive.

dd if=/dev/sda1 of=/dev/sdb1 bs=1M conv=notrunc,noerror

In the command above this would clone partition 1 on drive sda to
partition 1 on drive sdb.  In this case you would not need to format
the new target partition either as it is again copying every block of
partition 1 of the source sda1 to the target sdb1.

Hope this helps.

- Eric




On Tue, Jan 4, 2011 at 10:18 AM, BrianO'Keefe <okeefe at cybermesa.com> wrote:
> So do I need to create the partition on the new drive or just format the
> drive to ext4 and then use Nick's dd command?
>
> On 01/03/2011 02:20 PM, Nick Frost wrote:
>
> On Jan 3, 2011, at 1:59 PM, Eric Krieger wrote:
>
> How are you cloning the drive?   Are you connecting the new drive to
> the system via some sort of usb or firewire enclosure? Running...
>
> dd if=/dev/sda of=/dev/sdb
>
> Will copy all partitions from sda to sdb and just expand sda1 on the
> new drive once it's finished.  Granted it's not the fastest method but
> it works.
>
> The above works well, but I've had slightly better results with;
>
> dd if=/dev/sda of=/dev/sdb bs=1M conv=notrunc,noerror
>
> - Nick
> ---------------------------------------
> Nicholas S. Frost
> 7 Avenida Vista Grande #325
> Santa Fe, NM  87508
> nickf at frostitute.com
> ----------------------------------------
>
>
> _______________________________________________
> nmglug mailing list
> nmglug at lists.nmglug.org
> http://lists.nmglug.org/listinfo.cgi/nmglug-nmglug.org
>
> _______________________________________________
> nmglug mailing list
> nmglug at lists.nmglug.org
> http://lists.nmglug.org/listinfo.cgi/nmglug-nmglug.org
>
>


More information about the nmglug mailing list