In comp.os.linux.misc, Robert Heller <
hel...@deepsoft.com> wrote:
> At 5 Feb 2012 13:46:29 +0100 "Orson Cart" <
ex-p...@parts.org> wrote:
> > I try to clone a 250 GB disk PATA to a SATA drive with same CHS.
> > I use dd if=/dev/sdb of=/dev/sda
Set the block size to match the blocks used by the actual devices. For
historical reasons dd defaults to a block size of 1/2 kilobyte. Modern
devices are more likely to use a block size of 8 kilobytes.
bs=8k
If the two devices have different block sizes, dd can rechunk for you
by setting separate ibs=N (input block size) and obs=M (output) values.
> Unless the source disk is 100% full, doing a file system copy (eg tar,
> dump/restore, cpio, etc.) will almost allways be faster. Much of your
> transfer file will be copying empty (unused) sectors (a complete waste
Faster != clone. If you are doing forensic analysis, the "empty" sectors
are unlikely a waste.
Faster is not certain. Some filesystems may be faster to copy as raw data
than as individual files. Consider ext2 with tens of thousands of files
in a single directory. I've seen cpio (and rsync) run out of memory when
trying to deal with filesystems that employ millions of hard linked
files: those programs try to cache the hard link information.
> of time) and stuff like the swap partition(s) (also a complete waste of
> time). Yes, going file system by file system is more tedious, but you
> will save lots of time...
dd can copy filesystems your kernel cannot understand. dd can copy
dying disks with the need to fsck on the bad drive. dd can swap byte
endianness for you (conv=swab).
Without more information about the original use case, you can't be
certain what the best approach is.
Elijah
------
has used dd for backing up Mac HFS volumes