dd?

Story: Linux Should Be Easier To CloneTotal Replies: 5
Author Content
crusadingknight

Jan 21, 2006
5:12 PM EDT
Wouldn't using dd work? ie. dd if=/dev/source of=dest.img, transfer, dd if=dest.img of=/dev/dest? Sorry, as I have very little experience with using dd for anything beyond floppies. This would seem to work very well, ie. from a pendrive, if you booted with a floppy, and had an image on the pendrive.
jdixon

Jan 21, 2006
6:23 PM EDT
For everything except the boot sectors, tar should be sufficient. And he's obviously never heard of partimage, which I believe does exactly what he wants.
jwbr

Jan 22, 2006
2:33 AM EDT
Whenever I see dd proposed as a hard disk cloning mechanism in Web discussions, I often also see some warning about doing it with no reasons given. All I can think of is that it seems dd would replicate disk fragmentation as well as the data itself. Would anyone know of any specifics with respect to using dd in this manner on hard disks?

I agree with jdixon based on what I have read: tar is easy to use and sufficient for the purposes described. One can even pipe tar output through ssh to replicate disk contents over a secure network connection. However, If extended attributes/ACLs also need to be replicated, then I believe the variant "star" should be used, though I personally have no experience with it.
jdixon

Jan 22, 2006
5:04 AM EDT
> Whenever I see dd proposed as a hard disk cloning mechanism in Web discussions, I often also see some warning about doing it with no reasons given.

From what I understand, dd does a byte by byte copy of the drive, fragmentation, empty space, the whole deal. This is not normally what you want. You normally want to only move the existing data.
thinkliberty

Jan 22, 2006
7:06 PM EDT
I use rsync to make remote backups and even local external hard drive backups. The boot sector does not get updated.. and you have to have the partions setup before hand unless you want a flat file system.

You can find hundreds of scripts on line that will do this for you.

Hell scp -r me@ip_addr:/* * would work too.
cjcox

Jan 22, 2006
7:09 PM EDT
If the drives are like or even similar (multiples), you don't need dd, just use cp.

It will get the boot block as well (so will dd I suppose).

cp /dev/hda /dev/hdb

makes a clone of hda on hdb including all partitions and the boot block.

cp /dev/hda my-linux-imag.img

Boot a rescue CD (live CD) and do a remote copy to your harddrive to image.

Bad part about full disk images is that they occupy the whole size of the drive (time/space consuming).

Posting in this forum is limited to members of the group: [ForumMods, SITEADMINS, MEMBERS.]

Becoming a member of LXer is easy and free. Join Us!