Using the dd Command for Archiving

Although the dd command is not normally thought of as an archiving tool, it can be used to mirror a partition or entire disk, regardless of the information either contains. dd is useful for archiving copies of floppy disks while retaining the capability to restore the data to a floppy intact. For example, sudo dd if=/dev/fd0 of=floppyimage1.img

Swapping the if= and of= values reverses the process. Although best known for copying images, dd can also be used to convert data, and it is especially useful when restoring older archives or moving data between big endian and little endian systems. Although such esoteric details are beyond the scope of this chapter, remember dd if you need to convert data from obsolete formats.

Caution

Do not confuse the if= and of= assignments; if you do, dd will be more than happy to overwrite your valid data with garbage. Use the Carpenter's Rule: "Measure twicecut once."

Was this article helpful?

0 0

Post a comment