b5media.com

Advertise with us

Enjoying this blog? Check out the rest of the Technology Channel Subscribe to this Feed

New Linux User

HOWTO: Use the ‘dd’ Command.

by Jon on December 27th, 2005

I was at a Calgary Linux User Group installfest once and I showed an interest in Suse (9.3 at the time). In true community style, one of the people there immediately began burning a copy of the DVD for me.

The thing that I didn’t really understand at the time was that he didn’t have an ISO file. He only had his DVD yet he somehow managed to create another DVD for me. To be more correct, it’s not that I didn’t understand it, it’s that I didn’t realize the significance of what he had done until much later in my GNU/Linux experience.

The command used to create my DVD from the source DVD was the oft misunderstood dd command. In its simplest form, the dd command copies the source drive or partition to the target drive or partition block by block. This is the significant part: block by block. With dd you can create perfect images of drives or partitions for many purposes like backups or copying file structures as was the case in my CLUG story.

My memory is fuzzy, but it seems to me that after using dd to create a copy of his DVD, he must have used cdrecord to burn it to my DVD, but that’s a story for another day.

The simplest dd command takes the form of dd if=source of=destination bs=number of bytes to copy in a pass. Such as:

dd if=/dev/sda2 of=/dev/sdb2 bs=4096

Having said that, if you reverse your target and source, you’re going to be in a world of hurt as you will likely have overwritten your good data with bad data or blank sectors.

The best tutorial (and subsequent discussion thread) that I’ve seen to date is on LinuxQuestions.org. Before attempting to use dd, I recommend taking a run through the forum and reading the instructions and questions.

Here’s the link: Learn the DD command - LinuxQuestions.org

Happy copying!

POSTED IN: General

3 opinions for HOWTO: Use the ‘dd’ Command.

Have an opinion? Leave a comment:




Check Spelling
Activate Spell Check while Typing
Site Meter
Close
E-mail It