Tags:
create new tag
view all tags
dd (for copy and convert, except cc was already used so it became dd, IIUC) is a very powerful tool for copying.

I'm not sure what "convert" implies, because in the common uses I've run into (cloning a hard drive (or partition), creating a bootable floppy from a floppy image, etc., it sounds like no conversion is performed but instead an "exact copy" is made. Hmm, maybe the bootable floppy from a floppy image is a conversion, and/or maybe cloning a drive involves (automatically) converting from the geometry on one hard drive to the geometry of a different hard drive??

I'd like to add some words here about what dd does with respect to hard and soft links -- I guess in the normal case (cloning a hard drive) it preserves them "exactly". Likewise when creating a bootable floppy from an image. Are there other cases?

Aside: Things are getting out of hand, especially today as I'm rushing -- I'm violating the show it "once and only once" principle and I'll need to clean that up.

See:

Contents

Notes

Some Typical dd Commands

Copy an image to a floppy. (I'm sure the floppy has to be formatted first, I'm not sure whether a filesystem must exist, or if dd creates a filesystem from the image.

dd if=<path_to_image>/file.img of=/dev/fd0

Clone an entire hard drive to another -- _if the first has a lot of empty space you will waste some time -- consider alternatives, like clone just the partitions with data (not, for example, swap) -- I think there tools to copy just data or compress the image or something). Note: if the original drive is bigger than the "clonee", but all data can fit on the clonee, the dd will stop with an "out of space message" but may still be usable (if all the "real data" fit on the second drive).

dd if=/dev/hda of=/dev/hdb

Clone a single partition from one hard drive to another.

dd if=/dev/hda2 of=/dev/hdb2

Backup the MBR (Master Boot Record) of a hard drive (should work for a floppy as well:

dd if=/dev/hda of=backup-hda.mbr count=1 bs=512

Copy the MBR from one disk to another:

dd if=/dev/hda of=/dev/hdb count=1 bs=512

Options

There are some useful options to dd, like to specify a block size or the number of blocks to be copied (or number of repetitions -- not sure which) example now included above. You can do things like write all zeros to a drive using those options.

Clone

Page Ratings

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2003-02-24 - RandyKramer
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by PerlCopyright � 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding WikiLearn? WebBottomBar">Send feedback
See TWiki's New Look